pkgmeek: refactor how the --no-strip option is handled
pkgmeek: refactor how the --no-strip option is handled
This commit is contained in:
parent
f2ccd4184a
commit
8836cc870a
@ -155,7 +155,8 @@ if [ "$pkg_utd" = 0 ] || [ "$PKGMK_FORCE" = "yes" ]; then
|
|||||||
|| { error "Unsuccessful build!"; cleanup_work; exit "$E_BUILD"; }
|
|| { error "Unsuccessful build!"; cleanup_work; exit "$E_BUILD"; }
|
||||||
|
|
||||||
# Strip binaries
|
# Strip binaries
|
||||||
[ -f "$PKGMK_ROOT/.nostrip" ] && ns_filter="| grep -v -f $PKGMK_ROOT/.nostrip"
|
[ -n "$ns_filter" ] || [ ! -f "$PKGMK_ROOT/.nostrip" ] \
|
||||||
|
|| ns_filter="| grep -v -f $PKGMK_ROOT/.nostrip"
|
||||||
{ while read -r f; do
|
{ while read -r f; do
|
||||||
case $(file -b "$f") in
|
case $(file -b "$f") in
|
||||||
*ELF*executable*not\ stripped*) strip --strip-all "$f" ;;
|
*ELF*executable*not\ stripped*) strip --strip-all "$f" ;;
|
||||||
@ -254,7 +255,7 @@ parse_options() {
|
|||||||
-if|--ignore-footprint) PKGMK_IGNORE_FOOTPRINT="yes" ;;
|
-if|--ignore-footprint) PKGMK_IGNORE_FOOTPRINT="yes" ;;
|
||||||
-in|--ignore-new) PKGMK_IGNORE_NEW="yes" ;;
|
-in|--ignore-new) PKGMK_IGNORE_NEW="yes" ;;
|
||||||
-is|--ignore-signature) PKGMK_IGNORE_SIG="yes" ;;
|
-is|--ignore-signature) PKGMK_IGNORE_SIG="yes" ;;
|
||||||
-ns|--no-strip) echo ".*" >> "$PKGMK_ROOT/.nostrip" ;;
|
-ns|--no-strip) ns_filter="-false" ;;
|
||||||
-f|--force) PKGMK_FORCE="yes" ;;
|
-f|--force) PKGMK_FORCE="yes" ;;
|
||||||
-kw|--keep-work) PKGMK_KEEP_WORK="yes" ;;
|
-kw|--keep-work) PKGMK_KEEP_WORK="yes" ;;
|
||||||
-i|--install) PKGMK_INSTALL_COMMAND="/usr/bin/pkgadd" ;;
|
-i|--install) PKGMK_INSTALL_COMMAND="/usr/bin/pkgadd" ;;
|
||||||
@ -359,7 +360,7 @@ fetch_url() {
|
|||||||
[ -x "$PKGMK_GIT_COMMAND" ] || return 1;
|
[ -x "$PKGMK_GIT_COMMAND" ] || return 1;
|
||||||
#
|
#
|
||||||
giturl="${u#__git__}"
|
giturl="${u#__git__}"
|
||||||
# Did the port maintainer specify a branch other than 'master'?
|
# Did the port maintainer specify a branch other than 'main'?
|
||||||
tag="${giturl##*\#}"
|
tag="${giturl##*\#}"
|
||||||
[ "$tag" = "$giturl" ] || { giturl="${giturl%\#*}";
|
[ "$tag" = "$giturl" ] || { giturl="${giturl%\#*}";
|
||||||
CLONE_ARGS="-c advice.detachedHead=false --branch $tag"; }
|
CLONE_ARGS="-c advice.detachedHead=false --branch $tag"; }
|
||||||
@ -510,12 +511,14 @@ cat_signature() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
refresh_signature() {
|
refresh_signature() {
|
||||||
[ -e ".signature" ] && [ ! -w ".signature" ] || {
|
[ -e ".signature" ] || { error "missing .signature, cannot refresh."; return $E_SIGNATURE; }
|
||||||
error ".signature not writable."; return $E_DIRPERM; }
|
[ -w ".signature" ] || { error ".signature not writable."; return $E_DIRPERM; }
|
||||||
|
|
||||||
local REPO
|
local REPO
|
||||||
if [ -z "$PKGMK_PRIVATEKEY" ]; then
|
if [ -z "$PKGMK_PRIVATEKEY" ]; then
|
||||||
REPO=${PWD##*/}; REPO=${REPO%.git};
|
REPO="$(dirname "$PWD")"
|
||||||
|
REPO="${REPO##*/}"
|
||||||
|
REPO="${REPO%.git}"
|
||||||
[ -r "/etc/ports/${REPO}.sec" ] && \
|
[ -r "/etc/ports/${REPO}.sec" ] && \
|
||||||
PKGMK_PRIVATEKEY="/etc/ports/${REPO}.sec" || \
|
PKGMK_PRIVATEKEY="/etc/ports/${REPO}.sec" || \
|
||||||
{ error "No suitable secret key found. Specify one explicitly with '-sk'."; return $E_SIGNATURE; }
|
{ error "No suitable secret key found. Specify one explicitly with '-sk'."; return $E_SIGNATURE; }
|
||||||
@ -524,11 +527,9 @@ refresh_signature() {
|
|||||||
if ! tail -n +3 ".signature" | /usr/bin/signify -S -e -x - -q \
|
if ! tail -n +3 ".signature" | /usr/bin/signify -S -e -x - -q \
|
||||||
-s "$PKGMK_PRIVATEKEY" -m - > .signature.tmp ; then
|
-s "$PKGMK_PRIVATEKEY" -m - > .signature.tmp ; then
|
||||||
rm .signature.tmp
|
rm .signature.tmp
|
||||||
error "Refreshing signature failed"
|
error "Refreshing signature failed"; return $E_SIGNATURE
|
||||||
return $E_SIGNATURE
|
|
||||||
else
|
else
|
||||||
mv .signature.tmp .signature
|
mv .signature.tmp .signature; info "Signature refreshed."
|
||||||
info "Signature refreshed."
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user