summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-02-23 13:03:59 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-02-23 13:34:41 +0100
commitecb14840869f6af59ec03fab795bae94c407328f (patch)
tree3ff13406ca975d773ab54bbe9eef6f607fb9ea9b
parente82a9b354222d93f711956f8fd3d703804dbad41 (diff)
downloadvendor_replicant-ecb14840869f6af59ec03fab795bae94c407328f.tar.gz
vendor_replicant-ecb14840869f6af59ec03fab795bae94c407328f.tar.bz2
vendor_replicant-ecb14840869f6af59ec03fab795bae94c407328f.zip
sign-build.sh: fix unexpected operator with multiple TARGET_FILES
sign-build sometimes fails when there is multiple files matching the *-target_files-*.zip pattern for TARGET_FILES: when checking if TARGET_FILES is a file with [ -f $TARGET_FILES ], it can fail because -f expects ai single path. When it happens the failure looks like that: vendor/replicant/sign-build: 111: [: [...]/out/target/product/maguro/obj/PACKAGING/target_files_intermediates/replicant_maguro-target_files-3c9b1e0289.zip: unexpected operator The TARGET_FILES files we are sigining in sign-build.sh have their build rules in build/core/Makefile where the resulting path of the file is defined in this way: BUILT_TARGET_FILES_PACKAGE := $(intermediates)/$(name).zip name is in turn defined like this: name := $(name)-target_files-$(FILE_NAME_TAG) and FILE_NAME_TAG like this: FILE_NAME_TAG := $(BUILD_NUMBER) Since we have access to the device name and the BUILD_NUMBER that is used to construct the FILE_NAME_TAG, we can use them to find out the name of the file to sign instead of relying on fragile glob ('*') patterns. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-xsign-build3
1 files changed, 2 insertions, 1 deletions
diff --git a/sign-build b/sign-build
index 11bf8bea..304c8809 100755
--- a/sign-build
+++ b/sign-build
@@ -40,7 +40,8 @@ else
fi
TARGET_DIR=$OUT_DIR/target/product/$DEVICE
-TARGET_FILES=$TARGET_DIR/obj/PACKAGING/target_files_intermediates/*-target_files-*.zip
+TARGET_FILES=$TARGET_DIR/obj/PACKAGING/target_files_intermediates/replicant_${DEVICE}-target_files-${BUILD_NUMBER}.zip
+
DIST_OUT_DIR=$OUT_DIR/"dist"/$DEVICE
RELEASE=replicant-6.0-dev