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
fcf31d0e
You need to sign in or sign up before continuing.
Commit
fcf31d0e
authored
Mar 03, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgp: use parse_cmd_pre, rewrite parsing, update help
parent
a872be35
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
27 deletions
+19
-27
rpmgp
bin/rpmgp
+19
-27
No files found.
bin/rpmgp
View file @
fcf31d0e
...
...
@@ -139,11 +139,10 @@ update_cache_list()
done
}
Usage
=
"Usage:
$name
[options
] [system] pkgname"
function
mygetopts
()
Usage
=
"Usage:
rpmgp [options] [-
$CURRENTBRANCHNAME
] [system] pkgname"
mygetopts
()
{
name
=
${
0
##*/
}
Descr
=
"
$name
- various package download operations"
Descr
=
"rpmgp - various package download operations"
phelp
()
{
...
...
@@ -151,8 +150,7 @@ phelp()
echog
"
$Descr
"
echog
"
$Usage
"
echog
"Options:"
echog
"rpmgp [options] [system] pkgname - download src.rpm from 'system' repository"
echog
" name - installed package name or src.rpm"
echog
" pkgname - installed package name or src.rpm"
echog
" system - name of system (ALT Linux by default if -a missed)"
echog
" -a search pkgname in all known repositories"
echog
" -c check if this package exists in the ALT Linux repository"
...
...
@@ -195,15 +193,11 @@ if [ $# -gt 0 ]; then
fi
# pass other options to RPM:
LISTARGS
=
$@
LIST
RPM
ARGS
=
$@
}
mygetopts
"
$@
"
# remove args that were options
if
[
$#
-gt
0
]
;
then
shift
$((
OPTIND
-
1
))
fi
parse_cmd_pre
"
$@
"
mygetopts
$LISTARGS
# optional arg
if
[
-n
"
$UPDATECACHE
"
]
;
then
...
...
@@ -211,8 +205,8 @@ if [ -n "$UPDATECACHE" ] ; then
exit
0
fi
test
-z
"
$LISTARGS
"
&&
fatal
"Please run with spec/package name"
PKGNAME
=
$(
strip_spaces
$LISTRPMARGS
$LISTNAMES
)
test
-z
"
$PKGNAME
"
&&
fatal
"Please run with spec/package name"
# список названий систем, адресов (с зеркалами?), и режимов фильтрации
# название кэш-файла строить из названия системы
...
...
@@ -222,7 +216,7 @@ test -z "$LISTARGS" && fatal "Please run with spec/package name"
# install required for build binary packages
if
[
-n
"
$INSTALLBINARY
"
]
;
then
parse_cmd_pre
"
$@
"
# pack by LISTNAMES list
pack_src_rpm
--commit
$LISTRPMARGS
LISTPKG
=
$(
rpmquery
--requires
-p
$LISTBUILT
| clean_pkgreq |
sed
-e
"s|rpm-build-altlinux-compat||g"
)
DISTRVENDOR
=
$(
distr_vendor
-d
)
...
...
@@ -232,7 +226,6 @@ if [ -n "$INSTALLBINARY" ] ; then
fi
if
[
-n
"
$MIGRATEGEAR
"
]
;
then
parse_cmd_pre
"
$@
"
for
INFILE
in
$LISTNAMES
;
do
# call for each file due generated BASENAME
LISTNAMES
=
$INFILE
pack_src_rpm
$INFILE
$LISTRPMARGS
...
...
@@ -256,7 +249,6 @@ fi
# clone remote git
if
[
-n
"
$CLONEGIT
"
]
;
then
PKGNAME
=
$1
INITLETTER
=
$(
echo
$PKGNAME
|
cut
-c1
)
# http://git.altlinux.org/gears/N/NAME.git
...
...
@@ -293,16 +285,15 @@ fi
if
[
-n
"
$CHECKONLINE
"
]
;
then
# possible it is spec
if
[
-f
$1
]
;
then
build_rpms_name
"
$
1
"
if
[
-f
"
$PKGNAME
"
]
;
then
build_rpms_name
"
$
PKGNAME
"
SRCRPM
=
$NAMESRPMIN
PKGNAME
=
$(
get_pkgname_from_filename
$SRCRPM
)
else
if
echo
$
1
|
grep
-q
rpm
;
then
SRCRPM
=
$
1
if
echo
$
PKGNAME
|
grep
-q
rpm
;
then
SRCRPM
=
$
PKGNAME
PKGNAME
=
$(
get_pkgname_from_filename
$SRCRPM
)
else
PKGNAME
=
$1
SRCRPM
=
$(
querypackage
$PKGNAME
""
"%{SOURCERPM}
\n
"
|
tail
-n
1
)
fi
fi
...
...
@@ -316,10 +307,9 @@ if [ -n "$CHECKONLINE" ] ; then
fi
fi
list_git_package
$PKGNAME
# TODO: BINARYREPO
echo
-n
"ACL list for sisyphus: "
ssh
$GIRARHOST
acl sisyphus
$PKGNAME
show
set_binaryrepo
$MENV
echo
-n
"ACL list for
$BINARYREPO
: "
ssh
$GIRARHOST
acl
$BINARYREPO
$PKGNAME
show
RET
=
"MISSED"
if
[
-n
"
$SRCRPM
"
]
;
then
for
i
in
$REPOSITORY
;
do
...
...
@@ -336,6 +326,8 @@ if [ -n "$CHECKONLINE" ] ; then
exit
0
fi
# FIXME: use mygetopts (LISTRPMARGS and so)
if
[
-n
"
$2
"
]
&&
[
"
$1
"
=
"all"
]
;
then
shift
ALLSYSTEM
=
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