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
4815cc81
Commit
4815cc81
authored
Mar 11, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgs: add src.rpm download support
parent
a261e7c6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
rpmgs
bin/rpmgs
+35
-1
No files found.
bin/rpmgs
View file @
4815cc81
...
...
@@ -55,6 +55,31 @@ LISTRPMARGS=$@
}
# Extract Source tarball from src.rpm file
# Args: SRCRPM TARGET
extract_from_srcrpm
()
{
local
SRCRPM
=
"
$(
realpath
"
$1
"
)
"
local
TARGET
=
"
$2
"
local
TMPDIR
TMPDIR
=
$(
mktemp
-d
)
||
fatal
"Can't create temp dir"
info
"Extracting Source tarball from
$(
basename
"
$SRCRPM
"
)
..."
docmd
$ERCCMD
-C
"
$TMPDIR
"
x
"
$SRCRPM
"
||
{
rm
-rf
"
$TMPDIR
"
;
fatal
"Can't extract src.rpm"
;
}
# find the source tarball inside extracted directory
local
TARBALL
TARBALL
=
$(
find
"
$TMPDIR
"
-name
'*.tar*'
-o
-name
'*.tgz'
-o
-name
'*.zip'
-o
-name
'*.7z'
|
head
-1
)
if
[
-z
"
$TARBALL
"
]
;
then
rm
-rf
"
$TMPDIR
"
fatal
"No source tarball found in src.rpm"
fi
info
"Found source tarball:
$(
basename
"
$TARBALL
"
)
"
repack_tarball
"
$TARBALL
"
"
$TARGET
"
local
RET
=
$?
rm
-rf
"
$TMPDIR
"
rm
-f
"
$SRCRPM
"
return
$RET
}
repack_tarball
()
{
# TODO: move it into repack
...
...
@@ -125,6 +150,15 @@ download_to()
popd
return
$RET
fi
# handle src.rpm: extract Source tarball from it
if
echo
"
$URL
"
|
grep
-q
'\.src\.rpm$'
;
then
local
DF
=
"
$(
basename
"
$URL
"
)
"
download_url
"
$URL
"
&&
DF
=
"
$DOWNLOADEDNAME
"
&&
extract_from_srcrpm
"
$DF
"
"
$TARGET
"
local
RET
=
$?
[
"
$RET
"
=
"0"
]
||
rm
-fv
"
$DF
"
"
$TARGET
"
popd
return
$RET
fi
local
DF
=
"
$(
basename
"
$URL
"
)
"
download_url
"
$URL
"
&&
DF
=
"
$DOWNLOADEDNAME
"
&&
repack_tarball
"
$DF
"
"
$TARGET
"
local
RET
=
$?
...
...
@@ -260,7 +294,7 @@ function print_error()
{
echog
"Can't find any spec file. It is possible you run this script not in git dir."
echog
"If you use old style build, run rpmgs with spec name as arg."
echog
"
If you wish download src.rpm, use rpmgp script
."
echog
"
You can also use src.rpm URL in Source-url
."
exit
1
}
...
...
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