diff options
author | Thien-Thi Nguyen <ttn@gnuvola.org> | 2022-05-11 04:27:50 -0400 |
---|---|---|
committer | Thien-Thi Nguyen <ttn@gnuvola.org> | 2022-05-11 04:27:50 -0400 |
commit | 842e04b13ca07be4a997ecd52f63b94743fa83b8 (patch) | |
tree | b2d22b368ffd06705b986eb5658154ab7ccc514c /contrib | |
parent | 99a844e52e48bb6e8ed63fc737d6ee62b3f0baf6 (diff) |
refactor
(domake, ensure): New funcs.
<top-level>: Use ‘domake’, ‘ensure’.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/gana-update.sh | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/contrib/gana-update.sh b/contrib/gana-update.sh index 8fcf18852..db122b9a3 100755 --- a/contrib/gana-update.sh +++ b/contrib/gana-update.sh @@ -3,32 +3,32 @@ # Run from exchange/ main directory. set -eu -# Generate taler-error-codes.h in gana and copy it to -# src/include/taler_error_codes.h -cd contrib/gana/gnu-taler-error-codes -make -cd ../../.. -for n in taler_error_codes.c -do - if ! diff contrib/gana/gnu-taler-error-codes/${n} src/util/${n} > /dev/null - then - cp contrib/gana/gnu-taler-error-codes/$n src/util/$n - fi -done -for n in taler_error_codes.h -do - if ! diff contrib/gana/gnu-taler-error-codes/${n} src/include/${n} > /dev/null - then - cp contrib/gana/gnu-taler-error-codes/$n src/include/$n - fi -done -cd contrib/gana/gnu-taler-db-events -make -cd ../../.. -for n in taler_dbevents.h -do - if ! diff contrib/gana/gnu-taler-db-events/${n} src/include/${n} > /dev/null +domake () +{ + # $1 -- dir under contrib/gana/ + dir="contrib/gana/$1" + + make -C $dir +} + +ensure () +{ + # $1 -- filename + # $2 -- src dir under contrib/gana/ + # $3 -- dst dir under ./ + fn="$1" + src="contrib/gana/$2" + dst="./$3" + + if ! diff $src/$fn $dst/$fn > /dev/null then - cp contrib/gana/gnu-taler-db-events/$n src/include/$n + cp $src/$fn $dst/$fn fi -done +} + +domake gnu-taler-error-codes +ensure taler_error_codes.c gnu-taler-error-codes src/util +ensure taler_error_codes.h gnu-taler-error-codes src/include + +domake gnu-taler-db-events +ensure taler_dbevents.h gnu-taler-db-events src/include |