summaryrefslogtreecommitdiffstats
path: root/release-utils/make-release-zip.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:55:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:55:34 +0000
commit75417f5e3d32645859d94cec82255dc130ec4a2e (patch)
tree5fd46925c6b4a881c9208772ed8e5cc0588bc164 /release-utils/make-release-zip.sh
parentInitial commit. (diff)
downloadprivacybadger-75417f5e3d32645859d94cec82255dc130ec4a2e.tar.xz
privacybadger-75417f5e3d32645859d94cec82255dc130ec4a2e.zip
Adding upstream version 2020.10.7.upstream/2020.10.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'release-utils/make-release-zip.sh')
-rwxr-xr-xrelease-utils/make-release-zip.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/release-utils/make-release-zip.sh b/release-utils/make-release-zip.sh
new file mode 100755
index 0000000..8010b1f
--- /dev/null
+++ b/release-utils/make-release-zip.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# We use the immutable filesystem attribute as a workaround for the fact that
+# the build scripts are not currently idempotent.
+
+# The fact that the package is marked immutable means that it has been built
+# for release.
+
+if ! lsattr "$PREPKG" | cut -f 1 -d" " | grep -q i ; then
+
+ if [ -f "$PREPKG" ] ; then
+ echo "$PREPKG" is not immutable, rebuilding it for release!
+ else
+ echo building "$PREPKG" for the first time...
+ fi
+
+ if ! release-utils/make-eff-zip.sh "$GITTAG" ; then
+ echo "Failed to build target $GITTAG"
+ exit 1
+ fi
+
+ if ! [ -f "$PREPKG" -a -f "$PREPKGCWS" ] ; then
+ echo "Failed to find package $PREPKG after build"
+ exit 1
+ fi
+
+ # Verification and testing of build goes here!
+
+ echo Marking "$PREPKG" immutable...
+ if ! sudo true ; then
+ echo "Failed to sudo :("
+ exit 1
+ fi
+ if ! sudo chattr +i "$PREPKG" "$PREPKGCWS"; then
+ echo ""
+ echo "WARNING: FAILED TO MARK $PREPKG or $PREPKGCWS IMMUTABLE."
+ echo "DO NOT RERUN THIS SCRIPT AFTER SIGNING"
+ echo ""
+ read -p "(Press Enter to acknowledge)"
+ fi
+else
+ echo "$PREPKG is immutable; good, not rebuilding it..."
+fi