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
b31bad93
Commit
b31bad93
authored
Jun 02, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmbs: rewrite check_gear_and_tag with is_last_commit_tag
parent
10e1c2a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
rpmbs
bin/rpmbs
+20
-14
No files found.
bin/rpmbs
View file @
b31bad93
#!/bin/bash
# (c) Etersoft 2003-201
0
# Author: Vitaly Lipatov <lav@etersoft.ru>
# (c) Etersoft 2003-201
2
# Author: Vitaly Lipatov <lav@etersoft.ru>
, 2012
# Public domain
#
# BS - build source
...
...
@@ -99,43 +99,49 @@ LISTRPMARGS=$@
}
# create tag according to package release
# used: SPECDIR, LISTNAMES, FORCE
check_gear_and_tag
()
{
local
RESULT
=
0
local
GEARCTAG
=
gear-create-tag
local
TAG
=
"
$1
"
# set SPECDIR from LISTNAMES if empty
[
-n
"
$SPECDIR
"
]
||
set_specdir
$LISTNAMES
# do check only on gear repo
is_gear
$SPECDIR
||
return
0
if
[
-z
"
$FORCE
"
]
&&
is_last_commit_tag
$TAG
;
then
echo
"Tag
$TAG
already exists for the last commit"
return
0
fi
test
-n
"
$TAG
"
&&
echo
"Create
$TAG
tag..."
# FIXME: uncomment use-agent in ~/.gnupg/gpg.conf, but with ssh access to build server I got
# gpg: problem with the agent - disabling agent use
# gpg: Invalid passphrase; please try again ...
# needed correct user.name/user.email for get GPG id
# gpg tries to use the agent but will fallback to the regular mode
# if there is a problem connecting to the agent.
# GPG_AGENT_INFO=
# set SPECDIR from LISTNAMES if empty
[
-n
"
$SPECDIR
"
]
||
set_specdir
$LISTNAMES
[
-n
"
$FORCE
"
]
&&
echo
"Force create
$TAG
tag..."
||
echo
"Create
$TAG
tag..."
if
is_gear
$SPECDIR
;
then
# needed correct user.name/user.email for get GPG id
cd
$SPECDIR
>
/dev/null
# default: <VERSION>-<RELEASE>
docmd
$GEARCTAG
$FORCE
||
RESULT
=
1
# try direct set rule file
# FIXME: always use for gear repo path to rule file
# Note: gear-create-tag can't use links, hack with readlink
# TODO: skip notification if tag still at last commit
if
[
"
$RESULT
"
=
1
]
;
then
if
$GEARCTAG
$FORCE
2>&1 |
grep
-q
"Too many specfiles found"
;
then
docmd
$GEARCTAG
$FORCE
-r
.gear/
$(
readlink
.gear/rules
)
&&
RESULT
=
0
elif
$GEARCTAG
$FORCE
2>&1 |
grep
-q
"already exists"
;
then
echog
"Note! Tag unchanged! Use -f key for override tag"
RESULT
=
0
RESULT
=
1
fi
fi
test
-z
"
$TAG
"
||
docmd git tag
-v
"
$TAG
"
||
fatal
"Tag
$TAG
is missed in
repo"
test
-z
"
$TAG
"
||
docmd git tag
-v
"
$TAG
"
||
fatal
"Tag
$TAG
still missed in the
repo"
cd
-
>
/dev/null
fi
return
$RESULT
}
...
...
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