]> Frank Brehm's Git Trees - config/helga/etc.git/commitdiff
saving uncommitted changes in /etc prior to emerge run
authorroot <root@helga.brehm-online.com>
Mon, 14 Mar 2016 23:40:10 +0000 (00:40 +0100)
committerroot <root@helga.brehm-online.com>
Mon, 14 Mar 2016 23:40:10 +0000 (00:40 +0100)
.etckeeper
etckeeper/commit.d/99push
etckeeper/list-installed.d/50list-installed
etckeeper/post-install.d/50vcs-commit
etckeeper/pre-commit.d/20warn-problem-files
etckeeper/pre-commit.d/30store-metadata
etckeeper/pre-install.d/10packagelist
etckeeper/pre-install.d/50uncommitted-changes
etckeeper/uninit.d/50vcs-uninit
etckeeper/update-ignore.d/01update-ignore

index 3a61d39679205f2ede0593bdc699688f8eb32abe..dbf4f12f49f42951513e8290e8d8da97b9fc310c 100755 (executable)
@@ -119,7 +119,6 @@ maybe chmod 0644 'apache2/info_users_passwd'
 maybe chmod 0644 'apache2/magic'
 maybe chmod 0755 'apache2/modules.d'
 maybe chmod 0755 'apache2/modules.d.old'
-maybe chmod 0644 'apache2/modules.d.old/75_mod_perl.conf'
 maybe chmod 0700 'apache2/modules.d/.rcs'
 maybe chmod 0444 'apache2/modules.d/.rcs/00_apache_manual.conf,v'
 maybe chmod 0444 'apache2/modules.d/.rcs/00_default_settings.conf,v'
@@ -1131,7 +1130,6 @@ maybe chmod 0644 'cron.deny'
 maybe chmod 0750 'cron.hourly'
 maybe chmod 0755 'cron.hourly/rsync-git.sh'
 maybe chmod 0750 'cron.monthly'
-maybe chmod 0644 'cron.monthly/.keep_sys-process_cronbase-0'
 maybe chmod 0750 'cron.weekly'
 maybe chmod 0644 'cron.weekly/mdadm'
 maybe chmod 0644 'crontab'
@@ -1145,17 +1143,13 @@ maybe chmod 0640 'cups/cups-files.conf'
 maybe chgrp 'lp' 'cups/cupsd.conf'
 maybe chmod 0640 'cups/cupsd.conf'
 maybe chmod 0755 'cups/interfaces'
-maybe chmod 0644 'cups/interfaces/.keep_net-print_cups-0'
 maybe chmod 0755 'cups/ppd'
-maybe chmod 0644 'cups/ppd/.keep_net-print_cups-0'
 maybe chgrp 'lp' 'cups/snmp.conf'
 maybe chmod 0640 'cups/snmp.conf'
 maybe chmod 0755 'cups/ssl'
-maybe chmod 0644 'cups/ssl/.keep_net-print_cups-0'
 maybe chmod 0755 'dbus-1'
 maybe chmod 0644 'dbus-1/session.conf'
 maybe chmod 0755 'dbus-1/session.d'
-maybe chmod 0644 'dbus-1/session.d/.keep_sys-apps_dbus-0'
 maybe chmod 0644 'dbus-1/system.conf'
 maybe chmod 0755 'dbus-1/system.d'
 maybe chmod 0644 'dbus-1/system.d/cups.conf'
@@ -1757,12 +1751,10 @@ maybe chmod 0644 'kernel-config/config-3.8.13-gentoo-00'
 maybe chmod 0644 'kernel-config/config-3.8.13-gentoo-01'
 maybe chmod 0644 'kernel-config/config-4.0.5-gentoo-00'
 maybe chmod 0755 'kernel/postinst.d'
-maybe chmod 0644 'kernel/postinst.d/.keep_sys-apps_debianutils-0'
 maybe chmod 0644 'krb5.conf.example'
 maybe chmod 0755 'layman'
 maybe chmod 0644 'layman/layman.cfg'
 maybe chmod 0755 'layman/overlays'
