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
1d9b0f5a
You need to sign in or sign up before continuing.
Commit
1d9b0f5a
authored
Apr 08, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgs: use real list of Source* tags
parent
58724499
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
rpmgs
bin/rpmgs
+21
-18
No files found.
bin/rpmgs
View file @
1d9b0f5a
...
...
@@ -17,7 +17,7 @@ load_mod rpm tarball web buildsrpm
WEXT
=
""
GETSOURCE
=
""
LOAD
LIST
=
"0"
LOAD
ALL
=
''
#############################
Usage
=
"Usage:
$name
[-a -f ] [spec] [new_version]"
...
...
@@ -40,7 +40,7 @@ phelp()
while
getopts
:haf opt
;
do
case
$opt
in
h
)
phelp
;
exit
0
;;
a
)
LOAD
LIST
=
"
$(
seq
0 100
)
"
;;
a
)
LOAD
ALL
=
1
;;
f
)
FORCEDOWNLOAD
=
-f
;;
+?
)
echog
"
$name
: options should not be preceded by a '+'."
1>&2
;
exit
2
;;
?
)
echog
"
$name
:
$OPTARG
: bad option. Use -h for help."
1>&2
;
exit
2
;;
...
...
@@ -54,11 +54,6 @@ LISTRPMARGS=$@
}
function
get_source
()
{
GETSOURCE
=
$(
eval_spec
$1
| get_var
"
$2
"
)
}
repack_tarball
()
{
[
"
$(
realpath
"
$1
"
)
"
=
"
$(
realpath
"
$2
"
)
"
]
&&
return
...
...
@@ -100,11 +95,11 @@ function source_ext()
# %define SourceUrl ftp://updates.etersoft.ru/pub/Etersoft/WINE@Etersoft/last/sources/tarball/%name-%version.tar.gz
#GETSOURCEURL=$(eval_spec $1 | grep -i "^%define ${2}Url${3} " | head -n 1 | sed -e "s/ *\$//g" | sed -e "s/^%define[ \t].*[ \t]//g")
local
SN
=
"
$3
"
[
"
$SN
"
=
"0"
]
&&
SN
=
"
$SN
\?
"
if
grep
-q
"^#
Source
$SN
-
$2
:"
"
$1
"
;
then
#
[ "$SN" = "0" ] && SN="$SN\?"
if
grep
-q
"^#
$SN
-
$2
:"
"
$1
"
;
then
local
TMPSPEC
=
$1
.tmpurl
local
NEWSOURCE
=
$(
grep
--text
"^#
Source
$SN
-
$2
:"
"
$1
"
|
sed
-e
"s/.*
$2
:[
\t
]*//g"
|
tail
-n1
)
test
-n
"
$NEWSOURCE
"
||
fatal
"Can't extract URL from
Source
$SN
-
$2
"
local
NEWSOURCE
=
$(
grep
--text
"^#
$SN
-
$2
:"
"
$1
"
|
sed
-e
"s/.*
$2
:[
\t
]*//g"
|
tail
-n1
)
test
-n
"
$NEWSOURCE
"
||
fatal
"Can't extract URL from
$SN
-
$2
"
# Fake replace for correct subst variables
NEWSOURCE
=
"
$(
echo
"
$NEWSOURCE
"
|
sed
-e
's|\&|\\&|g'
)
"
# TODO: use special field before %build
...
...
@@ -312,13 +307,13 @@ do
fi
fi
for
nn
in
""
$LOADLIST
do
get_source
$spec
"Source
$nn
"
SOURCELIST
=
"Source Source0"
[
-n
"
$LOADALL
"
]
&&
SOURCELIST
=
$(
grep
"^Source[0-9]*:"
$spec
|
sed
-e
"s|:.*||g"
)
for
SN
in
$SOURCELIST
do
GETSOURCE
=
$(
eval_spec
$spec
| get_var
"
$SN
"
)
[
-z
"
$GETSOURCE
"
]
&&
continue
#[ "$GETSOURCE$nn" = "0" ] && continue
#test -z "$GETSOURCE" && { echog "Skip Source${nn} from $spec" ; continue ; }
FTB
=
`
basename
"
$GETSOURCE
"
`
# for get RPMSOURCEDIR
...
...
@@ -333,7 +328,7 @@ do
mkdir
-p
$RPMSOURCEDIR
/
&&
pushd
$RPMSOURCEDIR
/
>
/dev/null
||
fatal
"Can't create/chdir..."
# Test for eterbuild extensions (will set GETSOURCEURL or GETSOURCESVN)
get_source_url
$spec
$
nn
||
get_source_git
$spec
$nn
||
get_source_svn
$spec
$nn
get_source_url
$spec
$
SN
||
get_source_git
$spec
$SN
||
get_source_svn
$spec
$SN
if
!
rhas
"
$GETSOURCE
"
".tar$"
;
then
warning
"It is recommended to use .tar tarballs for sources (
$FTB
now)"
...
...
@@ -352,7 +347,15 @@ do
# FIXME: gear-update can use any tarball
repack_tarball
"
$(
basename
"
$GETSOURCEURL
"
)
"
"
$FTB
"
else
rhas
"
$GETSOURCE
"
"ps?://"
||
fatal
"
$GETSOURCE
is not URL"
if
!
rhas
"
$GETSOURCE
"
"ps?://"
;
then
if
[
"
$SN
"
!=
"Source"
]
&&
[
"
$SN
"
!=
"Source0"
]
;
then
info
"No URL. Skipping
$GETSOURCE
downloading"
continue
else
# only for main source
fatal
"
$SN
$GETSOURCE
has no URL"
fi
fi
download_any_tarball
"
$GETSOURCE
"
"
$FTB
"
# TODO: fix download single packed file
#else
...
...
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