From 25d948f14c5f69fe44ef97097528ae6a4d1e94f9 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 30 Jan 2020 14:02:59 +0100 Subject: bin/delete-packages: `-n` should work flawlessly again, now --- bin/delete-packages | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'bin/delete-packages') diff --git a/bin/delete-packages b/bin/delete-packages index dddd5fa..7486644 100755 --- a/bin/delete-packages +++ b/bin/delete-packages @@ -57,7 +57,7 @@ block_flag='-n' build_support='' force_packages='' ignore_insanity=false -no_action=false +no_action_option='' while true do @@ -81,7 +81,7 @@ do ignore_insanity=true ;; -n|--no-action) - no_action=true + no_action_option='-n' ;; -w|--wait) block_flag='' @@ -113,7 +113,7 @@ fi # Create a lock file and a trap. -if ! ${no_action}; then +if [ -z "${no_action_option}" ]; then # exec 9> "${build_list_lock_file}" # if ! verbose_flock ${block_flag} 9; then @@ -358,14 +358,6 @@ fi mkdir "${tmp_dir}/repos" -if ${no_action}; then - printf 'I would delete the following files from the master mirror:\n' - sed ' - s,^, , - ' "${tmp_dir}/package-files" - exit -fi - while read -r arch repo; do { printf 'mkdir -p "%s/repos/%s"\n' "${tmp_dir}" "${arch}" @@ -380,7 +372,7 @@ while read -r arch repo; do done printf ' "%s/repos/%s"\n' "${tmp_dir}" "${arch}" } \ - | intent_something + | intent_something "${no_action_option}" { printf 'repo-remove "%s/repos/%s/%s.db.tar.gz" ' \ "${tmp_dir}" \ @@ -398,7 +390,7 @@ while read -r arch repo; do done printf '\n' } \ - | intent_something + | intent_something "${no_action_option}" { printf 'failsafe_rsync' for suffix in 'db' 'files'; do @@ -413,7 +405,7 @@ while read -r arch repo; do "${arch}" \ "${repo}" } \ - | intent_something + | intent_something "${no_action_option}" done \ <"${tmp_dir}/repositories" @@ -455,7 +447,7 @@ done \ printf 'END_OF_MYSQL_QUERY\n' } \ | sed 's/`/\\`/g' \ -| intent_something +| intent_something "${no_action_option}" { printf 'failsafe_sftp <