aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-11 13:04:37 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-11 14:17:18 +0100
commit67d8b9f44b089eb04ae4ce54c03a0e06d751de30 (patch)
tree6a7bee400923de75b586481cdf647c75452f8489
parent5fb074984bad0500245bd491e0a1eea9c69b0f8f (diff)
Move default gbp.conf back to the right location
0.8.9 placed gbp.conf at /etc/git-buildpackage/gbp.conf/gbp.conf. Move the file back to the correct location. Closes: #850937 Thanks: Luca Boccassi
-rw-r--r--debian/git-buildpackage.install2
-rw-r--r--debian/git-buildpackage.preinst15
2 files changed, 16 insertions, 1 deletions
diff --git a/debian/git-buildpackage.install b/debian/git-buildpackage.install
index b54a3b8..a53a8aa 100644
--- a/debian/git-buildpackage.install
+++ b/debian/git-buildpackage.install
@@ -29,4 +29,4 @@ usr/lib/python2.?/dist-packages/gbp/scripts/supercommand.py
usr/lib/python2.?/dist-packages/gbp/tmpfile.py
usr/lib/python2.?/dist-packages/gbp/tristate.py
usr/lib/python2.?/dist-packages/gbp/version.py
-usr/share/git-buildpackage/gbp.conf etc/git-buildpackage/gbp.conf
+usr/share/git-buildpackage/gbp.conf etc/git-buildpackage/
diff --git a/debian/git-buildpackage.preinst b/debian/git-buildpackage.preinst
index a3f6b2b..e7988c2 100644
--- a/debian/git-buildpackage.preinst
+++ b/debian/git-buildpackage.preinst
@@ -13,11 +13,26 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
+cleanup_misplaced()
+{
+ ver=$1
+ misplaced=/etc/git-buildpackage/gbp.conf/gbp.conf
+ gbp_conf=/etc/git-buildpackage/gbp.conf
+ if [ -f "${misplaced}" ] && [ "$ver" = "0.8.9" ]; then
+ mv -f "${misplaced}" "${gbp_conf}.dpkg-bak"
+ if ! rmdir "${gbp_conf}"; then
+ echo "Cannot remove bad dir ${gbp_conf}, trying rename" 1>&2
+ mv -f "${gbp_conf}" "${gbp_conf}".dpkg-dir-bak
+ fi
+ mv -f ${gbp_conf}.dpkg-bak ${gbp_conf}
+ fi
+}
case "$1" in
install|upgrade)
dpkg-maintscript-helper rm_conffile \
/etc/bash_completion.d/git-buildpackage 0.6.34~ git-buildpackage -- "$@"
+ cleanup_misplaced $2
;;
abort-upgrade)