-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite package scripts to produce deterministic zip files
- Loading branch information
1 parent
eec3d43
commit 4cc3aeb
Showing
2 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
usage() { | ||
echo "usage: $0 {chromium,firefox,firefoxandroid}" | ||
} | ||
|
||
if [[ -z "$1" ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
PLATFORM=$1 | ||
SCRIPTPATH="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)" | ||
DISTPATH=$SCRIPTPATH/../extension/dist | ||
|
||
pushd $DISTPATH | ||
|
||
NAME="asbplayer-extension-$(jq -r .version $PLATFORM/manifest.json)-$PLATFORM.zip" | ||
|
||
# Remove old zip file | ||
rm -f $NAME | ||
|
||
# Force file timestamps to constant so that final zip is deterministic | ||
find $PLATFORM -mindepth 1 | xargs touch -ad "1970-01-01T00:00:00" | ||
find $PLATFORM -mindepth 1 | xargs touch -md "1970-01-01T00:00:00" | ||
|
||
# Zip everything up | ||
find $PLATFORM -mindepth 1 | xargs zip -X $NAME $PLATFORM/* | ||
|
||
popd |