Bug#679704: live-tools: fails to upgrade from wheezy: ln: failed to create symbolic link `/usr/bin/uptime': File exists
tags 679704 + patch
thanks
Hi,
this happens, because the preinstal uncoditionally tries to create the
symlink, w/o checking that it already is a symlink the live-uptime.
Easy reproducable via apt-get install --reinstall live-tools, no need
for an upgrade :)
Attached is a patch which moves the creation of the symlink from the
preinst (and removing of it in postrm) to the actual package (via
live-tools.links).
Upgrading 3.0.2-1 → 3.0.2-1.1 and 3.0.2-1.1 → 3.0.2-1.1 is tested,
everything else is not.
Regards
Evgeni
--
Bruce Schneier can read and understand Perl programs.
>From cf828f00b1c02e873e02ce3446d948a6d747bc6c Mon Sep 17 00:00:00 2001
From: Evgeni Golov <evgeni@debian.org>
Date: Thu, 5 Jul 2012 16:17:06 +0200
Subject: [PATCH] =?UTF-8?q?install=20the=20uptime=20=E2=86=92=20live-uptime=20?=
=?UTF-8?q?link=20in=20the=20package,=20not=20in=20preinst?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
debian/live-tools.links | 2 ++
debian/live-tools.postrm | 2 --
debian/live-tools.preinst | 2 --
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/debian/live-tools.links b/debian/live-tools.links
index 5a18980..76d2d47 100644
--- a/debian/live-tools.links
+++ b/debian/live-tools.links
@@ -5,3 +5,5 @@
/usr/share/man/de/man7/live-tools.7.gz /usr/share/man/de/man1/live-system.1.gz
/usr/share/man/de/man7/live-tools.7.gz /usr/share/man/de/man1/live-toram.1.gz
/usr/share/man/de/man7/live-tools.7.gz /usr/share/man/de/man1/live-uptime.1.gz
+
+/usr/bin/live-uptime /usr/bin/uptime
diff --git a/debian/live-tools.postrm b/debian/live-tools.postrm
index 6c06daa..6618670 100644
--- a/debian/live-tools.postrm
+++ b/debian/live-tools.postrm
@@ -4,8 +4,6 @@ set -e
case "${1}" in
remove)
- rm -f /usr/bin/uptime
-
dpkg-divert --package live-tools --quiet --remove --rename --divert /usr/bin/uptime.procps /usr/bin/uptime
;;
diff --git a/debian/live-tools.preinst b/debian/live-tools.preinst
index 8b02200..b505fce 100644
--- a/debian/live-tools.preinst
+++ b/debian/live-tools.preinst
@@ -5,8 +5,6 @@ set -e
case "${1}" in
install|upgrade)
dpkg-divert --package live-tools --quiet --add --rename --divert /usr/bin/uptime.procps /usr/bin/uptime
-
- ln -s /usr/bin/live-uptime /usr/bin/uptime
;;
abort-upgrade)
--
1.7.10
Reply to: