From 492ba67d37fb78421bb0602e99a7f0fc881424b8 Mon Sep 17 00:00:00 2001 From: steadfasterX Date: Thu, 13 Jul 2023 10:20:22 +0200 Subject: [PATCH] fix an issue when no delta requested this one will break the build when using https://github.com/Divested-Mobile/DivestOS-Build/pull/206 : > rename: /ssd/tmp/dos/hotdog/LineageOS-20.0/release_keys//incrementals/xxxx-20.0-20230713-dos-hotdog-incremental_*.zip*: not accessible: No such file or directory the next one is a cosmetic thing only. while the current implementation does not break the build I prefer skipping it if not needed at all instead of just the `|| true` workaround. "fixes" the message in build output when no delta is requested: > cp: cannot stat 'xxxx-20.0-20230713-dos-hotdog-incremental_*.zip*': No such file or directory Signed-off-by: steadfasterX --- Scripts/Common/Functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Common/Functions.sh b/Scripts/Common/Functions.sh index 6686aa4f..69fc1ec2 100644 --- a/Scripts/Common/Functions.sh +++ b/Scripts/Common/Functions.sh @@ -406,11 +406,11 @@ processRelease() { if [[ " ${DOS_GENERATE_DELTAS_DEVICES[@]} " =~ " ${DEVICE} " ]]; then cp -v $OUT_DIR/$PREFIX-target_files.zip* $ARCHIVE/target_files/; fi; cp -v $OUT_DIR/$PREFIX-fastboot.zip* $ARCHIVE/fastboot/ || true; cp -v $OUT_DIR/$PREFIX-ota.zip* $ARCHIVE/; - cp -v $OUT_DIR/$PREFIX-incremental_*.zip* $ARCHIVE/incrementals/ || true; + if [[ " ${DOS_GENERATE_DELTAS} " == true ]]; then cp -v $OUT_DIR/$PREFIX-incremental_*.zip* $ARCHIVE/incrementals/ || true; fi cp -v $OUT_DIR/$PREFIX-recovery.img* $ARCHIVE/ || true; rename -- "-ota." "." $ARCHIVE/$PREFIX-ota.zip*; - rename -- "-incremental_" "-" $ARCHIVE/incrementals/$PREFIX-incremental_*.zip*; + [[ " ${DOS_GENERATE_DELTAS} " == true ]] && rename -- "-incremental_" "-" $ARCHIVE/incrementals/$PREFIX-incremental_*.zip*; sync; #Remove to make space for next build