Skip to content

Commit

Permalink
faf-client: add -f flag to update script
Browse files Browse the repository at this point in the history
  • Loading branch information
chayleaf authored and fufexan committed Aug 22, 2023
1 parent 56f426e commit 54362e2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pkgs/faf-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ in let
xorg.libXxf86vm
];

depsHashStable = "sha256:F49UAk4S+B+o06WaJ8HEFvaAHzzTaO7hYTpBDwUpcQc=";
depsHashUnstable = "sha256:F49UAk4S+B+o06WaJ8HEFvaAHzzTaO7hYTpBDwUpcQc=";
depsHashStable = "sha256:uTdKCtIte1zDQklfZapmC7qaKegpNnZOEMlaVYYcb+o=";
depsHashUnstable = "sha256:uTdKCtIte1zDQklfZapmC7qaKegpNnZOEMlaVYYcb+o=";

deps =
if deps' != null
Expand Down
6 changes: 3 additions & 3 deletions pkgs/faf-client/gradle-stable.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ com.github.alexarchambault:case-app-annotations_2.12:1.2.0=codacy
com.github.alexarchambault:case-app-util_2.12:1.2.0=codacy
com.github.alexarchambault:case-app_2.12:1.2.0=codacy
com.github.ben-manes.caffeine:caffeine:3.1.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.github.codacy.codacy-coverage-reporter:codacy-coverage-reporter:13.13.2=codacy
com.github.codacy.codacy-coverage-reporter:coverageparser_2.12:13.13.2=codacy
com.github.codacy:codacy-coverage-reporter:13.13.2=codacy
com.github.codacy.codacy-coverage-reporter:codacy-coverage-reporter:13.13.7=codacy
com.github.codacy.codacy-coverage-reporter:coverageparser_2.12:13.13.7=codacy
com.github.codacy:codacy-coverage-reporter:13.13.7=codacy
com.github.jasminb:jsonapi-converter:0.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.github.luben:zstd-jni:1.4.9-5=productionRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.github.micheljung:JJsonRpc:01a7fba5f4=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
Expand Down
6 changes: 3 additions & 3 deletions pkgs/faf-client/gradle-unstable.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ com.github.alexarchambault:case-app-annotations_2.12:1.2.0=codacy
com.github.alexarchambault:case-app-util_2.12:1.2.0=codacy
com.github.alexarchambault:case-app_2.12:1.2.0=codacy
com.github.ben-manes.caffeine:caffeine:3.1.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.github.codacy.codacy-coverage-reporter:codacy-coverage-reporter:13.13.2=codacy
com.github.codacy.codacy-coverage-reporter:coverageparser_2.12:13.13.2=codacy
com.github.codacy:codacy-coverage-reporter:13.13.2=codacy
com.github.codacy.codacy-coverage-reporter:codacy-coverage-reporter:13.13.7=codacy
com.github.codacy.codacy-coverage-reporter:coverageparser_2.12:13.13.7=codacy
com.github.codacy:codacy-coverage-reporter:13.13.7=codacy
com.github.jasminb:jsonapi-converter:0.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.github.luben:zstd-jni:1.4.9-5=productionRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.github.micheljung:JJsonRpc:01a7fba5f4=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
Expand Down
8 changes: 5 additions & 3 deletions pkgs/faf-client/update-src.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ blockfileIce="pkgs/faf-client/buildscript-gradle-ice.lockfile"
info="pkgs/faf-client/info.json"

dry_run=
force=
verbose=
while test $# != 0
do
case "$1" in
-d|--dry-run) dry_run=1 ;;
-f|--force) force=1 ;;
-v|--verbose) verbose=1 ;;
esac
shift
Expand Down Expand Up @@ -102,7 +104,7 @@ if [ -n "$verbose" ]; then
echo "New versions: $versionIce $versionStable $versionUnstable"
fi

if [ "$oldVersionIce" != "$versionIce" ]; then
if [ -n "$force" ] || [ "$oldVersionIce" != "$versionIce" ]; then
oldHashIce=$(getValueIce outputHash)
replaceInIce "outputHash = \"$oldHashIce" "outputHash = \"$fakeHash_1"

Expand All @@ -128,7 +130,7 @@ else
echo "ICE adapter version is up to date: $versionIce"
fi

if [ "$oldVersionStable" != "$versionStable" ]; then
if [ -n "$force" ] || [ "$oldVersionStable" != "$versionStable" ]; then
oldHashStable=$(getValue depsHashStable)
replaceInFile "depsHashStable = \"$oldHashStable" "depsHashStable = \"$fakeHash_1"

Expand All @@ -154,7 +156,7 @@ else
echo "Stable version is up to date: $versionStable"
fi

if [ "$oldVersionUnstable" != "$versionUnstable" ]; then
if [ -n "$force" ] || [ "$oldVersionUnstable" != "$versionUnstable" ]; then
oldHashUnstable=$(getValue depsHashUnstable)
replaceInFile "depsHashUnstable = \"$oldHashUnstable" "depsHashUnstable = \"$fakeHash_2"

Expand Down
6 changes: 4 additions & 2 deletions pkgs/faf-client/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ set -euo pipefail
filePath="pkgs/faf-client/bin.nix"

dry_run=
force=
while test $# != 0
do
case "$1" in
-d|--dry-run) dry_run=1 ;;
-f|--force) force=1 ;;
esac
shift
done
Expand Down Expand Up @@ -56,7 +58,7 @@ fakeSha256_2="0000000000000000000000000000000000000000000000000000000000000002"
oldVersionStable=$(getValue versionStable)
oldSha256Stable=$(getValue sha256Stable)

if [[ "$oldVersionStable" = "$versionStable" ]]; then
if [ -z "$force" ] && [[ "$oldVersionStable" = "$versionStable" ]]; then
echo "no stable faf updates"
else
echo "updating stable: $oldVersionStable->$versionStable"
Expand All @@ -75,7 +77,7 @@ fi
oldVersionUnstable=$(getValue versionUnstable)
oldSha256Unstable=$(getValue sha256Unstable)

if [[ "$oldVersionUnstable" = "$versionUnstable" ]]; then
if [ -z "$force" ] && [[ "$oldVersionUnstable" = "$versionUnstable" ]]; then
echo "no unstable faf updates"
else
echo "updating unstable: $oldVersionUnstable->$versionUnstable"
Expand Down

0 comments on commit 54362e2

Please sign in to comment.