diff options
-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 } |