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
0
Merge Requests
0
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
65b48c0b
Commit
65b48c0b
authored
Oct 02, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgs: if tarball is not tar, try download it firstly
parent
b16e320e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
rpmgs
bin/rpmgs
+14
-6
No files found.
bin/rpmgs
View file @
65b48c0b
...
...
@@ -69,14 +69,21 @@ download_any_tarball()
{
local
GETSOURCE
=
"
$1
"
local
TARGET
=
"
$2
"
local
ext
local
FORMATS
=
"tar.xz tar.bz2 tar.gz zip tgz 7z tbz2 tbz rar tar"
local
BASESOURCE
=
"
$GETSOURCE
"
# drop any ext
for
ext
in
$FORMATS
;
do
BASESOURCE
=
$(
echo
"
$BASESOURCE
"
|
sed
-e
"s|
\.
$ext$|
|g"
)
done
# try download with some ext
local
ORIGEXT
=
$(
rhas
"
$BASESOURCE
"
"
\.
"
&&
echo
"
$BASESOURCE
"
|
sed
-e
"s|.*
\.
||"
)
[
-n
"
$ORIGEXT
"
]
||
fatal
"Have no idea how to load files without extension"
# first try download with original extension (exclude for tar)
if
[
"
$ORIGEXT
"
!=
"tar"
]
;
then
FORMATS
=
"
$ORIGEXT
$(
estrlist exclude
"
$ORIGEXT
"
"
$FORMATS
"
)
"
fi
BASESOURCE
=
$(
echo
"
$BASESOURCE
"
|
sed
-e
"s|
\.
$ORIGEXT$|
|g"
)
local
ext
# try download by exts list
for
ext
in
$FORMATS
;
do
[
-n
"
$FORCEDOWNLOAD
"
]
&&
docmd
rm
-f
"
$BASESOURCE
.
$ext
"
download_url
"
$BASESOURCE
.
$ext
"
||
continue
...
...
@@ -105,6 +112,7 @@ function source_ext()
GETSOURCEEXT
=
$(
eval_spec
"
$TMPSPEC
"
| get_var
"Summary"
)
rm
-f
"
$TMPSPEC
"
fi
echo
"
$GETSOURCEEXT
"
test
-n
"
$GETSOURCEEXT
"
}
...
...
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