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
983bed75
Commit
983bed75
authored
Apr 08, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgs: skip redownloading for tarballs already exists
parent
1d9b0f5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
rpmgs
bin/rpmgs
+18
-6
No files found.
bin/rpmgs
View file @
983bed75
...
@@ -34,7 +34,7 @@ phelp()
...
@@ -34,7 +34,7 @@ phelp()
echo
echo
echog
"Options:"
echog
"Options:"
echog
" -a get all source (not only Source|Source0)"
echog
" -a get all source (not only Source|Source0)"
echog
" -f force download (remove source file before download)"
echog
" -f force download
and commit tarball(s)
(remove source file before download)"
}
}
while
getopts
:haf opt
;
do
while
getopts
:haf opt
;
do
...
@@ -60,6 +60,13 @@ repack_tarball()
...
@@ -60,6 +60,13 @@ repack_tarball()
docmd erc
-f
repack
"
$1
"
"
$2
"
docmd erc
-f
repack
"
$1
"
"
$2
"
}
}
check_tarball
()
{
[
-s
"
$1
"
]
||
return
erc
-q
check
"
$1
"
}
# Args: URL target_file
download_any_tarball
()
download_any_tarball
()
{
{
local
GETSOURCE
=
"
$1
"
local
GETSOURCE
=
"
$1
"
...
@@ -68,7 +75,7 @@ download_any_tarball()
...
@@ -68,7 +75,7 @@ download_any_tarball()
local
BASESOURCE
=
"
$GETSOURCE
"
local
BASESOURCE
=
"
$GETSOURCE
"
local
ORIGEXT
=
$(
rhas
"
$BASESOURCE
"
"
\.
"
&&
echo
"
$BASESOURCE
"
|
sed
-e
"s|.*
\.
||"
)
local
ORIGEXT
=
$(
rhas
"
$BASESOURCE
"
"
\.
"
&&
echo
"
$BASESOURCE
"
|
sed
-e
"s|.*
\.
||"
)
[
-n
"
$ORIGEXT
"
]
||
fatal
"Have no idea how to load files without extension"
[
-n
"
$ORIGEXT
"
]
||
fatal
"
Error with
$GETSOURCE
.
Have no idea how to load files without extension"
# first try download with original extension (exclude for tar)
# first try download with original extension (exclude for tar)
if
[
"
$ORIGEXT
"
!=
"tar"
]
;
then
if
[
"
$ORIGEXT
"
!=
"tar"
]
;
then
...
@@ -81,6 +88,7 @@ download_any_tarball()
...
@@ -81,6 +88,7 @@ download_any_tarball()
# try download by exts list
# try download by exts list
for
ext
in
$FORMATS
;
do
for
ext
in
$FORMATS
;
do
[
-n
"
$FORCEDOWNLOAD
"
]
&&
docmd
rm
-f
"
$BASESOURCE
.
$ext
"
[
-n
"
$FORCEDOWNLOAD
"
]
&&
docmd
rm
-f
"
$BASESOURCE
.
$ext
"
[
-z
"
$FORCEDOWNLOAD
"
]
&&
check_tarball
"
$TARGET
"
&&
{
echo
"
$TARGET
already exists, continue... "
;
continue
;
}
download_url
"
$BASESOURCE
.
$ext
"
||
continue
download_url
"
$BASESOURCE
.
$ext
"
||
continue
repack_tarball
"
$(
basename
"
$BASESOURCE
.
$ext
"
)
"
"
$TARGET
"
||
continue
repack_tarball
"
$(
basename
"
$BASESOURCE
.
$ext
"
)
"
"
$TARGET
"
||
continue
return
return
...
@@ -342,10 +350,14 @@ do
...
@@ -342,10 +350,14 @@ do
# TODO: rewrite code to use original file format and temp. download dir
# TODO: rewrite code to use original file format and temp. download dir
elif
[
-n
"
${
GETSOURCEURL
}
"
]
;
then
elif
[
-n
"
${
GETSOURCEURL
}
"
]
;
then
echog
"Try to load
${
GETSOURCEURL
}
for
$spec
"
if
[
-z
"
$FORCEDOWNLOAD
"
]
&&
check_tarball
"
$FTB
"
;
then
download_url
"
$GETSOURCEURL
"
||
fatal
"Can't download
$GETSOURCEURL
"
echo
"
$FTB
already exists, skipping... "
# FIXME: gear-update can use any tarball
else
repack_tarball
"
$(
basename
"
$GETSOURCEURL
"
)
"
"
$FTB
"
echog
"Try to load
${
GETSOURCEURL
}
for
$spec
"
download_url
"
$GETSOURCEURL
"
||
fatal
"Can't download
$GETSOURCEURL
"
# FIXME: gear-update can use any tarball
repack_tarball
"
$(
basename
"
$GETSOURCEURL
"
)
"
"
$FTB
"
fi
else
else
if
!
rhas
"
$GETSOURCE
"
"ps?://"
;
then
if
!
rhas
"
$GETSOURCE
"
"ps?://"
;
then
if
[
"
$SN
"
!=
"Source"
]
&&
[
"
$SN
"
!=
"Source0"
]
;
then
if
[
"
$SN
"
!=
"Source"
]
&&
[
"
$SN
"
!=
"Source0"
]
;
then
...
...
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