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
89afa417
Commit
89afa417
authored
11 years ago
by
Jim Pryor
Committed by
Natanael Copa
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
apkgrel, functions: refactor calculation of APKBUILD's path
parent
b2d6b47b
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apkgrel.in
+10
-3
10 additions, 3 deletions
apkgrel.in
functions.sh.in
+13
-0
13 additions, 0 deletions
functions.sh.in
with
23 additions
and
3 deletions
apkgrel.in
+
10
−
3
View file @
89afa417
...
...
@@ -45,9 +45,8 @@ do_add () {
local
f
=
old
=
for
f
;
do
[
-n
"
$only_clean_git
"
]
\
&&
[
-n
"
$(
git diff
--name-only
"
$
f
"
)
"
]
\
&&
[
-n
"
$(
git diff
--name-only
"
$
{
f
%/*
}
"
)
"
]
\
&&
continue
[
-d
"
$f
"
]
&&
f
=
"
$f
/APKBUILD"
old
=
$(
show_plain
"
$f
"
)
case
$old
in
[
0-9]
*
)
setto
=
$((
old
+
1
))
;;
...
...
@@ -61,7 +60,6 @@ do_verify() {
[
-n
"
$force
"
]
&&
return
0
local
f
=
rc
=
0
for
f
;
do
[
-d
"
$f
"
]
&&
f
=
"
$f
/APKBUILD"
if
!
grep
-q
'^pkgrel=[0-9]'
"
$f
"
;
then
error
"no proper
\$
pkgrel for
$f
"
rc
=
1
...
...
@@ -124,6 +122,15 @@ if [ $# -eq 0 ]; then
exit
2
fi
# normalize $@ into paths to APKBUILDs
[
"
$(
echo
"
$@
"
|
wc
-l
)
"
-eq
1
]
||
die
"can't handle paths with embedded newlines"
args
=
$(
for
a
;
do
p
=
$(
any_buildscript
"
$a
"
)
||
die
"can't find APKBUILD for
$a
"
;
echo
"
$p
"
;
done
)
[
$?
-eq
0
]
||
exit
1
oldifs
=
$IFS
IFS
=
$'
\n
'
set
--
$args
IFS
=
$oldifs
do_verify
"
$@
"
||
exit
1
$cmd
"
$@
"
This diff is collapsed.
Click to expand it.
functions.sh.in
+
13
−
0
View file @
89afa417
...
...
@@ -30,6 +30,19 @@ aports_buildscript() {
fi
}
# expects $1 to be a file, or a directory containing an APKBUILD, or a package directory in the aports tree
# outputs APKBUILD's path if successful (doesn't verify that it's a valid APKBUILD)
any_buildscript() {
if [ -f "$1" ]; then
echo "$1"
elif [ -d "$1" ]; then
[ -f "$1/APKBUILD" ] || return 1
echo "$1/APKBUILD"
else
aports_buildscript "$1" || return 1
fi
}
# output functions
case $prog in
...
...
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