mirror of
https://git.centos.org/centos-git-common.git
synced 2025-02-23 08:12:56 +00:00
Added option to set explicit %dist per request
This commit is contained in:
parent
db2f8e733d
commit
733e0e2cd7
1 changed files with 20 additions and 12 deletions
32
into_srpm.sh
32
into_srpm.sh
|
@ -13,7 +13,7 @@
|
|||
#####################################################################
|
||||
usage() {
|
||||
echo '' >&2
|
||||
echo "$0 [-htq] [-b branch] [-c shasum]" >&2
|
||||
echo "$0 [-hqts] [-d dist] [-b branch] [-c shasum]" >&2
|
||||
echo '' >&2
|
||||
echo 'You need to run this from inside a sources git repo' >&2
|
||||
echo '' >&2
|
||||
|
@ -22,6 +22,8 @@ usage() {
|
|||
echo ' -t: Set srpm timestamp to commit date' >&2
|
||||
echo ' -s: Allow building as a SCL style package' >&2
|
||||
echo '' >&2
|
||||
echo ' -d: Use this %{dist} instead of automatic value'>&2
|
||||
echo '' >&2
|
||||
echo ' -b: specify a branch to examine' >&2
|
||||
echo " defaults to repo's current branch" >&2
|
||||
echo " NOTE: your repo will be set to this branch">&2
|
||||
|
@ -32,6 +34,8 @@ usage() {
|
|||
echo '' >&2
|
||||
echo " $0" >&2
|
||||
echo " $0 -b c7 -t" >&2
|
||||
echo " $0 -b c7 -s" >&2
|
||||
echo " $0 -b c7 -d yourdisthere" >&2
|
||||
echo " $0 -b remotes/origin/c7" >&2
|
||||
echo " $0 -c 865ae5909b2b5d5fb37971b7ad7960f1fd5a5ffa" >&2
|
||||
echo " $0 -b c7 -c 865ae5909b2b5d5fb37971b7ad7960f1fd5a5ffa" >&2
|
||||
|
@ -45,13 +49,14 @@ KEEPTIMESTAMP=0
|
|||
ALLOWSCL=0
|
||||
COMMITHASH=""
|
||||
BRANCH=""
|
||||
DIST=''
|
||||
|
||||
#####################################################################
|
||||
# setup args in the right order for making getopt evaluation
|
||||
# nice and easy. You'll need to read the manpages for more info
|
||||
# utilizing 'while' construct rather than 'for arg' to avoid unnecessary
|
||||
# shifting of program args
|
||||
args=$(getopt -o htsqb:c: -- "$@")
|
||||
args=$(getopt -o htsqb:c:d: -- "$@")
|
||||
eval set -- "$args"
|
||||
|
||||
while [[ 0 -eq 0 ]]; do
|
||||
|
@ -76,6 +81,11 @@ while [[ 0 -eq 0 ]]; do
|
|||
ALLOWSCL=1
|
||||
shift
|
||||
;;
|
||||
-d )
|
||||
# Set %{dist} to this instead the automatic value
|
||||
DIST=$2
|
||||
shift
|
||||
;;
|
||||
-c )
|
||||
# Use this commit id
|
||||
COMMITHASH=$2
|
||||
|
@ -118,12 +128,6 @@ if [[ $? -ne 0 ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
which get_sources.sh >/dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo 'You need get_sources.sh from centos-git-common in PATH' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
which show_possible_srpms.sh >/dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo 'You need show_possible_srpms.sh from centos-git-common in PATH' >&2
|
||||
|
@ -180,10 +184,14 @@ fi
|
|||
|
||||
# build our rpmopts list
|
||||
RPMOPTS="-bs --nodeps"
|
||||
if [[ ${QUIET} -eq 1 ]]; then
|
||||
DIST=$(return_disttag.sh -q)
|
||||
else
|
||||
DIST=$(return_disttag.sh)
|
||||
|
||||
# determine automatically unless we've got one set
|
||||
if [[ "x${DIST}" == 'x' ]]; then
|
||||
if [[ ${QUIET} -eq 1 ]]; then
|
||||
DIST=$(return_disttag.sh -q)
|
||||
else
|
||||
DIST=$(return_disttag.sh)
|
||||
fi
|
||||
fi
|
||||
|
||||
# put it all together
|
||||
|
|
Loading…
Add table
Reference in a new issue