summaryrefslogtreecommitdiffstats
path: root/debian/linux-perf.preinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/linux-perf.preinst')
-rw-r--r--debian/linux-perf.preinst22
1 files changed, 22 insertions, 0 deletions
diff --git a/debian/linux-perf.preinst b/debian/linux-perf.preinst
new file mode 100644
index 000000000..8965a322f
--- /dev/null
+++ b/debian/linux-perf.preinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+
+old_version_suffix="$(echo "$2" | sed -rn 's/^([0-9]+\.[0-9]+).*/\1/p')"
+if [ "$old_version_suffix" ]; then
+ dpkg-maintscript-helper symlink_to_dir \
+ /usr/share/doc/linux-perf "linux-perf-${old_version_suffix}" 5.16\~rc8-1\~exp1 linux-perf -- "$@"
+fi
+
+if [ "$1" = install ] || [ "$1" = upgrade ]
+then
+ for wrapper in /usr/bin/perf \
+ /usr/share/bash-completion/completions/perf \
+ /usr/share/man/man1/perf.1.gz; do
+ diversion="${wrapper%/perf*}/perf.wrapper${wrapper#*/perf}"
+ dpkg-divert --package linux-perf --divert "$diversion" --rename \
+ --add "$wrapper"
+ done
+fi
+
+#DEBHELPER#