diff options
author | Fredrik Rinnestam <fredrik@crux.nu> | 2017-02-23 18:26:36 +0100 |
---|---|---|
committer | Fredrik Rinnestam <fredrik@crux.nu> | 2017-02-23 18:29:10 +0100 |
commit | dcb8845eaf69cbefe62e58b03090c986391333d3 (patch) | |
tree | 4bf6bd1ec410ec55991ef9ff94c8d11d0bdb79c6 | |
parent | e5c99f7b1a729016c689f240c69b8b2bdc4ed4aa (diff) | |
download | pkgutils-dcb8845eaf69cbefe62e58b03090c986391333d3.tar.gz pkgutils-dcb8845eaf69cbefe62e58b03090c986391333d3.tar.xz |
pkgmk: Removed checking for in make_signature()pkgutils-5.40.1
this is an artifact from make_md5sum() and NOT needed for make_signature().
In fact, this check breaks make_signature() because now packages that don't
have a $source don't get any .signature at all, even though it can
(and should) create a sha256 for the footprint and Pkgfile.
Patch by Camille (onodera).
-rwxr-xr-x | pkgmk.in | 40 |
1 files changed, 19 insertions, 21 deletions
@@ -360,31 +360,29 @@ make_signature() { local FILE LOCAL_FILENAMES local REPO - if [ "$source" ]; then - for FILE in "$PKGMK_PKGFILE" "$PKGMK_FOOTPRINT" ${source[@]}; do - LOCAL_FILENAMES="$LOCAL_FILENAMES `get_filename $FILE`" - done + for FILE in "$PKGMK_PKGFILE" "$PKGMK_FOOTPRINT" ${source[@]}; do + LOCAL_FILENAMES="$LOCAL_FILENAMES `get_filename $FILE`" + done - if [ ! "$PKGMK_PRIVATEKEY" ]; then - REPO=${PWD%/*} - REPO=${REPO##*/} - REPO=${REPO%.git} - fi + if [ ! "$PKGMK_PRIVATEKEY" ]; then + REPO=${PWD%/*} + REPO=${REPO##*/} + REPO=${REPO%.git} + fi - if [ "$REPO" ]; then - PKGMK_PRIVATEKEY="/etc/ports/${REPO}.sec" - fi + if [ "$REPO" ]; then + PKGMK_PRIVATEKEY="/etc/ports/${REPO}.sec" + fi - sha256sum --tag $LOCAL_FILENAMES | sed 's|^SHA256 (.*/\(.*\))\(.* = .*\)|SHA256 (\1)\2|' | \ - signify -S -e -x - -q -s "$PKGMK_PRIVATEKEY" -m - > ${PKGMK_SIGNATURE}.tmp + sha256sum --tag $LOCAL_FILENAMES | sed 's|^SHA256 (.*/\(.*\))\(.* = .*\)|SHA256 (\1)\2|' | \ + signify -S -e -x - -q -s "$PKGMK_PRIVATEKEY" -m - > ${PKGMK_SIGNATURE}.tmp - if [ $? -ne 0 ]; then - rm ${PKGMK_SIGNATURE}.tmp - error "Creating signature failed" - exit $E_SIGNATURE - else - mv ${PKGMK_SIGNATURE}.tmp ${PKGMK_SIGNATURE} - fi + if [ $? -ne 0 ]; then + rm ${PKGMK_SIGNATURE}.tmp + error "Creating signature failed" + exit $E_SIGNATURE + else + mv ${PKGMK_SIGNATURE}.tmp ${PKGMK_SIGNATURE} fi } |