From 77b86249c1787d700f3ef2016b0cbd3630d3b06a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Nov 2011 12:30:25 -0400 Subject: python2 fixes --- Makefile | 2 +- debian/control | 2 +- debian/rules | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b139e19..677d59f 100644 --- a/Makefile +++ b/Makefile @@ -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/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 $@ -- cgit v1.2.3 From 299dc44f1014404ca1367b72e2a22605ef22d127 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Nov 2011 12:32:29 -0400 Subject: Bugfix for filenames containing single quotes. -- Joey Hess Fri, 25 Nov 2011 12:00:55 -0400 --- debian/changelog | 6 ++++++ pre-commit.d/30store-metadata | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7773187..4614159 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +etckeeper (0.58) UNRELEASED; urgency=low + + * Bugfix for filenames containing single quotes. + + -- Joey Hess Fri, 25 Nov 2011 12:00:55 -0400 + etckeeper (0.57) unstable; urgency=low * Use find -path instead of less portable find -wholename. diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 2e35e6c..aeec374 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 files # that aren't owner=root, group=root, or mode=0644 or 0755. @@ -60,7 +66,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 @@ -68,7 +74,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 -- cgit v1.2.3