$OpenBSD$ index 0ab09a6..b5813f2 100755 --- tools/update-packaging/make_full_update.sh.orig Fri Feb 20 15:40:39 2015 +++ tools/update-packaging/make_full_update.sh Fri Feb 20 15:40:39 2015 @@ -10,6 +10,9 @@ . $(dirname "$0")/common.sh +# TODO: it would be better to pass this as a command line option. +directories_to_remove='TorBrowser/Data/Browser/profile.default/extensions/https-everywhere@eff.org' + # ----------------------------------------------------------------------------- print_usage() { @@ -28,10 +31,16 @@ if [ $1 = -h ]; then notice "" notice "Options:" notice " -h show this help text" + notice " -q be less verbose" notice "" exit 1 fi +if [ $1 = -q ]; then + QUIET=1 + shift +fi + # ----------------------------------------------------------------------------- archive="$1" @@ -64,17 +73,31 @@ if [ ! -f "precomplete" ]; then fi list_files files +list_symlinks symlinks symlink_targets popd # Add the type of update to the beginning of the update manifests. -> $updatemanifestv2 -> $updatemanifestv3 +> "$updatemanifestv2" +> "$updatemanifestv3" notice "" notice "Adding type instruction to update manifests" notice " type complete" -echo "type \"complete\"" >> $updatemanifestv2 -echo "type \"complete\"" >> $updatemanifestv3 +echo "type \"complete\"" >> "$updatemanifestv2" +echo "type \"complete\"" >> "$updatemanifestv3" + +# If removal of any old, existing directories is desired, emit the appropriate +# rmrfdir commands. +notice "" +notice "Adding directory removal instructions to update manifests" +for dir_to_remove in $directories_to_remove; do + # rmrfdir requires a trailing slash; if slash is missing, add one. + if ! [[ "$dir_to_remove" =~ /$ ]]; then + dir_to_remove="${dir_to_remove}/" + fi + echo "rmrfdir \"$dir_to_remove\"" >> "$updatemanifestv2" + echo "rmrfdir \"$dir_to_remove\"" >> "$updatemanifestv3" +done notice "" notice "Adding file add instructions to update manifests" @@ -100,6 +123,15 @@ for ((i=0; $i<$num_files; i=$i+1)); do targetfiles="$targetfiles \"$f\"" done +notice "" +notice "Adding symlink add instructions to update manifests" +num_symlinks=${#symlinks[*]} +for ((i=0; $i<$num_symlinks; i=$i+1)); do + link="${symlinks[$i]}" + target="${symlink_targets[$i]}" + make_addsymlink_instruction "$link" "$target" "$updatemanifestv2" "$updatemanifestv3" +done + # Append remove instructions for any dead files. notice "" notice "Adding file and directory remove instructions from file 'removed-files'"