makepkg: only check software once
Move the checks for software and gpg signing ability to after the fakeroot section so that it is only executed once. This also fixes gpg (lack of) interaction under fakeroot. Fixes #69 Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
42fa74e91a
commit
f69d9b4475
1 changed files with 16 additions and 16 deletions
|
@ -1183,9 +1183,6 @@ if have_function pkgver; then
|
|||
PKGVERFUNC=1
|
||||
fi
|
||||
|
||||
# check we have the software required to process the PKGBUILD
|
||||
check_software || exit $E_MISSING_MAKEPKG_DEPS
|
||||
|
||||
if (( ${#pkgname[@]} > 1 )) || have_function package_${pkgname}; then
|
||||
SPLITPKG=1
|
||||
fi
|
||||
|
@ -1216,19 +1213,6 @@ if have_function package; then
|
|||
PKGFUNC=1
|
||||
fi
|
||||
|
||||
# check if gpg signature is to be created and if signing key is valid
|
||||
if { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; } || [[ $SIGNPKG == 'y' ]]; then
|
||||
SIGNPKG='y'
|
||||
if ! gpg --list-secret-key ${GPGKEY:+"$GPGKEY"} &>/dev/null; then
|
||||
if [[ ! -z $GPGKEY ]]; then
|
||||
error "$(gettext "The key %s does not exist in your keyring.")" "${GPGKEY}"
|
||||
else
|
||||
error "$(gettext "There is no key in your keyring.")"
|
||||
fi
|
||||
exit $E_PRETTY_BAD_PRIVACY
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( PACKAGELIST )); then
|
||||
print_all_package_names
|
||||
exit $E_OK
|
||||
|
@ -1266,6 +1250,22 @@ if (( INFAKEROOT )); then
|
|||
exit $E_OK
|
||||
fi
|
||||
|
||||
# check we have the software required to process the PKGBUILD
|
||||
check_software || exit $E_MISSING_MAKEPKG_DEPS
|
||||
|
||||
# check if gpg signature is to be created and if signing key is valid
|
||||
if { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; } || [[ $SIGNPKG == 'y' ]]; then
|
||||
SIGNPKG='y'
|
||||
if ! gpg --list-secret-key ${GPGKEY:+"$GPGKEY"} &>/dev/null; then
|
||||
if [[ ! -z $GPGKEY ]]; then
|
||||
error "$(gettext "The key %s does not exist in your keyring.")" "${GPGKEY}"
|
||||
else
|
||||
error "$(gettext "There is no key in your keyring.")"
|
||||
fi
|
||||
exit $E_PRETTY_BAD_PRIVACY
|
||||
fi
|
||||
fi
|
||||
|
||||
msg "$(gettext "Making package: %s")" "$pkgbase $basever ($(date +%c))"
|
||||
|
||||
# if we are creating a source-only package, go no further
|
||||
|
|
Loading…
Add table
Reference in a new issue