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
17c6ce7a
Commit
17c6ce7a
authored
15 years ago
by
Natanael Copa
Browse files
Options
Downloads
Patches
Plain Diff
abuild-sign: use mktemp for temp files. add -q option for quiet
parent
c6bb16a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
abuild-sign.in
+17
-9
17 additions, 9 deletions
abuild-sign.in
with
17 additions
and
9 deletions
abuild-sign.in
+
17
−
9
View file @
17c6ce7a
...
...
@@ -22,11 +22,11 @@ die() {
usage
()
{
echo
"abuild-sign
$abuild_ver
"
echo
"usage: abuild-sign [-h] [-k PRIVKEY] [-p PUBKEY] INDEXFILE..."
echo
"usage: abuild-sign [-h
q
] [-k PRIVKEY] [-p PUBKEY] INDEXFILE..."
echo
"options:"
echo
" -h Show this help"
echo
" -k The private key to use for signing"
echo
" -p The name of public key. apk add will look for /etc/apk/keys/PUBKEY"
echo
" -h
Show this help"
echo
" -k
The private key to use for signing"
echo
" -p
The name of public key. apk add will look for /etc/apk/keys/PUBKEY"
exit
1
}
...
...
@@ -38,11 +38,12 @@ usage() {
privkey
=
"
$PACKAGER_PRIVKEY
"
while
getopts
"hk:p:"
opt
;
do
while
getopts
"hk:p:
q
"
opt
;
do
case
$opt
in
h
)
usage
;;
k
)
privkey
=
$OPTARG
;;
p
)
pubkey
=
$OPTARG
;;
q
)
quiet
=
yes
;;
esac
done
shift
$((
$OPTIND
-
1
))
...
...
@@ -51,6 +52,7 @@ if [ -z "$privkey" ]; then
echo
"No private key found. Use 'abuild-keygen' to generate the keys"
echo
"Then you can either:"
echo
" 1. set the PACKAGER_PRIVKEY in
$abuild_userconf
"
echo
" (Note that 'abuild-keygen -a' does this for you)"
echo
" 2. set the PACKAGER_PRIVKEY in
$abuild_conf
"
echo
" 3. specify the key with the -k option"
echo
""
...
...
@@ -72,9 +74,15 @@ for f in "$@"; do
sig
=
".SIGN.RSA.
$keyname
"
openssl dgst
-sha1
-sign
"
$privkey
"
-out
"
$sig
"
"
$i
"
||
die
"Failed to sign
$i
"
cd
"
$repo
"
tar
-c
"
$sig
"
| abuild-tar
--cut
|
gzip
-9
>
signature.tar.gz
cat
signature.tar.gz
"
$i
"
>
"
$i
.new"
mv
"
$i
.new"
"
$i
"
echo
"Signed
$i
"
tmptargz
=
$(
mktemp
)
tar
-c
"
$sig
"
| abuild-tar
--cut
|
gzip
-9
>
"
$tmptargz
"
tmpsigned
=
$(
mktemp
)
cat
"
$tmptargz
"
"
$i
"
>
"
$tmpsigned
"
rm
-f
"
$tmptargz
"
mv
"
$tmpsigned
"
"
$i
"
if
[
-z
"
$quiet
"
]
;
then
echo
"Signed
$i
"
fi
done
exit
0
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