Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakub Panek
aports
Commits
0a11c5e3
Commit
0a11c5e3
authored
13 years ago
by
Natanael Copa
Browse files
Options
Downloads
Patches
Plain Diff
apkgrel: optionally bump pkgrel when git is unclean
parent
761472d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apkgrel.in
+16
-7
16 additions, 7 deletions
apkgrel.in
with
16 additions
and
7 deletions
apkgrel.in
+
16
−
7
View file @
0a11c5e3
...
@@ -14,6 +14,10 @@ do_set() {
...
@@ -14,6 +14,10 @@ do_set() {
do_add
()
{
do_add
()
{
local
f
=
old
=
local
f
=
old
=
for
f
in
"
$@
"
;
do
for
f
in
"
$@
"
;
do
[
-n
"
$only_clean_git
"
]
\
&&
[
-n
"
$(
git diff
--name-only
$f
)
"
]
\
&&
continue
[
-d
"
$f
"
]
&&
f
=
"
$f
/APKBUILD"
old
=
$(
do_show
"
$f
"
)
old
=
$(
do_show
"
$f
"
)
setto
=
$((
$old
+
1
))
setto
=
$((
$old
+
1
))
do_set
"
$f
"
||
return
1
do_set
"
$f
"
||
return
1
...
@@ -22,12 +26,15 @@ do_add () {
...
@@ -22,12 +26,15 @@ do_add () {
do_verify
()
{
do_verify
()
{
[
-n
"
$force
"
]
&&
return
0
[
-n
"
$force
"
]
&&
return
0
if
!
grep
-q
'^pkgrel=[0-9]'
"
$@
"
;
then
local
f
=
rc
=
0
echo
"The following files does not have proper pkgrel:"
>
&2
for
f
in
"
$@
"
;
do
grep
-L
'^pkgrel=[0-9]'
"
$@
"
>
&2
[
-d
"
$f
"
]
&&
f
=
"
$f
/APKBUILD"
return
1
if
!
grep
-q
'^pkgrel=[0-9]'
"
$f
"
;
then
fi
echo
"
$f
: Has no proper pkgrel"
>
&2
return
0
rc
=
1
fi
done
return
$rc
}
}
do_nothing
()
{
do_nothing
()
{
...
@@ -39,6 +46,7 @@ do_usage() {
...
@@ -39,6 +46,7 @@ do_usage() {
Usage:
$program
-a|-h|-s NUM|-t|-z [-f] FILE...
Usage:
$program
-a|-h|-s NUM|-t|-z [-f] FILE...
Commands:
Commands:
-a Add 1 to current pkgrel
-a Add 1 to current pkgrel
-g Only do the change on files that have clean git status
-h Show this help
-h Show this help
-s Set pkgrel to NUM
-s Set pkgrel to NUM
-t Only verify that files are in proper format
-t Only verify that files are in proper format
...
@@ -52,9 +60,10 @@ __EOF__
...
@@ -52,9 +60,10 @@ __EOF__
cmd
=
do_show
cmd
=
do_show
force
=
force
=
while
getopts
"afhs:tz"
opt
;
do
while
getopts
"af
g
hs:tz"
opt
;
do
case
$opt
in
case
$opt
in
a
)
cmd
=
do_add
;;
a
)
cmd
=
do_add
;;
g
)
only_clean_git
=
1
;;
f
)
force
=
1
;;
f
)
force
=
1
;;
h
)
cmd
=
do_usage
;;
h
)
cmd
=
do_usage
;;
s
)
setto
=
$OPTARG
;
cmd
=
do_set
;;
s
)
setto
=
$OPTARG
;
cmd
=
do_set
;;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment