From 8a4e09dd5d133cc1a4ae4d74bedd499fc71e8ed0 Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Thu, 6 Oct 2016 12:13:08 +0200 Subject: [PATCH] Ignoriranje datoteka ciji nazivi zavrsavaju s ~, .old, .staro i slicno --- debian/changelog | 2 ++ debian/postinst | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3fe84a8..c8edafd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ apache2-cn (2.4.10+2) UNRELEASED; urgency=low * Koristi Require u predloscima, umjesto Order i Allow direktiva. * Default vrijednost za Options direktivu u predloscima (kao primjer). * Aktivacija modula access_compat. + * Ignoriranje datoteka ciji nazivi zavrsavaju s ~, .old, .staro, + .bkp, .bak, .swp, .tmp, .dpkg-* i .cn-*. -- Dragan Dosen Thu, 06 Oct 2016 10:51:58 +0200 diff --git a/debian/postinst b/debian/postinst index 50f920e..abc7092 100755 --- a/debian/postinst +++ b/debian/postinst @@ -288,7 +288,7 @@ backup_conf () { cp_echo "CN: Doing backup for all files in $dir" for file in ${dir}/*; do if [ -f "$file" ]; then - if [ -z "$(echo $file | egrep '^/.*~')" ]; then + if [ -z "$(echo "$file" | egrep '^/.*(~|(\.(old|staro|bkp|bak|swp|tmp|dpkg-.+|cn-.+)))$')" ]; then backup_dir="$BACKUPDIR/$(basename $(dirname "$file"))" cp_backup_conffile -d "$backup_dir" -p "$file" fi @@ -330,6 +330,7 @@ move_conf () { if [ -d "${dir}" ] && [ -n "$(ls -A ${dir}/)" ]; then mkdir -p "$newdir" for file in ${dir}/*; do + [ -z "$(echo "$file" | egrep '^/.*(~|(\.(old|staro|bkp|bak|swp|tmp|dpkg-.+|cn-.+)))$')" ] || continue newfile="${newdir}/$(basename "$file" .conf).conf" if [ ! -e "$newfile" ]; then cp_echo "CN: Preserving changes to $newfile (renamed from $file)." @@ -369,6 +370,8 @@ rename_conf () { if [ -d "${edir}" ] && [ -n "$(ls -A ${edir}/)" ]; then mkdir -p "$adir" for efile in ${edir}/*; do + [ -z "$(echo "$efile" | egrep '^/.*(~|(\.(old|staro|bkp|bak|swp|tmp|dpkg-.+|cn-.+)))$')" ] || continue + [ ! -e "${edir}/$(basename "$efile" .conf).conf" ] || continue afile="$(readlink -q -m "$efile")" -- 1.7.10.4