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
cfa6c7d6
Commit
cfa6c7d6
authored
11 years ago
by
Jim Pryor
Committed by
Natanael Copa
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
various: fancier readconfig, permit env overrides
parent
89afa417
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
abuild-keygen.in
+7
-7
7 additions, 7 deletions
abuild-keygen.in
abuild-sign.in
+2
-2
2 additions, 2 deletions
abuild-sign.in
checkapk.in
+1
-1
1 addition, 1 deletion
checkapk.in
functions.sh.in
+61
-14
61 additions, 14 deletions
functions.sh.in
with
71 additions
and
24 deletions
abuild-keygen.in
+
7
−
7
View file @
cfa6c7d6
...
...
@@ -30,7 +30,7 @@ get_privkey_file() {
default_name
=
"
${
emailaddr
:-
$USER
}
-
$(
printf
"%x"
$(
date
+%s
))
"
privkey
=
"
$
abuild_home
/
$default_name
.rsa"
privkey
=
"
$
ABUILD_USERDIR
/
$default_name
.rsa"
[
-n
"
$non_interactive
"
]
&&
return
0
msg
"Generating public/private rsa key pair for abuild"
echo
-n
"Enter file in which to save the key [
$privkey
]: "
...
...
@@ -42,7 +42,7 @@ get_privkey_file() {
}
do_keygen
()
{
mkdir
-p
"
$
abuild_home
"
mkdir
-p
"
$
ABUILD_USERDIR
"
get_privkey_file
pubkey
=
"
$privkey
.pub"
...
...
@@ -68,14 +68,14 @@ do_keygen() {
fi
if
[
-n
"
$append_config
"
]
;
then
if
[
-f
"
$
abuild_userconf
"
]
;
then
if
[
-f
"
$
ABUILD_USERCONF
"
]
;
then
# comment out the existing values
sed
-i
-e
's/^PACKAGER_PRIVKEY=/\#&/'
"
$
abuild_userconf
"
sed
-i
-e
's/^PACKAGER_PRIVKEY=/\#&/'
"
$
ABUILD_USERCONF
"
fi
echo
"PACKAGER_PRIVKEY=
\"
$privkey
\"
"
>>
"
$
abuild_userconf
"
echo
"PACKAGER_PRIVKEY=
\"
$privkey
\"
"
>>
"
$
ABUILD_USERCONF
"
else
msg
""
msg
"You might want add following line to
$
abuild_userconf
:"
msg
"You might want add following line to
$
ABUILD_USERCONF
:"
msg
""
msg
"PACKAGER_PRIVKEY=
\"
$privkey
\"
"
msg
""
...
...
@@ -92,7 +92,7 @@ usage() {
$prog
$abuild_ver
- generate signing keys
Usage:
$prog
[-a|--append] [-i|--install] [-n]
Options:
-a, --append Set PACKAGER_PRIVKEY=<generated key> in
$
abuild_userconf
-a, --append Set PACKAGER_PRIVKEY=<generated key> in
$
ABUILD_USERCONF
-i, --install Install public key into /etc/apk/keys using sudo
-n Non-interactive. Use defaults
-q, --quiet
...
...
This diff is collapsed.
Click to expand it.
abuild-sign.in
+
2
−
2
View file @
cfa6c7d6
...
...
@@ -85,9 +85,9 @@ if [ -z "$privkey" ]; then
cat
>
&2
<<
__EOF__
No private key found. Use 'abuild-keygen' to generate the keys.
Then you can either:
* set the PACKAGER_PRIVKEY in
$
abuild_userconf
* set the PACKAGER_PRIVKEY in
$
ABUILD_USERCONF
('abuild-keygen -a' does this for you)
* set the PACKAGER_PRIVKEY in
$
abuild_conf
* set the PACKAGER_PRIVKEY in
$
ABUILD_CONF
* specify the key with the -k option to
$prog
__EOF__
...
...
This diff is collapsed.
Click to expand it.
checkapk.in
+
1
−
1
View file @
cfa6c7d6
...
...
@@ -31,7 +31,7 @@ if [ $# -gt 0 ]; then
exit
2
fi
if
!
[
-f
"
$
abuild_conf
"
]
&&
!
[
-f
"
$
abuild_userconf
"
]
;
then
if
!
[
-f
"
$
ABUILD_CONF
"
]
&&
!
[
-f
"
$
ABUILD_USERCONF
"
]
;
then
die
"no abuild.conf found"
fi
...
...
This diff is collapsed.
Click to expand it.
functions.sh.in
+
61
−
14
View file @
cfa6c7d6
...
...
@@ -3,20 +3,67 @@
sysconfdir=@sysconfdir@
prog=${0##*/}
abuild_conf=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
abuild_home=${ABUILD_USERDIR:-"$HOME/.abuild"}
abuild_userconf=${ABUILD_USERCONF:-"$abuild_home/abuild.conf"}
# read config
if [ -f "$abuild_conf" ]; then
. "$abuild_conf" || abuild_conf=
fi
# read user config if exists
if [ -f "$abuild_userconf" ]; then
. "$abuild_userconf" || abuild_userconf=
fi
readconfig() {
local _APORTSDIR _BUILDDIR _PKGDEST _SRCPKGDEST _REPODEST _SRCDEST
local _CARCH _CHOST _CTARGET _CPPFLAGS _CFLAGS _CXXFLAGS _LDFLAGS
local _JOBS _MAKEFLAGS _PACKAGER _USE_COLORS
local gitbase=
[ -n "${APORTSDIR+x}" ] && _APORTSDIR=$APORTSDIR
[ -n "${BUILDDIR+x}" ] && _BUILDDIR=$BUILDDIR
[ -n "${PKGDEST+x}" ] && _PKGDEST=$PKGDEST
[ -n "${SRCPKGDEST+x}" ] && _SRCPKGDEST=$SRCPKGDEST
[ -n "${REPODEST+x}" ] && _REPODEST=$REPODEST
[ -n "${SRCDEST+x}" ] && _SRCDEST=$SRCDEST
[ -n "${CARCH+x}" ] && _CARCH=$CARCH
[ -n "${CHOST+x}" ] && _CHOST=$CHOST
[ -n "${CTARGET+x}" ] && _CTARGET=$CTARGET
[ -n "${CPPFLAGS+x}" ] && _CPPFLAGS=$CPPFLAGS
[ -n "${CFLAGS+x}" ] && _CFLAGS=$CFLAGS
[ -n "${CXXFLAGS+x}" ] && _CXXFLAGS=$CXXFLAGS
[ -n "${LDFLAGS+x}" ] && _LDFLAGS=$LDFLAGS
[ -n "${JOBS+x}" ] && _JOBS=$JOBS
[ -n "${MAKEFLAGS+x}" ] && _MAKEFLAGS=$MAKEFLAGS
[ -n "${PACKAGER+x}" ] && _PACKAGER=$PACKAGER
[ -n "${USE_COLORS+x}" ] && _USE_COLORS="$USE_COLORS"
: ${ABUILD_CONF:=$sysconfdir/abuild.conf}
: ${ABUILD_USERDIR:=$HOME/.abuild}
: ${ABUILD_USERCONF:=$ABUILD_USERDIR/abuild.conf}
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
[ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
APORTSDIR=${_APORTSDIR-$APORTSDIR}
gitbase=$(git rev-parse --show-toplevel 2>/dev/null) # already is -P
if [ -d "$APORTSDIR" ]; then
APORTSDIR=$(cd "$APORTSDIR"; pwd -P)
elif [ -z "$APORTSDIR" ] && [ -d "$HOME/aports" ]; then
APORTSDIR=$(cd "$HOME/aports"; pwd -P)
else
if [ -n "$gitbase" ]; then
case $(git config remote.origin.url) in
*/aports) APORTSDIR=$gitbase ;;
*) APORTSDIR= ;;
esac
else
APORTSDIR=
fi
fi
BUILDDIR=${_BUILDDIR-$BUILDDIR}
PKGDEST=${_PKGDEST-$PKGDEST}
SRCPKGDEST=${_SRCPKGDEST-$SRCPKGDEST}
REPODEST=${_REPODEST-$REPODEST}
SRCDEST=${_SRCDEST-$SRCDEST}
CARCH=${_CARCH-$CARCH}
CHOST=${_CHOST-$CHOST}
CTARGET=${_CTARGET-$CTARGET}
CPPFLAGS=${_CPPFLAGS-$CPPFLAGS}
CFLAGS=${_CFLAGS-$CFLAGS}
CXXFLAGS=${_CXXFLAGS-$CXXFLAGS}
LDFLAGS=${_LDFLAGS-$LDFLAGS}
JOBS=${_JOBS-$JOBS}
MAKEFLAGS=${_MAKEFLAGS-$MAKEFLAGS}
PACKAGER=${_PACKAGER-$PACKAGER}
USE_COLORS=${_USE_COLORS-$USE_COLORS}
}
readconfig
# expects $1 to be a package directory in the aports tree ('foo' or 'main/foo')
...
...
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