From: Andy Whitcroft Date: Sun, 31 Jan 2016 14:30:07 +0000 (+0000) Subject: UBUNTU: [Debian] postinst -- detect symlinks correctly X-Git-Tag: Ubuntu-4.10.0-9.11~541 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a7ba46d20681adae8bea932e79fda16b20344815;p=mirror_ubuntu-zesty-kernel.git UBUNTU: [Debian] postinst -- detect symlinks correctly BugLink: http://bugs.launchpad.net/bugs/1536810 Signed-off-by: Andy Whitcroft --- diff --git a/debian/control-scripts/postinst b/debian/control-scripts/postinst index c4fc23f680c3..dc2d1c172d5a 100644 --- a/debian/control-scripts/postinst +++ b/debian/control-scripts/postinst @@ -856,7 +856,8 @@ if ($initrd) { image_magic("initrd.img", $image_dest); } else { - if (! -e "initrd.img") { + lstat("initrd.img"); + if (! -e _) { handle_missing_link("initrd.img", $image_dest, "initrd.img-$version", $realimageloc); } @@ -914,7 +915,8 @@ if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m//og) { image_magic($kimage, $image_dest); } else { - if (! -e "$kimage") { + lstat("$kimage"); + if (! -e _) { handle_missing_link($kimage, $image_dest, "$kimage-$version", $realimageloc); }