-maybe chmod 0644 'layman/overlays/.keep_app-portage_layman-0'
 maybe chmod 0644 'ld.so.conf'
 maybe chmod 0755 'ld.so.conf.d'
 maybe chmod 0644 'ld.so.conf.d/05binutils.conf'
@@ -1814,11 +1806,9 @@ maybe chmod 0755 'logwatch/scripts/shared/removeheadersiso'
 maybe chmod 0644 'lsb-release'
 maybe chmod 0755 'lvm'
 maybe chmod 0700 'lvm/archive'
-maybe chmod 0600 'lvm/archive/vg0_00000-1470702330.vg'
 maybe chmod 0700 'lvm/backup'
 maybe chmod 0600 'lvm/backup/vg0'
 maybe chmod 0700 'lvm/cache'
-maybe chmod 0600 'lvm/cache/.cache'
 maybe chmod 0644 'lvm/lvm.conf'
 maybe chmod 0755 'lvm/profile'
 maybe chmod 0444 'lvm/profile/command_profile_template.profile'
@@ -2923,9 +2913,7 @@ maybe chown 'postfix' 'ssl/postfix/server.pem'
 maybe chgrp 'mail' 'ssl/postfix/server.pem'
 maybe chmod 0400 'ssl/postfix/server.pem'
 maybe chmod 0700 'ssl/private'
-maybe chmod 0644 'ssl/private/.keep_dev-libs_openssl-0'
 maybe chmod 0755 'ssl/rsyslog'
-maybe chmod 0644 'ssl/rsyslog/.keep_app-admin_rsyslog-0'
 maybe chmod 0755 'strato'
 maybe chmod 0755 'strato/nagios'
 maybe chmod 0755 'strato/nagios/.svn'
index 5aa8d21669d66d7949e036a0ab692b7bb71ee594..b5418f7434d95b9d1b26e8d03a7536a714d10c39 100755 (executable)
@@ -1,9 +1,13 @@
 #!/bin/sh
 if [ -n "$PUSH_REMOTE" ]; then
        if [ "$VCS" = git ] && [ -d .git ]; then
-               git push "$PUSH_REMOTE" master || true
+               for REMOTE in $PUSH_REMOTE; do
+                       git push "$REMOTE" master || true
+               done
        elif [ "$VCS" = hg ] && [ -d .hg ]; then
-               hg push "$PUSH_REMOTE" || true
+               for REMOTE in $PUSH_REMOTE; do
+                       hg push "$REMOTE" || true
+               done
        else
                echo "PUSH_REMOTE not yet supported for $VCS" >&2
        fi
index 1dcfda11aa6720b548d99e5713e324f11eedd37a..91718d4b98cac67a37dd2fc9d79988f7239633b9 100755 (executable)
@@ -1,14 +1,25 @@
 #!/bin/sh
-# Output to stdout a *sorted* list of all currently installed 
-# (or removed but still with config-files) packages, in the
-# format "package version\n" (or something similar).
-if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
-       dpkg-query -W -f '${Status}\t${Package} ${Version}\n' | \
-               egrep '(ok installed|ok config-files)' | cut -f2,3
-elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
-       rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
-elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
-       pacman -Q
-elif [ "$LOWLEVEL_PACKAGE_MANAGER" = qlist ]; then
-       qlist -ICv
+if [ "$1" = fmt ]; then
+       # If the list format changes, change the fmt
+       if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
+               echo 2
+       else
+               echo ""
+       fi
+else
+       # Output to stdout a *sorted* list of all currently installed 
+       # (or removed but still with config-files) packages, in the
+       # format "package version\n" (or something similar).
+       if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
+               dpkg-query -W -f '${Status}\t${Package} ${Version} ${Architecture}\n' | \
+                       egrep '(ok installed|ok config-files)' | cut -f2,3
+       elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
+               rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
+       elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
+               pacman -Q
+       elif [ "$LOWLEVEL_PACKAGE_MANAGER" = qlist ]; then
+               qlist -ICv
+       elif [ "$LOWLEVEL_PACKAGE_MANAGER" = cave ]; then
+               cave print-packages -r installed
+       fi
 fi
