Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
f4186c16
Commit
f4186c16
authored
Feb 06, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgp: use repodata/primary.xml for package lists when available
parent
f8fc0deb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
rpmgp
bin/rpmgp
+29
-0
No files found.
bin/rpmgp
View file @
f4186c16
...
...
@@ -64,6 +64,31 @@ get_git_list()
done
>
$list
}
# Try to get package list from repodata (rpm repos with repomd.xml)
# Usage: get_repodata_list URL LIST
# Returns 0 on success, 1 if repodata not available
get_repodata_list
()
{
local
URL
=
"
$1
"
local
LIST
=
"
$2
"
local
BASEURL
# strip trailing Packages/ if present (Fedora uses letter subdirs under Packages/)
BASEURL
=
$(
echo
"
$URL
"
|
sed
-e
's|/Packages/*$||'
)
local
REPOMD
REPOMD
=
$(
$CURL
-s
"
$BASEURL
/repodata/repomd.xml"
)
||
return
1
echo
"
$REPOMD
"
|
grep
-q
"<repomd"
||
return
1
# find primary.xml href (prefer xz/zst/gz, skip zck)
local
PRIMARY_HREF
PRIMARY_HREF
=
$(
echo
"
$REPOMD
"
|
sed
-n
's|.*<location href="\(repodata/.*primary\.xml\.[^"]*\)"/>.*|\1|p'
|
grep
-v
'\.zck$'
|
head
-1
)
[
-n
"
$PRIMARY_HREF
"
]
||
return
1
local
EXT
=
"
${
PRIMARY_HREF
##*.
}
"
local
TMPF
=
"
$OURTMPDIR
/etersoft-build-utils/primary.xml.
$EXT
"
$CURL
-s
"
$BASEURL
/
$PRIMARY_HREF
"
>
"
$TMPF
"
||
{
rm
-f
"
$TMPF
"
;
return
1
;
}
ercat
"
$TMPF
"
2>/dev/null |
grep
-o
'href="[^"]*\.src\.rpm"'
|
sed
-e
's|href="||'
-e
's|"$||'
-e
's|.*/||'
>
$LIST
rm
-f
"
$TMPF
"
[
-s
"
$LIST
"
]
}
# Using: git_list idx [force]
# set LIST variable to list file
get_list
()
...
...
@@ -82,6 +107,10 @@ get_list()
get_git_list
$SYS
$URL
$LIST
return
fi
# try repodata first (rpm repos with repomd.xml)
if
rhas
"
$URL
"
"^https*://"
&&
get_repodata_list
"
$URL
"
"
$LIST
"
;
then
return
fi
#echo -e -n "\r"
echo
"Get list for
$SYS
from
$URL
..."
#curl -l $URL/ >$LIST
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment