diff options
author | Erich Eckner <git@eckner.net> | 2018-06-04 17:00:41 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-04 17:00:41 +0200 |
commit | 3758d41eb176721f524174dda66ad9277216df5a (patch) | |
tree | 33dff9578fe804890ecfa991472a33b9e586283f /bin | |
parent | b8d358422002d5406945a74e28713556eede1fed (diff) | |
download | builder-3758d41eb176721f524174dda66ad9277216df5a.tar.xz |
bin/db-update: do not lock if -n
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/db-update | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/bin/db-update b/bin/db-update index 0c46ba9..91840d6 100755 --- a/bin/db-update +++ b/bin/db-update @@ -112,20 +112,22 @@ if [ -s "${work_dir}/build-master-sanity" ]; then exit fi -# Create tmp_dir, lock and trap. - -exec 9> "${package_database_lock_file}" -if ! verbose_flock ${block_flag} 9; then - >&2 echo 'come back (shortly) later - I cannot lock package database.' - exit 0 -fi +if ! ${no_action}; then + # Create lock. + exec 9> "${package_database_lock_file}" + if ! verbose_flock ${block_flag} 9; then + >&2 echo 'come back (shortly) later - I cannot lock package database.' + exit 0 + fi -exec 8> "${sanity_check_lock_file}" -if ! verbose_flock -s ${block_flag} 8; then - >&2 echo 'come back (shortly) later - sanity-check currently running.' - exit 0 + exec 8> "${sanity_check_lock_file}" + if ! verbose_flock -s ${block_flag} 8; then + >&2 echo 'come back (shortly) later - sanity-check currently running.' + exit 0 + fi fi +# Create tmp_dir and trap. tmp_dir=$(mktemp -d "${work_dir}/tmp.db-update.XXXXXXXXXX") trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT |