summaryrefslogtreecommitdiffstats
path: root/debian/git.preinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:47:55 +0000
commitf04f772d4c2791a1bc0e36fe8df2dc8d62ea8378 (patch)
tree6601becfb9eccb5e3361f1f802e96ea7839bfca8 /debian/git.preinst
parentAdding upstream version 1:2.39.2. (diff)
downloadgit-f04f772d4c2791a1bc0e36fe8df2dc8d62ea8378.tar.xz
git-f04f772d4c2791a1bc0e36fe8df2dc8d62ea8378.zip
Adding debian version 1:2.39.2-1.1.debian/1%2.39.2-1.1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/git.preinst34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/git.preinst b/debian/git.preinst
new file mode 100644
index 0000000..05be8e0
--- /dev/null
+++ b/debian/git.preinst
@@ -0,0 +1,34 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+# /var/cache/git/ -> /var/lib/git/ transition
+if test "$1" = upgrade &&
+ dpkg --compare-versions "$2" lt-nl '1:1.8.4~rc0-1'; then
+ mkdir -m 755 -p /var/lib/git
+ (
+ cd /var/lib/git
+ for target in ../../cache/git/*; do
+ if ! test -L "$target" && ! test -e "$target"; then
+ continue
+ fi
+
+ link=${target#../../cache/git/}
+ if ! test -L "$link" && ! test -e "$link"; then
+ ln -s "$target" "$link"
+ fi
+ done
+ )
+fi
+
+# A previous version of the /var/lib/git/ transition code
+# left behind a symlink '/var/lib/git/*' -> '../../cache/git/*'.
+if test "$1" = upgrade &&
+ dpkg --compare-versions "$2" eq '1:1.8.4~rc0-1' &&
+ test -L '/var/lib/git/*'; then
+ target=$(readlink '/var/lib/git/*')
+ if test "$target" = '../../cache/git/*'; then
+ rm -f '/var/lib/git/*'
+ fi
+fi