Просмотр исходного кода

dpkg-buildpackage: add execute right on debian/rules when missing

That right should normally not be missing as dpkg-source -x automatically
sets it. However manually applying a Debian diff doesn't restore
that right so let dpkg-buildpackage restore it in that case and display a
warning to let the user know that it was not really normal.
Raphael Hertzog лет назад: 17
Родитель
Сommit
58b04d8f75
2 измененных файлов с 7 добавлено и 0 удалено
  1. 2 0
      debian/changelog
  2. 5 0
      scripts/dpkg-buildpackage.pl

+ 2 - 0
debian/changelog

@@ -77,6 +77,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
   * Do not update/create debian/patches/.dpkg-source-applied during build,
     it's only meant to document what patches have been applied at extraction
     time. Closes: #525835
+  * Let dpkg-buildpackage add the missing execute right on debian/rules if
+    needed. Display a warning when it happens. Closes: #499088
 
   [ Guillem Jover ]
   * Fix typo in dpkg output (‘unexecpted’ → ‘unexpected’). Closes: #519082

+ 5 - 0
scripts/dpkg-buildpackage.pl

@@ -352,6 +352,11 @@ unless ($sourceonly) {
 my $pv = "${pkg}_$sversion";
 my $pva = "${pkg}_${sversion}_$arch";
 
+if (not -x "debian/rules") {
+    warning(_g("debian/rules is not executable: fixing that."));
+    chmod(0755, "debian/rules"); # No checks of failures, non fatal
+}
+
 if ($checkbuilddep) {
     if ($admindir) {
 	push @checkbuilddep_args, "--admindir=$admindir";