diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | debian/rules | 3 | ||||
-rwxr-xr-x | pre-commit.d/30store-metadata | 14 |
5 files changed, 16 insertions, 6 deletions
@@ -36,7 +36,7 @@ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),yum) $(INSTALL_DATA) yum-etckeeper.py $(DESTDIR)$(prefix)/lib/yum-plugins/etckeeper.py $(INSTALL_DATA) yum-etckeeper.conf $(DESTDIR)$(etcdir)/yum/pluginconf.d/etckeeper.conf endif - -./etckeeper-bzr/__init__.py install --root=$(DESTDIR) || echo "** bzr support not installed" + -./etckeeper-bzr/__init__.py install --root=$(DESTDIR) ${PYTHON_INSTALL_OPTS} || echo "** bzr support not installed" echo "** installation successful" clean: etckeeper.spec diff --git a/debian/changelog b/debian/changelog index 95b32c1..44d5466 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ etckeeper (0.58) UNRELEASED; urgency=low Thanks to Дмитрий Матросов for reporting the bug and developing a fixup script (attached to the bug) which could be used if you've already encountered this problem. + * Bugfix for filenames containing single quotes. -- Joey Hess <joeyh@debian.org> Fri, 25 Nov 2011 12:00:55 -0400 diff --git a/debian/control b/debian/control index 350d9f8..71089d9 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Homepage: http://kitenet.net/~joey/code/etckeeper/ Package: etckeeper Architecture: all Section: admin -Depends: git-core (>= 1:1.5.4) | git (>= 1:1.7) | mercurial | bzr (>= 1.5~) | darcs, ${misc:Depends}, ${python:Depends} +Depends: git-core (>= 1:1.5.4) | git (>= 1:1.7) | mercurial | bzr (>= 1.5~) | darcs, ${misc:Depends} Recommends: cron Suggests: sudo (>= 1.7.4p4) Conflicts: bzr (<< 1.5~) diff --git a/debian/rules b/debian/rules index cd2906f..b6b9b90 100755 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,7 @@ #!/usr/bin/make -f + +export PYTHON_INSTALL_OPTS=--install-layout=deb + %: dh --with python2 $@ diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 871d5c8..3b79e46 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -32,10 +32,16 @@ filter_ignore() { statf() { while read statfile; do - echo "$(stat --format="$1" "$statfile") '$statfile'" + printf "$(stat --format="$1" "$statfile") " + echo "$statfile" | shellquote done } +shellquote() { + # Single quotes text, escaping existing single quotes. + sed -e "s/'/'\"'\"'/" -e "s/^/'/" -e "s/$/'/" +} + generate_metadata() { # This function generates the script commands to fix any file # ownerships that aren't owner=root, group=root, as well as to @@ -62,7 +68,7 @@ generate_metadata() { # These version control systems do not track directories, # so empty directories must be stored specially. find $NOVCS -type d -empty -print | - sort | sed -e "s/^/mkdir -p '/" -e "s/\$/'/" + sort | shellquote | sed -e "s/^/mkdir -p /" fi if [ "$VCS" = darcs ]; then @@ -70,7 +76,7 @@ generate_metadata() { # so they must be stored specially. find $NOVCS -type l -print | sort | filter_ignore | while read link; do dest=$( readlink "$link" ) - printf "ln -sf '%s' '%s'\n" "$dest" "$link" + printf "ln -sf '%s' '%s'\n" "$(echo "$dest" | shellquote)" "$(echo "$link" | shellquote)" done fi @@ -79,7 +85,7 @@ generate_metadata() { # Find all files and directories that don't have root as the group find $NOVCS \! -group $(id -g) -print | statf "maybe chgrp %G" | sort | filter_unknown 'maybe chgrp' group - find $NOVCS -print | statf "maybe chmod %a" | sort + find $NOVCS \( -type f -or -type d \) -print | statf "maybe chmod %a" | sort # We don't handle xattrs. # Maybe check for getfattr/setfattr and use them if they're available? |