diff --git a/debian/changelog b/debian/changelog index 2797106df..9ca5e1abe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ linux (3.14.13-3) UNRELEASED; urgency=medium #756049). * Update French debconf template translations (David Prévot) (Closes: #756134). + * Rewrite postinst to not require File::stat perl module (Closes: #756207). [ Ben Hutchings ] * [amd64] Reject x32 executables if x32 ABI not supported diff --git a/debian/templates/image.plain.postinst.in b/debian/templates/image.plain.postinst.in index 37f253014..a6f00bc7a 100755 --- a/debian/templates/image.plain.postinst.in +++ b/debian/templates/image.plain.postinst.in @@ -5,7 +5,6 @@ use warnings; use Cwd 'abs_path'; use Debconf::Client::ConfModule qw(:all); use POSIX (); -use File::stat; version('2.0'); my $capb = capb('backup', 'escape'); @@ -552,9 +551,10 @@ else { # of / are the same as that of /sbin/init. This may fail if not running as # root or if /proc is not mounted, in which case 2 is returned. sub detect_chroot { - my $st1 = stat("/") or return 2; - my $st2 = stat("/proc/1/root") or return 2; - return ($st1->dev != $st2->dev) || ($st1->ino != $st2->ino); + my $dev1, $ino1, $dev2, $ino2; + ($dev1, $ino1) = stat("/") or return 2; + ($dev2, $ino2) = stat("/proc/1/root") or return 2; + return ($dev1 != $dev2) || ($ino1 != $ino2); } sub is_package_installed {