index 7710c4a4222c6242c577f41ab79d77b059823850..53138c82d2c673201a245171d1a2508f832f3c35 100755 (executable)
@@ -1,12 +1,13 @@
 #!/bin/sh
 set -e
-               
+
 pl="/var/cache/etckeeper/packagelist"
 
 if etckeeper unclean; then
        message="committing changes in /etc after $HIGHLEVEL_PACKAGE_MANAGER run"
 
-       if [ -e $pl.pre-install ]; then
+       set +e
+       if [ -e $pl.pre-install ] && [ "$(cat $pl.fmt 2>/dev/null || true)" = "$(etckeeper list-installed fmt)" ]; then
                (
                        echo "$message"
                        echo
@@ -16,8 +17,12 @@ if etckeeper unclean; then
        else
                etckeeper commit "$(printf "$message")"
        fi
+       status=$?
+       set -e
+
+       if [ "$status" != 0 ]; then
+               echo "warning: etckeeper failed to commit changes in /etc using $VCS" >&2
+       fi
 fi
        
-if [ -e $pl.pre-install ]; then
-       rm -f $pl.pre-install
-fi
+rm -f $pl.pre-install $pl.fmt
index f7c7580a50dd091f482698c09dd0893c29f279b0..f28d5ac6139a1e7a9c6278ebc988932115d133ee 100755 (executable)
@@ -6,14 +6,14 @@ exclude_internal () {
 }
 
 if [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then
-       special=$(find . -not -type d -not -type f -not -type l | exclude_internal) || true
-       hardlinks=$(find . -type f -not -links 1 | exclude_internal ) || true
+       special=$(find . ! -type d ! -type f ! -type l | exclude_internal) || true
+       hardlinks=$(find . -type f ! -links 1 | exclude_internal ) || true
 elif [ "$VCS" = hg ]; then
-       special=$(find . -not -type d -not -type f -not -type l | exclude_internal) || true
-       hardlinks=$(find . -type f -not -links 1 -exec hg status {} \; | exclude_internal ) || true
+       special=$(find . ! -type d ! -type f ! -type l | exclude_internal) || true
+       hardlinks=$(find . -type f ! -links 1 -exec hg status {} \; | exclude_internal ) || true
 elif [ "$VCS" = git ]; then
-       special=$(find . -not -type d -not -type f -not -type l -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true
-       hardlinks=$(find . -type f -not -links 1 -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true
+       special=$(find . ! -type d ! -type f ! -type l -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true
+       hardlinks=$(find . -type f ! -links 1 -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true
 else
        special=""
 fi
index 9e2792fbf3630b7ff6e6593431cbda295d42eed0..edec06b688726c8498397114a1d767ebc0b63690 100755 (executable)
@@ -28,7 +28,7 @@ filter_ignore() {
                                grep -Evf "$listfile"
                                ;;
                        git)
-                               git ls-files --others --ignore --exclude-standard --directory > "$listfile" || true
+                               (git ls-files -oi --exclude-standard; git ls-files -oi --exclude-standard --directory) | sort | uniq > "$listfile" || true
                                sed 's/^\.\///' | grep -xFvf "$listfile"
                                ;;
                esac
index e5fefa8f6237122cd76eb873fa9d02b67bd2fba9..fbd4ac38dc0c5fa6218fdfd9ae489faeebdfc15c 100755 (executable)
@@ -2,3 +2,4 @@
 # This list will be later used when committing.
 mkdir -p /var/cache/etckeeper/
 etckeeper list-installed > /var/cache/etckeeper/packagelist.pre-install
+etckeeper list-installed fmt > /var/cache/etckeeper/packagelist.fmt
index d03d0e81cb3545e57c878fa050333eb98e440b7d..969d34133d1b84705a4e78170a42e7d598cf8863 100755 (executable)
@@ -1,15 +1,6 @@
 #!/bin/sh
 set -e
 
-if [ "$1" = "fail-debconf" ]; then
-       . /usr/share/debconf/confmodule
-       db_subst etckeeper/commit_failed VCS "$VCS"
-       db_input critical etckeeper/commit_failed || true
-       db_go || true
-       db_reset etckeeper/commit_failed || true
-       exit 0
-fi
-
 if etckeeper unclean; then
        if [ "$AVOID_COMMIT_BEFORE_INSTALL" = 1 ]; then
                echo "" >&2
@@ -19,11 +10,6 @@ if etckeeper unclean; then
                exit 1
        fi
        if ! etckeeper commit "saving uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then
-               if [ -e /usr/share/debconf/confmodule ]; then
-                       $0 fail-debconf
-               else
-                       echo "error: etckeeper failed to commit changes in /etc using $VCS"
-                       exit 1
-               fi
+               echo "warning: etckeeper failed to commit changes in /etc using $VCS" >&2
        fi
 fi
index b61abfdee4d2d470daaeee20a425e600dcd2936e..06317c56786b787655ed9d37cf09d44a4a48a3b8 100755 (executable)
@@ -21,9 +21,9 @@ if ! grep -q "$managed_by_etckeeper" "$file"; then
        exit 0
 else
        realfile="$file"
-       if which tempfile >/dev/null 2>&1 || type -p tempfile >/dev/null 2>&1; then
+       if which tempfile >/dev/null 2>&1 || type tempfile >/dev/null 2>&1; then
                tempfile="tempfile"
-       elif which mktemp >/dev/null 2>&1 || type -p mktemp >/dev/null 2>&1; then
+       elif which mktemp >/dev/null 2>&1 || type mktemp >/dev/null 2>&1; then
                tempfile="mktemp"
        else
                echo "etckeeper warning: can't find tempfile or mktemp" >&2
@@ -32,7 +32,7 @@ else
        file=$($tempfile)
        otherentries=
        skipping=
-       while read line; do
+       while read -r line; do
                if echo "$line" | grep -q "$managed_by_etckeeper"; then
                        if [ ! "$skipping" ]; then
                                skipping=1
index 3b368e8a261bdfff2c0c48f066ad116d0b90364e..88243eadcb69eee080d2d157209e85ed59f8d613 100755 (executable)
@@ -99,9 +99,9 @@ writefile () {
                ignore "*.pacorig"
                ignore "*.pacsave"
                nl
-       elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "qlist" ]; then
+       elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "qlist" -o "$LOWLEVEL_PACKAGE_MANAGER" = "cave" ]; then
                comment "new and old versions of conffiles, stored by emerge"
-               ignore "*._cfg*"
+               ignore "._cfg*"
                nl
        fi
        
@@ -149,6 +149,7 @@ writefile () {
        ignore "cups/subscriptions.conf"
        ignore "cups/subscriptions.conf.O"
        ignore "fake-hwclock.data"
+       ignore "check_mk/logwatch.state"
        nl
        
        comment "editor temp files"
@@ -174,9 +175,9 @@ if [ -e "$file" ]; then
                fi
        fi
        realfile="$file"
-       if which tempfile >/dev/null 2>&1 || type -p tempfile >/dev/null 2>&1; then
+       if which tempfile >/dev/null 2>&1 || type tempfile >/dev/null 2>&1; then
                tempfile="tempfile"
-       elif which mktemp >/dev/null 2>&1 || type -p mktemp >/dev/null 2>&1; then
+       elif which mktemp >/dev/null 2>&1 || type mktemp >/dev/null 2>&1; then
                tempfile="mktemp"
        else
                echo "etckeeper warning: can't find tempfile or mktemp" >&2
@@ -184,7 +185,7 @@ if [ -e "$file" ]; then
        file=$($tempfile)
        (
                skipping=
-               while read line; do
+               while read -r line; do
                        if echo "$line" | grep -q "$managed_by_etckeeper"; then
                                if [ ! "$skipping" ]; then
                                        skipping=1