bump.sh: add script to bump defconfs

gf-arm64
FriendlyNeighborhoodShane 3 years ago
parent 8e99dc83b8
commit 3afe9f0ddd

@ -116,6 +116,8 @@ To build your own custom pack, refer to `conf/custom-conf.md`.
Any changes made to the code should ideally be tested with `test.sh`, which runs the `shellcheck` linter program on every script.
Use `bump.sh` to automatically bump the `ver`, `verc` and `date` values across all defconf files.
### Credits
- Thanks to @osm0sis for the base magisk/recovery code and inspiration and guidance on the majority of the stuff in here.
- Thanks to @Setialpha, the creator of NanoDroid, and ale5000 for the lib installation code, permissions code, and patched play.

@ -0,0 +1,40 @@
#!/bin/sh
# Bump versions in defconf files
#
# Copyright 2018-2020 FriendlyNeighborhoodShane
# Distributed under the terms of the GNU GPL v3
abort() {
echo " ";
echo "!!! FATAL ERROR: $1";
echo " ";
exit 1;
}
workdir="$(pwd)";
quote_str() {
printf '"%s"' "$1";
}
echo " ";
echo "-- Minimal MicroG Test Script --";
echo "-- The Essentials only MicroG pack --";
for bin in printf sed; do
[ "$(which $bin)" ] || abort "No $bin found";
done;
[ "$#" = "3" ] || abort "Not enough arguments";
echo " ";
echo " - Bumping defconfs: [$1] [$2] [$3]";
for i in "ver=$(quote_str "$1")" "verc=$(quote_str "$2")" "date=$(quote_str "$3")"; do
sed -i "s|${i%%=*}=.*|$i;|g" -- "$workdir/conf"/defconf-*.txt;
done;
echo " ";
echo " - Done!";
echo " ";

@ -9,7 +9,6 @@ abort() {
echo " ";
echo "!!! FATAL ERROR: $1";
echo " ";
[ -d "$tmpdir" ] && rm -rf "$tmpdir";
exit 1;
}
@ -36,4 +35,4 @@ done;
# Can't add directives because it's all dynamic
echo " ";
shellcheck -s sh -e 1087,1090,2034,2154 "$@" -- ./src/META-INF/com/google/android/update-binary ./build.sh ./test.sh ./update.sh ./conf/*.txt ./res/util/*.sh;
shellcheck -s sh -e 1087,1090,2034,2154 "$@" -- ./src/META-INF/com/google/android/update-binary ./build.sh ./bump.sh ./test.sh ./update.sh ./conf/*.txt ./res/util/*.sh;

Loading…
Cancel
Save