summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-23 11:48:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-23 11:48:47 +0000
commit5f415f53893c863a5274b78cf0af80801975e984 (patch)
tree5b2efa3b49f26f2e2ca3ff3fb7e07017b64943bb
parentReleasing progress-linux version 2.20.5-0.0~progress5+u1. (diff)
downloaddevscripts-5f415f53893c863a5274b78cf0af80801975e984.tar.xz
devscripts-5f415f53893c863a5274b78cf0af80801975e984.zip
Merging upstream version 2.21.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--README1
-rw-r--r--lib/Devscripts/Uscan/Config.pm8
-rw-r--r--lib/Devscripts/Uscan/Downloader.pm4
-rw-r--r--lib/Devscripts/Uscan/WatchFile.pm2
-rw-r--r--po4a/po/de.po70
-rw-r--r--po4a/po/devscripts.pot68
-rw-r--r--po4a/po/fr.po74
-rw-r--r--scripts/Makefile13
-rwxr-xr-xscripts/debbisect31
-rwxr-xr-xscripts/debchange.pl9
-rwxr-xr-xscripts/debclean.sh4
-rwxr-xr-xscripts/debrebuild.pl1225
-rwxr-xr-xscripts/debrelease.sh2
-rwxr-xr-xscripts/debrsign.sh2
-rwxr-xr-xscripts/debsign.sh4
-rw-r--r--scripts/devscripts/__init__.py0
-rwxr-xr-xscripts/diff2patches.sh2
-rwxr-xr-xscripts/dscextract.sh10
-rwxr-xr-xscripts/list-unreleased.sh4
-rwxr-xr-xscripts/ltnu.sh2
-rwxr-xr-xscripts/namecheck.pl4
-rwxr-xr-xscripts/nmudiff.sh2
-rwxr-xr-xscripts/origtargz.pl18
-rwxr-xr-xscripts/pts-subscribe.sh2
-rw-r--r--scripts/salsa.bash_completion2
-rwxr-xr-xscripts/setup.py15
-rwxr-xr-xscripts/uupdate.sh2
-rwxr-xr-xscripts/what-patch.sh14
-rwxr-xr-xscripts/wnpp-alert.sh6
-rw-r--r--test/Makefile3
-rwxr-xr-xtest/test_debchange20
-rwxr-xr-xtest/test_debrepro8
-rwxr-xr-xtest/test_uscan2
-rwxr-xr-xtest/test_uscan_ftp10
-rwxr-xr-xtest/test_uscan_group2
-rwxr-xr-xtest/test_uscan_mangle18
-rwxr-xr-xtest/test_uscan_svn7
37 files changed, 1185 insertions, 485 deletions
diff --git a/README b/README
index 9e694ac..b46d0cf 100644
--- a/README
+++ b/README
@@ -125,6 +125,7 @@ And now, in alphabetical order, the scripts:
- debrebuild: A script that provided a .buildinfo file reports the
instructions on how to try to reproduce the reported build.
+ [sbuild | mmdebstrap, libdistro-info-perl]
- debrepro: A script that tests reproducibility of Debian packages. It will
build a given source directory twice, with a set of variation between the
diff --git a/lib/Devscripts/Uscan/Config.pm b/lib/Devscripts/Uscan/Config.pm
index 038adf4..d5b997f 100644
--- a/lib/Devscripts/Uscan/Config.pm
+++ b/lib/Devscripts/Uscan/Config.pm
@@ -200,8 +200,12 @@ use constant keys => [
['extra-debug', undef, sub { $verbose = 3 }],
['no-verbose', undef, sub { $verbose = 0; return 1; }],
[
- 'verbose|v+', 'USCAN_VERBOSE',
- sub { $verbose = ($_[1] =~ /^(?:(\d)|yes)$/i ? $1 : 0); return 1; }
+ 'verbose|v+',
+ 'USCAN_VERBOSE',
+ sub {
+ $verbose = ($_[1] =~ /^yes$/i ? 1 : $_[1] =~ /^(\d)$/ ? $1 : 0);
+ return 1;
+ }
],
# Display version
[
diff --git a/lib/Devscripts/Uscan/Downloader.pm b/lib/Devscripts/Uscan/Downloader.pm
index d4b691b..1631caf 100644
--- a/lib/Devscripts/Uscan/Downloader.pm
+++ b/lib/Devscripts/Uscan/Downloader.pm
@@ -150,8 +150,10 @@ sub download ($$$$$$$$) {
my ($gitrepo, $gitref) = split /[[:space:]]+/, $url, 2;
if ($mode eq 'svn') {
- my $tempdir = tempdir(CLEANUP => 1);
+ my $tempdir = tempdir(CLEANUP => 1);
+ my $old_umask = umask(oct('022'));
uscan_exec('svn', 'export', $url, "$tempdir/$pkg-$ver");
+ umask($old_umask);
find({
wanted => sub {
return if !-d $File::Find::name;
diff --git a/lib/Devscripts/Uscan/WatchFile.pm b/lib/Devscripts/Uscan/WatchFile.pm
index 9e34bb9..6f66f75 100644
--- a/lib/Devscripts/Uscan/WatchFile.pm
+++ b/lib/Devscripts/Uscan/WatchFile.pm
@@ -482,7 +482,7 @@ sub process_group {
if ($dehs) {
$dehs_tags->{'decoded-checksum'} = $v;
} else {
- uscan_warn 'Checksum ref: ' . join('+~', @ck_versions) . "\n";
+ uscan_verbose 'Checksum ref: ' . join('+~', @ck_versions) . "\n";
}
}
return 0;
diff --git a/po4a/po/de.po b/po4a/po/de.po
index 9a22d92..7435ba7 100644
--- a/po4a/po/de.po
+++ b/po4a/po/de.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: devscripts 2.18.9\n"
"Report-Msgid-Bugs-To: devscripts@packages.debian.org\n"
-"POT-Creation-Date: 2020-11-28 06:44+0100\n"
+"POT-Creation-Date: 2021-02-16 17:47+0100\n"
"PO-Revision-Date: 2020-04-25 23:04+0200\n"
"Last-Translator: Chris Leick <c.leick@vollbio.de>\n"
"Language-Team: de <debian-l10n-german@lists.debian.org>\n"
@@ -217,7 +217,7 @@ msgstr ""
#: ../scripts/ltnu.pod:27 ../scripts/manpage-alert.1:12
#: ../scripts/mass-bug.pl:59 ../scripts/mk-build-deps.pl:44
#: ../scripts/mk-origtargz.pl:64 ../scripts/nmudiff.1:24
-#: ../scripts/origtargz.pl:96 ../scripts/plotchangelog.1:43
+#: ../scripts/origtargz.pl:100 ../scripts/plotchangelog.1:43
#: ../scripts/pts-subscribe.1:18 ../scripts/rc-alert.1:17
#: ../scripts/rmadison.pl:278 ../scripts/sadt.pod:42 ../scripts/salsa.pl:409
#: ../doc/suspicious-source.1:34 ../scripts/tagpending.pl:94
@@ -357,7 +357,7 @@ msgstr ""
#: ../scripts/grep-excuses.1:58 ../scripts/hardening-check.pl:676
#: ../scripts/list-unreleased.1:19 ../scripts/ltnu.pod:105
#: ../scripts/mk-origtargz.pl:209 ../scripts/nmudiff.1:121
-#: ../scripts/origtargz.pl:158 ../scripts/plotchangelog.1:124
+#: ../scripts/origtargz.pl:162 ../scripts/plotchangelog.1:124
#: ../scripts/pts-subscribe.1:51 ../scripts/rc-alert.1:121
#: ../scripts/rmadison.pl:399 ../scripts/sadt.pod:69 ../scripts/salsa.pl:852
#: ../scripts/tagpending.pl:149 ../scripts/uscan.pl:2101
@@ -411,7 +411,7 @@ msgstr ""
#: ../scripts/manpage-alert.1:28 ../scripts/mass-bug.pl:566
#: ../scripts/mergechanges.1:28 ../scripts/mk-build-deps.pl:141
#: ../scripts/mk-origtargz.pl:213 ../scripts/namecheck.pl:24
-#: ../scripts/nmudiff.1:125 ../scripts/origtargz.pl:162
+#: ../scripts/nmudiff.1:125 ../scripts/origtargz.pl:166
#: ../scripts/plotchangelog.1:126 ../scripts/pts-subscribe.1:56
#: ../scripts/rc-alert.1:125 ../scripts/rmadison.pl:403 ../scripts/salsa.pl:856
#: ../scripts/svnpath.pl:96 ../scripts/transition-check.pl:81
@@ -5030,7 +5030,7 @@ msgstr ""
"Aktualisierens (oder Erstellens) des Bauwurzelverzeichnisses."
#. type: =head1
-#: ../scripts/cowpoke.1:369 ../scripts/origtargz.pl:81
+#: ../scripts/cowpoke.1:369 ../scripts/origtargz.pl:85
#: ../scripts/rmadison.pl:391
#, no-wrap
msgid "NOTES"
@@ -13981,7 +13981,8 @@ msgstr "I<debuild>(1)"
#: ../doc/devscripts.1:79
msgid ""
"A script that provided a .buildinfo file reports the instructions on how to "
-"try to reproduce the reported build."
+"try to reproduce the reported build. [sbuild | mmdebstrap, libdistro-info-"
+"perl]"
msgstr ""
#. type: IP
@@ -14900,7 +14901,7 @@ msgid "Suppress B<wget>/B<curl> non-error output."
msgstr "unterdrückt Ausgaben von B<wget>/B<curl>, die keine Fehler betreffen."
#. type: =item
-#: ../scripts/dget.pl:636 ../scripts/origtargz.pl:130
+#: ../scripts/dget.pl:636 ../scripts/origtargz.pl:134
msgid "B<-d>, B<--download-only>"
msgstr "B<-d>, B<--download-only>"
@@ -18844,7 +18845,7 @@ msgstr "Es werden verschiedene Speicherorte zum Herunterladen ausprobiert:"
#. type: =item
#: ../scripts/origtargz.pl:47 ../scripts/origtargz.pl:51
#: ../scripts/origtargz.pl:55 ../scripts/origtargz.pl:59
-#: ../scripts/origtargz.pl:63
+#: ../scripts/origtargz.pl:63 ../scripts/origtargz.pl:67
msgid "*"
msgstr "*"
@@ -18865,6 +18866,13 @@ msgstr "B<pristine-tar> wird probiert."
#. type: textblock
#: ../scripts/origtargz.pl:61
+#, fuzzy
+#| msgid "B<pristine-tar> is tried."
+msgid "B<pristine-lfs> is tried."
+msgstr "B<pristine-tar> wird probiert."
+
+#. type: textblock
+#: ../scripts/origtargz.pl:65
msgid ""
"B<apt-get source> is tried when B<apt-cache showsrc> reports a matching "
"version."
@@ -18873,13 +18881,13 @@ msgstr ""
"source> probiert."
#. type: textblock
-#: ../scripts/origtargz.pl:65
+#: ../scripts/origtargz.pl:69
msgid "Finally, B<uscan --download --download-current-version> is tried."
msgstr "Am Ende wird B<uscan --download --download-current-version> versucht."
# FIXME s/preserved/are preserved/
#. type: textblock
-#: ../scripts/origtargz.pl:69
+#: ../scripts/origtargz.pl:73
msgid ""
"When asked to unpack the orig tarball, B<origtargz> will remove all files "
"and directories from the current directory, except the debian directory, and "
@@ -18901,7 +18909,7 @@ msgstr ""
"hgignore>), falls sie im VCS gespeichert sind."
#. type: textblock
-#: ../scripts/origtargz.pl:78
+#: ../scripts/origtargz.pl:82
msgid ""
"The default behavior is to unpack the orig tarball if the current directory "
"is empty except for a F<debian> directory and the VCS files mentioned above."
@@ -18911,7 +18919,7 @@ msgstr ""
"oben erwähnten VCS-Dateien leer ist."
#. type: textblock
-#: ../scripts/origtargz.pl:83
+#: ../scripts/origtargz.pl:87
msgid ""
"Despite B<origtargz> being called \"targz\", it will work with any "
"compression scheme used for the tarball."
@@ -18920,7 +18928,7 @@ msgstr ""
"benutzten Komprimierungsverfahren."
#. type: textblock
-#: ../scripts/origtargz.pl:86
+#: ../scripts/origtargz.pl:90
msgid ""
"A similar tool to unpack orig tarballs is B<uupdate>(1). B<uupdate> creates "
"a new working directory, unpacks the tarball, and applies the Debian F<.diff."
@@ -18933,7 +18941,7 @@ msgstr ""
"B<origtargz> das aktuelle Verzeichnis und behält die VCS-Metadaten bei."
#. type: textblock
-#: ../scripts/origtargz.pl:91
+#: ../scripts/origtargz.pl:95
msgid ""
"For Debian package repositories that keep the full upstream source, other "
"tools should be used to upgrade the repository from the new tarball. See "
@@ -18947,12 +18955,12 @@ msgstr ""
"Tarballs nützlich."
#. type: =item
-#: ../scripts/origtargz.pl:100
+#: ../scripts/origtargz.pl:104
msgid "B<-p>, B<--path> I<directory>"
msgstr "B<-p>, B<--path> I<Verzeichnis>"
#. type: textblock
-#: ../scripts/origtargz.pl:102
+#: ../scripts/origtargz.pl:106
msgid ""
"Add I<directory> to the list of locations to search for an existing "
"tarball. When found, a hardlink is created if possible, otherwise a symlink."
@@ -18962,12 +18970,12 @@ msgstr ""
"Möglichkeit ein harter, andernfalls ein symbolischer Verweis erzeugt."
#. type: =item
-#: ../scripts/origtargz.pl:105
+#: ../scripts/origtargz.pl:109
msgid "B<-u>, B<--unpack>[=B<no>|B<once>|B<yes>]"
msgstr "B<-u>, B<--unpack>[=B<no>|B<once>|B<yes>]"
#. type: textblock
-#: ../scripts/origtargz.pl:107
+#: ../scripts/origtargz.pl:111
msgid ""
"Unpack the downloaded orig tarball to the current directory, replacing "
"everything except the debian directory. Existing files are removed, except "
@@ -18982,22 +18990,22 @@ msgstr ""
"hgignore>, F<_darcs> und F<.svn>."
#. type: =item
-#: ../scripts/origtargz.pl:115
+#: ../scripts/origtargz.pl:119
msgid "B<no>"
msgstr "B<no>"
#. type: textblock
-#: ../scripts/origtargz.pl:117
+#: ../scripts/origtargz.pl:121
msgid "Do not unpack the orig tarball."
msgstr "entpackt nicht den Original-Tarball."
#. type: =item
-#: ../scripts/origtargz.pl:119
+#: ../scripts/origtargz.pl:123
msgid "B<once> (default when B<--unpack> is not used)"
msgstr "B<once> (Vorgabe, wenn nicht B<--unpack> benutzt wird)"
#. type: textblock
-#: ../scripts/origtargz.pl:121
+#: ../scripts/origtargz.pl:125
msgid ""
"If the current directory contains only a F<debian> directory (and possibly "
"some dotfiles), unpack the orig tarball. This is the default behavior."
@@ -19007,27 +19015,27 @@ msgstr ""
"der Original-Tarball entpackt. Dies ist das Standardverhalten."
#. type: =item
-#: ../scripts/origtargz.pl:124
+#: ../scripts/origtargz.pl:128
msgid "B<yes> (default for B<--unpack> without argument)"
msgstr "B<yes> (Vorgabe für B<--unpack> ohne Argument)"
#. type: textblock
-#: ../scripts/origtargz.pl:126
+#: ../scripts/origtargz.pl:130
msgid "Always unpack the orig tarball."
msgstr "entpackt immer den Original-Tarball."
#. type: textblock
-#: ../scripts/origtargz.pl:132
+#: ../scripts/origtargz.pl:136
msgid "Alias for B<--unpack=no>."
msgstr "Alias für B<--unpack=no>"
#. type: =item
-#: ../scripts/origtargz.pl:134
+#: ../scripts/origtargz.pl:138
msgid "B<-t>, B<--tar-only>"
msgstr "B<-t>, B<--tar-only>"
#. type: textblock
-#: ../scripts/origtargz.pl:136
+#: ../scripts/origtargz.pl:140
msgid ""
"When using B<apt-get source>, pass B<--tar-only> to it. The default is to "
"download the full source package including F<.dsc> and F<.diff.gz> or F<."
@@ -19042,12 +19050,12 @@ msgstr ""
"Datei heruntergeladen."
#. type: =item
-#: ../scripts/origtargz.pl:141
+#: ../scripts/origtargz.pl:145
msgid "B<--clean>"
msgstr "B<--clean>"
#. type: textblock
-#: ../scripts/origtargz.pl:143
+#: ../scripts/origtargz.pl:147
msgid ""
"Remove existing files as with B<--unpack>. Note that like B<--unpack>, this "
"will remove upstream files even if they are stored in VCS."
@@ -19057,7 +19065,7 @@ msgstr ""
"gespeichert sind."
#. type: textblock
-#: ../scripts/origtargz.pl:160
+#: ../scripts/origtargz.pl:164
msgid ""
"B<debcheckout>(1), B<gbp-import-orig>(1), B<pristine-tar>(1), B<svn-"
"upgrade>(1), B<uupdate>(1)"
@@ -19066,7 +19074,7 @@ msgstr ""
"upgrade>(1), B<uupdate>(1)"
#. type: textblock
-#: ../scripts/origtargz.pl:164
+#: ../scripts/origtargz.pl:168
msgid ""
"B<origtargz> and this manpage have been written by Christoph Berg "
"<I<myon@debian.org>>."
diff --git a/po4a/po/devscripts.pot b/po4a/po/devscripts.pot
index 3b75454..5e16cc6 100644
--- a/po4a/po/devscripts.pot
+++ b/po4a/po/devscripts.pot
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2020-11-28 06:44+0100\n"
+"POT-Creation-Date: 2021-02-16 17:47+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -214,7 +214,7 @@ msgstr ""
#: ../scripts/ltnu.pod:27 ../scripts/manpage-alert.1:12
#: ../scripts/mass-bug.pl:59 ../scripts/mk-build-deps.pl:44
#: ../scripts/mk-origtargz.pl:64 ../scripts/nmudiff.1:24
-#: ../scripts/origtargz.pl:96 ../scripts/plotchangelog.1:43
+#: ../scripts/origtargz.pl:100 ../scripts/plotchangelog.1:43
#: ../scripts/pts-subscribe.1:18 ../scripts/rc-alert.1:17
#: ../scripts/rmadison.pl:278 ../scripts/sadt.pod:42 ../scripts/salsa.pl:409
#: ../doc/suspicious-source.1:34 ../scripts/tagpending.pl:94
@@ -332,7 +332,7 @@ msgstr ""
#: ../scripts/grep-excuses.1:58 ../scripts/hardening-check.pl:676
#: ../scripts/list-unreleased.1:19 ../scripts/ltnu.pod:105
#: ../scripts/mk-origtargz.pl:209 ../scripts/nmudiff.1:121
-#: ../scripts/origtargz.pl:158 ../scripts/plotchangelog.1:124
+#: ../scripts/origtargz.pl:162 ../scripts/plotchangelog.1:124
#: ../scripts/pts-subscribe.1:51 ../scripts/rc-alert.1:121
#: ../scripts/rmadison.pl:399 ../scripts/sadt.pod:69 ../scripts/salsa.pl:852
#: ../scripts/tagpending.pl:149 ../scripts/uscan.pl:2101
@@ -383,7 +383,7 @@ msgstr ""
#: ../scripts/manpage-alert.1:28 ../scripts/mass-bug.pl:566
#: ../scripts/mergechanges.1:28 ../scripts/mk-build-deps.pl:141
#: ../scripts/mk-origtargz.pl:213 ../scripts/namecheck.pl:24
-#: ../scripts/nmudiff.1:125 ../scripts/origtargz.pl:162
+#: ../scripts/nmudiff.1:125 ../scripts/origtargz.pl:166
#: ../scripts/plotchangelog.1:126 ../scripts/pts-subscribe.1:56
#: ../scripts/rc-alert.1:125 ../scripts/rmadison.pl:403 ../scripts/salsa.pl:856
#: ../scripts/svnpath.pl:96 ../scripts/transition-check.pl:81
@@ -4102,7 +4102,7 @@ msgid ""
msgstr ""
#. type: =head1
-#: ../scripts/cowpoke.1:369 ../scripts/origtargz.pl:81
+#: ../scripts/cowpoke.1:369 ../scripts/origtargz.pl:85
#: ../scripts/rmadison.pl:391
#, no-wrap
msgid "NOTES"
@@ -11165,7 +11165,8 @@ msgstr ""
#: ../doc/devscripts.1:79
msgid ""
"A script that provided a .buildinfo file reports the instructions on how to "
-"try to reproduce the reported build."
+"try to reproduce the reported build. [sbuild | mmdebstrap, "
+"libdistro-info-perl]"
msgstr ""
#. type: IP
@@ -11900,7 +11901,7 @@ msgid "Suppress B<wget>/B<curl> non-error output."
msgstr ""
#. type: =item
-#: ../scripts/dget.pl:636 ../scripts/origtargz.pl:130
+#: ../scripts/dget.pl:636 ../scripts/origtargz.pl:134
msgid "B<-d>, B<--download-only>"
msgstr ""
@@ -15087,7 +15088,7 @@ msgstr ""
#. type: =item
#: ../scripts/origtargz.pl:47 ../scripts/origtargz.pl:51
#: ../scripts/origtargz.pl:55 ../scripts/origtargz.pl:59
-#: ../scripts/origtargz.pl:63
+#: ../scripts/origtargz.pl:63 ../scripts/origtargz.pl:67
msgid "*"
msgstr ""
@@ -15108,18 +15109,23 @@ msgstr ""
#. type: textblock
#: ../scripts/origtargz.pl:61
+msgid "B<pristine-lfs> is tried."
+msgstr ""
+
+#. type: textblock
+#: ../scripts/origtargz.pl:65
msgid ""
"B<apt-get source> is tried when B<apt-cache showsrc> reports a matching "
"version."
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:65
+#: ../scripts/origtargz.pl:69
msgid "Finally, B<uscan --download --download-current-version> is tried."
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:69
+#: ../scripts/origtargz.pl:73
msgid ""
"When asked to unpack the orig tarball, B<origtargz> will remove all files "
"and directories from the current directory, except the debian directory, and "
@@ -15132,21 +15138,21 @@ msgid ""
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:78
+#: ../scripts/origtargz.pl:82
msgid ""
"The default behavior is to unpack the orig tarball if the current directory "
"is empty except for a F<debian> directory and the VCS files mentioned above."
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:83
+#: ../scripts/origtargz.pl:87
msgid ""
"Despite B<origtargz> being called \"targz\", it will work with any "
"compression scheme used for the tarball."
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:86
+#: ../scripts/origtargz.pl:90
msgid ""
"A similar tool to unpack orig tarballs is B<uupdate>(1). B<uupdate> creates "
"a new working directory, unpacks the tarball, and applies the Debian "
@@ -15155,7 +15161,7 @@ msgid ""
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:91
+#: ../scripts/origtargz.pl:95
msgid ""
"For Debian package repositories that keep the full upstream source, other "
"tools should be used to upgrade the repository from the new tarball. See "
@@ -15164,12 +15170,12 @@ msgid ""
msgstr ""
#. type: =item
-#: ../scripts/origtargz.pl:100
+#: ../scripts/origtargz.pl:104
msgid "B<-p>, B<--path> I<directory>"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:102
+#: ../scripts/origtargz.pl:106
msgid ""
"Add I<directory> to the list of locations to search for an existing "
"tarball. When found, a hardlink is created if possible, otherwise a "
@@ -15177,12 +15183,12 @@ msgid ""
msgstr ""
#. type: =item
-#: ../scripts/origtargz.pl:105
+#: ../scripts/origtargz.pl:109
msgid "B<-u>, B<--unpack>[=B<no>|B<once>|B<yes>]"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:107
+#: ../scripts/origtargz.pl:111
msgid ""
"Unpack the downloaded orig tarball to the current directory, replacing "
"everything except the debian directory. Existing files are removed, except "
@@ -15192,49 +15198,49 @@ msgid ""
msgstr ""
#. type: =item
-#: ../scripts/origtargz.pl:115
+#: ../scripts/origtargz.pl:119
msgid "B<no>"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:117
+#: ../scripts/origtargz.pl:121
msgid "Do not unpack the orig tarball."
msgstr ""
#. type: =item
-#: ../scripts/origtargz.pl:119
+#: ../scripts/origtargz.pl:123
msgid "B<once> (default when B<--unpack> is not used)"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:121
+#: ../scripts/origtargz.pl:125
msgid ""
"If the current directory contains only a F<debian> directory (and possibly "
"some dotfiles), unpack the orig tarball. This is the default behavior."
msgstr ""
#. type: =item
-#: ../scripts/origtargz.pl:124
+#: ../scripts/origtargz.pl:128
msgid "B<yes> (default for B<--unpack> without argument)"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:126
+#: ../scripts/origtargz.pl:130
msgid "Always unpack the orig tarball."
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:132
+#: ../scripts/origtargz.pl:136
msgid "Alias for B<--unpack=no>."
msgstr ""
#. type: =item
-#: ../scripts/origtargz.pl:134
+#: ../scripts/origtargz.pl:138
msgid "B<-t>, B<--tar-only>"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:136
+#: ../scripts/origtargz.pl:140
msgid ""
"When using B<apt-get source>, pass B<--tar-only> to it. The default is to "
"download the full source package including F<.dsc> and F<.diff.gz> or "
@@ -15244,26 +15250,26 @@ msgid ""
msgstr ""
#. type: =item
-#: ../scripts/origtargz.pl:141
+#: ../scripts/origtargz.pl:145
msgid "B<--clean>"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:143
+#: ../scripts/origtargz.pl:147
msgid ""
"Remove existing files as with B<--unpack>. Note that like B<--unpack>, this "
"will remove upstream files even if they are stored in VCS."
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:160
+#: ../scripts/origtargz.pl:164
msgid ""
"B<debcheckout>(1), B<gbp-import-orig>(1), B<pristine-tar>(1), "
"B<svn-upgrade>(1), B<uupdate>(1)"
msgstr ""
#. type: textblock
-#: ../scripts/origtargz.pl:164
+#: ../scripts/origtargz.pl:168
msgid ""
"B<origtargz> and this manpage have been written by Christoph Berg "
"<I<myon@debian.org>>."
diff --git a/po4a/po/fr.po b/po4a/po/fr.po
index f5133ff..c788582 100644
--- a/po4a/po/fr.po
+++ b/po4a/po/fr.po
@@ -14,7 +14,7 @@
msgid ""
msgstr ""
"Project-Id-Version: devscripts\n"
-"POT-Creation-Date: 2020-11-28 06:44+0100\n"
+"POT-Creation-Date: 2021-02-16 17:47+0100\n"
"PO-Revision-Date: 2020-11-28 06:46+0100\n"
"Last-Translator: Xavier Guimard <yadd@debian.org>\n"
"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
@@ -227,7 +227,7 @@ msgstr ""
#: ../scripts/ltnu.pod:27 ../scripts/manpage-alert.1:12
#: ../scripts/mass-bug.pl:59 ../scripts/mk-build-deps.pl:44
#: ../scripts/mk-origtargz.pl:64 ../scripts/nmudiff.1:24
-#: ../scripts/origtargz.pl:96 ../scripts/plotchangelog.1:43
+#: ../scripts/origtargz.pl:100 ../scripts/plotchangelog.1:43
#: ../scripts/pts-subscribe.1:18 ../scripts/rc-alert.1:17
#: ../scripts/rmadison.pl:278 ../scripts/sadt.pod:42 ../scripts/salsa.pl:409
#: ../doc/suspicious-source.1:34 ../scripts/tagpending.pl:94
@@ -368,7 +368,7 @@ msgstr ""
#: ../scripts/grep-excuses.1:58 ../scripts/hardening-check.pl:676
#: ../scripts/list-unreleased.1:19 ../scripts/ltnu.pod:105
#: ../scripts/mk-origtargz.pl:209 ../scripts/nmudiff.1:121
-#: ../scripts/origtargz.pl:158 ../scripts/plotchangelog.1:124
+#: ../scripts/origtargz.pl:162 ../scripts/plotchangelog.1:124
#: ../scripts/pts-subscribe.1:51 ../scripts/rc-alert.1:121
#: ../scripts/rmadison.pl:399 ../scripts/sadt.pod:69 ../scripts/salsa.pl:852
#: ../scripts/tagpending.pl:149 ../scripts/uscan.pl:2101
@@ -422,7 +422,7 @@ msgstr ""
#: ../scripts/manpage-alert.1:28 ../scripts/mass-bug.pl:566
#: ../scripts/mergechanges.1:28 ../scripts/mk-build-deps.pl:141
#: ../scripts/mk-origtargz.pl:213 ../scripts/namecheck.pl:24
-#: ../scripts/nmudiff.1:125 ../scripts/origtargz.pl:162
+#: ../scripts/nmudiff.1:125 ../scripts/origtargz.pl:166
#: ../scripts/plotchangelog.1:126 ../scripts/pts-subscribe.1:56
#: ../scripts/rc-alert.1:125 ../scripts/rmadison.pl:403 ../scripts/salsa.pl:856
#: ../scripts/svnpath.pl:96 ../scripts/transition-check.pl:81
@@ -5040,7 +5040,7 @@ msgstr ""
"mise à jour (ou la création) de la racine de construction."
#. type: =head1
-#: ../scripts/cowpoke.1:369 ../scripts/origtargz.pl:81
+#: ../scripts/cowpoke.1:369 ../scripts/origtargz.pl:85
#: ../scripts/rmadison.pl:391
#, no-wrap
msgid "NOTES"
@@ -13983,9 +13983,14 @@ msgstr "I<debrebuild>(1)"
#. type: Plain text
#: ../doc/devscripts.1:79
+#, fuzzy
+#| msgid ""
+#| "A script that provided a .buildinfo file reports the instructions on how "
+#| "to try to reproduce the reported build."
msgid ""
"A script that provided a .buildinfo file reports the instructions on how to "
-"try to reproduce the reported build."
+"try to reproduce the reported build. [sbuild | mmdebstrap, libdistro-info-"
+"perl]"
msgstr ""
"Un script qui fournit un fichier .buildinfo expose les instructions pour "
"reproduire la construction à l'identique."
@@ -14888,7 +14893,7 @@ msgid "Suppress B<wget>/B<curl> non-error output."
msgstr "Supprimer la sortie de B<wget>/B<curl> (sauf les erreurs)."
#. type: =item
-#: ../scripts/dget.pl:636 ../scripts/origtargz.pl:130
+#: ../scripts/dget.pl:636 ../scripts/origtargz.pl:134
msgid "B<-d>, B<--download-only>"
msgstr "B<-d>, B<--download-only>"
@@ -18828,7 +18833,7 @@ msgstr "Plusieurs emplacements de téléchargement sont essayés :"
#. type: =item
#: ../scripts/origtargz.pl:47 ../scripts/origtargz.pl:51
#: ../scripts/origtargz.pl:55 ../scripts/origtargz.pl:59
-#: ../scripts/origtargz.pl:63
+#: ../scripts/origtargz.pl:63 ../scripts/origtargz.pl:67
msgid "*"
msgstr "*"
@@ -18849,6 +18854,13 @@ msgstr "B<pristine-tar> est essayé ."
#. type: textblock
#: ../scripts/origtargz.pl:61
+#, fuzzy
+#| msgid "B<pristine-tar> is tried."
+msgid "B<pristine-lfs> is tried."
+msgstr "B<pristine-tar> est essayé ."
+
+#. type: textblock
+#: ../scripts/origtargz.pl:65
msgid ""
"B<apt-get source> is tried when B<apt-cache showsrc> reports a matching "
"version."
@@ -18857,12 +18869,12 @@ msgstr ""
"correspondante."
#. type: textblock
-#: ../scripts/origtargz.pl:65
+#: ../scripts/origtargz.pl:69
msgid "Finally, B<uscan --download --download-current-version> is tried."
msgstr "Enfin, B<uscan --download --download-current-version> est essayé."
#. type: textblock
-#: ../scripts/origtargz.pl:69
+#: ../scripts/origtargz.pl:73
msgid ""
"When asked to unpack the orig tarball, B<origtargz> will remove all files "
"and directories from the current directory, except the debian directory, and "
@@ -18885,7 +18897,7 @@ msgstr ""
"hgignore>) s'ils sont gardés dans le système de contrôle de versions."
#. type: textblock
-#: ../scripts/origtargz.pl:78
+#: ../scripts/origtargz.pl:82
msgid ""
"The default behavior is to unpack the orig tarball if the current directory "
"is empty except for a F<debian> directory and the VCS files mentioned above."
@@ -18895,7 +18907,7 @@ msgstr ""
"système de contrôle de versions mentionnés plus haut."
#. type: textblock
-#: ../scripts/origtargz.pl:83
+#: ../scripts/origtargz.pl:87
msgid ""
"Despite B<origtargz> being called \"targz\", it will work with any "
"compression scheme used for the tarball."
@@ -18904,7 +18916,7 @@ msgstr ""
"compression utilisé pour l'archive amont."
#. type: textblock
-#: ../scripts/origtargz.pl:86
+#: ../scripts/origtargz.pl:90
msgid ""
"A similar tool to unpack orig tarballs is B<uupdate>(1). B<uupdate> creates "
"a new working directory, unpacks the tarball, and applies the Debian F<.diff."
@@ -18918,7 +18930,7 @@ msgstr ""
"gestion de versions."
#. type: textblock
-#: ../scripts/origtargz.pl:91
+#: ../scripts/origtargz.pl:95
msgid ""
"For Debian package repositories that keep the full upstream source, other "
"tools should be used to upgrade the repository from the new tarball. See "
@@ -18932,12 +18944,12 @@ msgstr ""
"l'archive amont actuelle."
#. type: =item
-#: ../scripts/origtargz.pl:100
+#: ../scripts/origtargz.pl:104
msgid "B<-p>, B<--path> I<directory>"
msgstr "B<-p>, B<--path> I<répertoire>"
#. type: textblock
-#: ../scripts/origtargz.pl:102
+#: ../scripts/origtargz.pl:106
msgid ""
"Add I<directory> to the list of locations to search for an existing "
"tarball. When found, a hardlink is created if possible, otherwise a symlink."
@@ -18947,12 +18959,12 @@ msgstr ""
"symbolique sinon."
#. type: =item
-#: ../scripts/origtargz.pl:105
+#: ../scripts/origtargz.pl:109
msgid "B<-u>, B<--unpack>[=B<no>|B<once>|B<yes>]"
msgstr "B<-u>, B<--unpack>[=B<no>|B<once>|B<yes>]"
#. type: textblock
-#: ../scripts/origtargz.pl:107
+#: ../scripts/origtargz.pl:111
msgid ""
"Unpack the downloaded orig tarball to the current directory, replacing "
"everything except the debian directory. Existing files are removed, except "
@@ -18968,22 +18980,22 @@ msgstr ""
"svn>."
#. type: =item
-#: ../scripts/origtargz.pl:115
+#: ../scripts/origtargz.pl:119
msgid "B<no>"
msgstr "B<no>"
#. type: textblock
-#: ../scripts/origtargz.pl:117
+#: ../scripts/origtargz.pl:121
msgid "Do not unpack the orig tarball."
msgstr "Ne pas dépaqueter l'archive amont."
#. type: =item
-#: ../scripts/origtargz.pl:119
+#: ../scripts/origtargz.pl:123
msgid "B<once> (default when B<--unpack> is not used)"
msgstr "B<once> (par défaut si B<--unpack> n'est pas utilisé)"
#. type: textblock
-#: ../scripts/origtargz.pl:121
+#: ../scripts/origtargz.pl:125
msgid ""
"If the current directory contains only a F<debian> directory (and possibly "
"some dotfiles), unpack the orig tarball. This is the default behavior."
@@ -18993,27 +19005,27 @@ msgstr ""
"le comportement par défaut."
#. type: =item
-#: ../scripts/origtargz.pl:124
+#: ../scripts/origtargz.pl:128
msgid "B<yes> (default for B<--unpack> without argument)"
msgstr "B<yes> (par défaut si B<--unpack> est utilisé sans paramètre)"
#. type: textblock
-#: ../scripts/origtargz.pl:126
+#: ../scripts/origtargz.pl:130
msgid "Always unpack the orig tarball."
msgstr "Toujours dépaqueter l'archive amont."
#. type: textblock
-#: ../scripts/origtargz.pl:132
+#: ../scripts/origtargz.pl:136
msgid "Alias for B<--unpack=no>."
msgstr "Identique à B<--unpack=no>."
#. type: =item
-#: ../scripts/origtargz.pl:134
+#: ../scripts/origtargz.pl:138
msgid "B<-t>, B<--tar-only>"
msgstr "B<-t>, B<--tar-only>"
#. type: textblock
-#: ../scripts/origtargz.pl:136
+#: ../scripts/origtargz.pl:140
msgid ""
"When using B<apt-get source>, pass B<--tar-only> to it. The default is to "
"download the full source package including F<.dsc> and F<.diff.gz> or F<."
@@ -19027,12 +19039,12 @@ msgstr ""
"le fichier F<.orig.tar.*> est téléchargé."
#. type: =item
-#: ../scripts/origtargz.pl:141
+#: ../scripts/origtargz.pl:145
msgid "B<--clean>"
msgstr "B<--clean>"
#. type: textblock
-#: ../scripts/origtargz.pl:143
+#: ../scripts/origtargz.pl:147
msgid ""
"Remove existing files as with B<--unpack>. Note that like B<--unpack>, this "
"will remove upstream files even if they are stored in VCS."
@@ -19042,7 +19054,7 @@ msgstr ""
"dans un système de contrôle de versions."
#. type: textblock
-#: ../scripts/origtargz.pl:160
+#: ../scripts/origtargz.pl:164
msgid ""
"B<debcheckout>(1), B<gbp-import-orig>(1), B<pristine-tar>(1), B<svn-"
"upgrade>(1), B<uupdate>(1)"
@@ -19051,7 +19063,7 @@ msgstr ""
"upgrade>(1), B<uupdate>(1)"
#. type: textblock
-#: ../scripts/origtargz.pl:164
+#: ../scripts/origtargz.pl:168
msgid ""
"B<origtargz> and this manpage have been written by Christoph Berg "
"<I<myon@debian.org>>."
diff --git a/scripts/Makefile b/scripts/Makefile
index df1cce2..6412b26 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -44,6 +44,7 @@ PKGNAMES := \
GEN_MAN1S += \
deb-why-removed.1 \
debbisect.1 \
+ debrebuild.1 \
debrepro.1 \
ltnu.1 \
mk-origtargz.1 \
@@ -108,6 +109,14 @@ debbisect.1: debbisect
--no-discard-stderr \
./$< >$@
+debrebuild.1: debrebuild
+ help2man \
+ --name="use a buildinfo file and snapshot.d.o to recreate binary packages" \
+ --version-string=$(VERSION) \
+ --no-info \
+ --no-discard-stderr \
+ ./$< >$@
+
reproducible-check.1: reproducible-check
help2man \
--name="Reports on the reproducible status of installed packages" \
@@ -147,7 +156,7 @@ install: all
install -d $(DESTDIR)$(DATA_DIR)
mv $(DESTDIR)$(BINDIR)/debpkg $(DESTDIR)$(DATA_DIR)
cp debpkg-wrapper $(DESTDIR)$(BINDIR)/debpkg
- mv $(DESTDIR)$(BINDIR)/run_bisect $(DESTDIR)$(DATA_DIR)
- mv $(DESTDIR)$(BINDIR)/run_bisect_qemu $(DESTDIR)$(DATA_DIR)
+ mv $(DESTDIR)$(BINDIR)/run_bisect $(DESTDIR)$(DATA_DIR)/scripts
+ mv $(DESTDIR)$(BINDIR)/run_bisect_qemu $(DESTDIR)$(DATA_DIR)/scripts
.PHONY: test test_pl test_sh test_py all install clean scripts
diff --git a/scripts/debbisect b/scripts/debbisect
index f99b903..5d70343 100755
--- a/scripts/debbisect
+++ b/scripts/debbisect
@@ -173,7 +173,13 @@ class Proxy(http.server.SimpleHTTPRequestHandler):
req = urllib.request.Request(
"http://snapshot.debian.org/" + self.path, headers=headers
)
- with urllib.request.urlopen(req) as f, open(path, "ab") as out:
+ # we use os.fdopen(os.open(...)) because we don't want to
+ # truncate the file and seek to the right position but also
+ # create it if it doesn't exist yet
+ with urllib.request.urlopen(req) as f, os.fdopen(
+ os.open(path, os.O_RDWR | os.O_CREAT), "rb+"
+ ) as out:
+ out.seek(downloaded)
if trynum == 0:
self.send_header("Content-type", f.headers["Content-type"])
self.send_header("Content-Length", f.headers["Content-Length"])
@@ -185,12 +191,18 @@ class Proxy(http.server.SimpleHTTPRequestHandler):
if totalsize - downloaded < chunksize:
chunksize = totalsize - downloaded
buf = f.read(chunksize) # 800 kB/s
- assert len(buf) == chunksize, (
- len(buf),
- chunksize,
- totalsize,
- downloaded,
- )
+ if len(buf) != chunksize:
+ # something went wrong
+ logging.warning(
+ "%s: wanted %d but got %d bytes (try %d of %d)",
+ path,
+ chunksize,
+ len(buf),
+ trynum + 1,
+ maxtries,
+ )
+ time.sleep(10)
+ break
time.sleep(1) # snapshot.d.o needs heavy throttling
out.write(buf)
self.wfile.write(buf)
@@ -353,6 +365,7 @@ def runtest(timestamp, staticargs, toupgrade=None, badtimestamp=None):
env = {
"DEBIAN_BISECT_EPOCH": "%d" % int(timestamp.timestamp()),
"DEBIAN_BISECT_TIMESTAMP": timestamp.strftime("%Y%m%dT%H%M%SZ"),
+ "PATH": os.environ.get("PATH", "/usr/sbin:/usr/bin:/sbin:/bin"),
}
if staticargs.port is not None:
env["DEBIAN_BISECT_MIRROR"] = goodmirror
@@ -428,11 +441,11 @@ def write_log_symlink(goodbad, output, timestamp, toupgrade=None):
with open(fname, "wb") as f:
f.write(output)
if goodbad == "good":
- if os.path.exists("debbisect.log.good"):
+ if os.path.lexists("debbisect.log.good"):
os.unlink("debbisect.log.good")
os.symlink(fname, "debbisect.log.good")
elif goodbad == "bad":
- if os.path.exists("debbisect.log.bad"):
+ if os.path.lexists("debbisect.log.bad"):
os.unlink("debbisect.log.bad")
os.symlink(fname, "debbisect.log.bad")
diff --git a/scripts/debchange.pl b/scripts/debchange.pl
index 854c515..62ed69b 100755
--- a/scripts/debchange.pl
+++ b/scripts/debchange.pl
@@ -842,12 +842,21 @@ if (!$opt_m and !$opt_M) {
} elsif (exists $env{'EMAIL'}) {
$EMAIL = $env{'EMAIL'};
} else {
+ warn
+"$progname warning: neither DEBEMAIL nor EMAIL environment variable is set\n";
+ $warnings++;
my $addr;
if (open MAILNAME, '/etc/mailname') {
+ warn
+"$progname warning: building email address from username and mailname\n";
+ $warnings++;
chomp($addr = <MAILNAME>);
close MAILNAME;
}
if (!$addr) {
+ warn
+"$progname warning: building email address from username and FQDN\n";
+ $warnings++;
chomp($addr = `hostname --fqdn 2>/dev/null`);
$addr = undef if $?;
}
diff --git a/scripts/debclean.sh b/scripts/debclean.sh
index 903b80b..200bf89 100755
--- a/scripts/debclean.sh
+++ b/scripts/debclean.sh
@@ -81,7 +81,7 @@ else
[ -r $file ] && . $file
done
- set | egrep '^(DEBCLEAN|DEVSCRIPTS)_')
+ set | grep -E '^(DEBCLEAN|DEVSCRIPTS)_')
# check sanity
case "$DEBCLEAN_CLEANDEBS" in
@@ -163,7 +163,7 @@ fi
OPWD="`pwd`"
-TESTDIR=$(echo $OPWD | egrep -o '.*/debian/?' | sed 's/\/debian\/\?$//')
+TESTDIR=$(echo $OPWD | grep -Eo '.*/debian/?' | sed 's/\/debian\/\?$//')
if [ -f debian/changelog ]; then
directories=$OPWD
diff --git a/scripts/debrebuild.pl b/scripts/debrebuild.pl
index 27f8f22..78c5c4b 100755
--- a/scripts/debrebuild.pl
+++ b/scripts/debrebuild.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# Copyright © 2014-2016 Johannes Schauer <j.schauer@email.de>
+# Copyright © 2014-2020 Johannes Schauer <j.schauer@email.de>
# Copyright © 2020 Niels Thykier <niels@thykier.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,42 +25,71 @@ use Dpkg::Deps;
use Dpkg::Source::Package;
use File::Temp qw(tempdir);
use File::Path qw(make_path);
+use File::HomeDir;
use JSON::PP;
use Time::Piece;
use File::Basename;
+use List::Util qw(any none);
-eval {
- require LWP::Simple;
- require LWP::UserAgent;
- no warnings;
- $LWP::Simple::ua = LWP::UserAgent->new(agent => 'LWP::UserAgent/srebuild');
- $LWP::Simple::ua->env_proxy();
-};
-if ($@) {
- if ($@ =~ m/Can\'t locate LWP/) {
- die "Unable to run: the libwww-perl package is not installed";
- } else {
- die "Unable to run: Couldn't load LWP::Simple: $@";
+my $progname;
+
+BEGIN {
+ $progname = basename($0);
+ eval { require String::ShellQuote; };
+ if ($@) {
+ if ($@ =~ /^Can\'t locate String\/ShellQuote\.pm/) {
+ die
+"$progname: you must have the libstring-shellquote-perl package installed\n"
+ . "to use this script";
+ } else {
+ die
+"$progname: problem loading the String::ShellQuote module:\n $@\n"
+ . "Have you installed the libstring-shellquote-perl package?";
+ }
}
+
+ eval {
+ require LWP::Simple;
+ require LWP::UserAgent;
+ require URI::Escape; # libwww-perl depends on liburi-perl
+ no warnings;
+ $LWP::Simple::ua
+ = LWP::UserAgent->new(agent => 'LWP::UserAgent/debrebuild');
+ $LWP::Simple::ua->env_proxy();
+ };
+ if ($@) {
+ if ($@ =~ m/Can\'t locate LWP/) {
+ die "$progname: you must have the libwww-perl package installed\n"
+ . "to use this script";
+ } else {
+ die "$progname: problem loading the LWP and URI modules:\n $@\n"
+ . "Have you installed the libwww-perl package?";
+ }
+ }
+
}
my $respect_build_path = 1;
my $use_tor = 0;
-my $apt_tor_prefix = '';
+my $outdir = './';
+my $builder = 'none';
+my $timestamp = '';
my %OPTIONS = (
'help|h' => sub { usage(0); },
'use-tor-proxy!' => \$use_tor,
'respect-build-path!' => \$respect_build_path,
+ 'buildresult=s' => \$outdir,
+ 'builder=s' => \$builder,
+ 'timestamp|t=s' => \$timestamp,
);
sub usage {
my ($exit_code) = @_;
- my $me = basename($0);
$exit_code //= 0;
print <<EOF;
-Usage: $me [--no-respect-build-path] <buildinfo>
- $me <--help|-h>
+Usage: $progname [options] <buildinfo>
+ $progname <--help|-h>
Given a buildinfo file from a Debian package, generate instructions for
attempting to reproduce the binary packages built from the associated source
@@ -72,11 +101,74 @@ Options:
Assumes "apt-transport-tor" is installed both in host + chroot
--[no-]respect-build-path Whether to setup the build to use the Build-Path from the
provided .buildinfo file.
-
-Note: $me can parse buildinfo files with and without a GPG signature. However,
+ --buildresults Directory for the build artifacts (default: ./)
+ --builder=BUILDER Which building software should be used. Possible values are
+ none, sbuild, mmdebstrap, dpkg and sbuild+unshare. The default
+ is none. See section BUILDER for details.
+ --timestamp, -t The required unstable main timestamps from snapshot.d.o if you
+ already know them, separated by commas, or one of the values
+ "first_seen" or "metasnap". See section TIMESTAMPS.
+
+Note: $progname can parse buildinfo files with and without a GPG signature. However,
the signature (if present) is discarded as debrebuild does not support verifying
it. If the authenticity or integrity of the buildinfo files are important to
-you, checking these need to be done before invoking $me.
+you, checking these need to be done before invoking $progname, for example by using
+dscverify.
+
+EXAMPLES
+
+ \$ $progname --buildresults=./artifacts --builder=mmdebstrap hello_2.10-2_amd64.buildinfo
+
+BUILDERS
+
+debrebuild can use different backends to perform the actual package rebuild.
+The desired backend is chosen using the --builder option. The default is
+"none".
+
+ none Dry-run mode. No build is performed.
+ sbuild Use sbuild to build the package. This requires sbuild to be
+ setup with schroot chroots of Debian stable distributions.
+ mmdebstrap Use mmdebstrap to build the package. This requires no
+ setup and no superuser privileges.
+ dpkg Directly run apt-get and dpkg-buildpackage on the current
+ system without chroot. This requires root privileges.
+ sbuild+unshare Use sbuild with the unshare backend. This will create the
+ chroot and perform the build without superuser privileges
+ and without any setup.
+
+TIMESTAMPS
+
+The --timestamp option allows one to skip the step of figuring out the correct
+set of required timestamps by listing them separated by commas in the same
+format used in the snapshot.d.o URL. The default is to use the "first_seen"
+attribute from the snapshot.d.o API and download multiple Packages files until
+all required timestamps are found. To explicitly select this mode, use
+--timestamp=first_seen. Lastly, the metasnap.d.n service can be used to figure
+out the right set of timestamps. This mode can be selected by using
+--timestamp=metasnap. In contrast to the "first_seen" mode, the metasnap.d.n
+service will always return a minimal set of timestamps if the package versions
+were at some point part of Debian unstable main.
+
+UNSHARE
+
+Before kernel 5.10.1 or before Debian 11 (Bullseye), unprivileged user
+namespaces were disabled in Debian for security reasons. Refer to Debian bug
+#898446 for details. To enable user namespaces, run:
+
+ \$ sudo sysctl -w kernel.unprivileged_userns_clone=1
+
+The sbuild+unshare builder requires and the mmdebstrap builder benefits from
+having unprivileged user namespaces activated. On Ubuntu they are enabled by
+default.
+
+LIMITATIONS
+
+Currently, the code assumes that all packages were at some point part of Debian
+unstable main. This fails for packages from Debian ports, packages from
+experimental as well as for locally built packages or packages from third
+party repositories. Enabling support for Debian ports and experimental is
+conceptually possible and only needs somebody implementing it.
+
EOF
exit($exit_code);
@@ -106,8 +198,9 @@ if (@ARGV) {
usage(1);
}
+my $base_mirror = "http://snapshot.debian.org/archive/debian";
if ($use_tor) {
- $apt_tor_prefix = 'tor+';
+ $base_mirror = "tor+http://snapshot.debian.org/archive/debian";
eval {
$LWP::Simple::ua->proxy([qw(http https)] => 'socks://127.0.0.1:9050');
};
@@ -125,7 +218,7 @@ if ($use_tor) {
my $cdata = Dpkg::Control->new(type => CTRL_FILE_BUILDINFO, allow_pgp => 1);
if (not $cdata->load($buildinfo)) {
- die "cannot load $buildinfo";
+ die "cannot load $buildinfo\n";
}
if ($cdata->get_option('is_pgp_signed')) {
@@ -140,21 +233,61 @@ my $build_source = (scalar(grep /^source$/, @architectures)) == 1;
my $build_archall = (scalar(grep /^all$/, @architectures)) == 1;
@architectures = grep { !/^source$/ && !/^all$/ } @architectures;
if (scalar @architectures > 1) {
- die "more than one architecture in Architecture field";
+ die "more than one architecture in Architecture field\n";
}
my $build_archany = (scalar @architectures) == 1;
-my $host_arch = undef;
-if ($build_archany) {
- $host_arch = $architectures[0];
-}
my $build_arch = $cdata->{"Build-Architecture"};
if (not defined($build_arch)) {
- die "need Build-Architecture field";
+ die "need Build-Architecture field\n";
}
+my $host_arch = $cdata->{"Host-Architecture"};
+if (not defined($host_arch)) {
+ $host_arch = $build_arch;
+}
+
+my $srcpkgname = $cdata->{Source};
+my $srcpkgver = $cdata->{Version};
+my $srcpkgbinver
+ = $cdata->{Version}; # this version will include the binmu suffix
+if ($srcpkgname =~ / /) {
+ # In some cases such as binNMUs, the source field contains a version in
+ # the form:
+ # mscgen (0.20)
+ ($srcpkgname, $srcpkgver) = split / /, $srcpkgname, 2;
+ # Add a simple control check to avoid the worst surprises and stop obvious
+ # cases of garbage-in-garbage-out.
+ die("Unexpected source package name: ${srcpkgname}\n")
+ if $srcpkgname =~ m{[ \t_/\(\)<>!\n%&\$\#\@]};
+ # remove the surrounding parenthesis from the version
+ $srcpkgver =~ s/^\((.*)\)$/$1/;
+}
+
+my $new_buildinfo;
+{
+ my $arch;
+ if ($build_archany) {
+ $arch = $host_arch;
+ } elsif ($build_archall) {
+ $arch = 'all';
+ } else {
+ die "nothing to build\n";
+ }
+ $new_buildinfo = "$outdir/${srcpkgname}_${srcpkgbinver}_$arch.buildinfo";
+}
+if (-e $new_buildinfo) {
+ my ($dev1, $ino1) = (lstat $buildinfo)[0, 1]
+ or die "cannot lstat $buildinfo: $!\n";
+ my ($dev2, $ino2) = (lstat $new_buildinfo)[0, 1]
+ or die "cannot lstat $new_buildinfo: $!\n";
+ if ($dev1 == $dev2 && $ino1 == $ino2) {
+ die "refusing to overwrite the input buildinfo file\n";
+ }
+}
+
my $inst_build_deps = $cdata->{"Installed-Build-Depends"};
if (not defined($inst_build_deps)) {
- die "need Installed-Build-Depends field";
+ die "need Installed-Build-Depends field\n";
}
my $custom_build_path = $respect_build_path ? $cdata->{'Build-Path'} : undef;
@@ -184,41 +317,32 @@ qq{Build-Path must be a non-empty absolute path (i.e. start with "/").\n}
}
}
-sub extract_source {
- my ($source) = @_;
- # In some cases such as binNMUs, the source field contains a version in
- # the form:
- # mscgen (0.20)
- # This function strips the version leaving only the source package.
- $source =~ s/\s+\(.+\)\s*//;
- # Add a simple control check to avoid the worst surprises and stop obvious
- # cases of garbage-in-garbage-out.
- die("Unexpected source package name: ${source}\n")
- if $source =~ m{[ \t_/\(\)<>!\n%&\$\#\@]};
- return $source;
-}
-
my $srcpkg = Dpkg::Source::Package->new();
-$srcpkg->{fields}{'Source'} = extract_source($cdata->{"Source"});
-$srcpkg->{fields}{'Version'} = $cdata->{"Version"};
+$srcpkg->{fields}{'Source'} = $srcpkgname;
+$srcpkg->{fields}{'Version'} = $srcpkgver;
my $dsc_fname
= (dirname($buildinfo)) . '/' . $srcpkg->get_basename(1) . ".dsc";
my $environment = $cdata->{"Environment"};
if (not defined($environment)) {
- die "need Environment field";
+ die "need Environment field\n";
}
$environment =~ s/\n/ /g; # remove newlines
$environment =~ s/^ //; # remove leading whitespace
-my $checksums = Dpkg::Checksums->new();
-$checksums->add_from_control($cdata);
-my @files = $checksums->get_files();
+my @environment;
+foreach my $line (split /\n/, $cdata->{"Environment"}) {
+ chomp $line;
+ if ($line eq '') {
+ next;
+ }
+ my ($name, $val) = split /=/, $line, 2;
+ $val =~ s/^"(.*)"$/$1/;
+ push @environment, "$name=$val";
+}
# gather all installed build-depends and figure out the version of base-files
-# and dpkg
my $base_files_version;
-my $dpkg_version;
my @inst_build_deps = ();
$inst_build_deps
= deps_parse($inst_build_deps, reduce_arch => 0, build_dep => 0);
@@ -231,24 +355,18 @@ foreach my $pkg ($inst_build_deps->get_deps()) {
die "dependency disjunctions are not allowed\n";
}
if (not defined($pkg->{package})) {
- die "name undefined";
+ die "name undefined\n";
}
if (defined($pkg->{relation})) {
if ($pkg->{relation} ne "=") {
die "wrong relation";
}
if (not defined($pkg->{version})) {
- die "version undefined";
+ die "version undefined\n";
}
} else {
die "no version";
}
- if ($pkg->{package} eq "dpkg") {
- if (defined($dpkg_version)) {
- die "more than one dpkg\n";
- }
- $dpkg_version = $pkg->{version};
- }
if ($pkg->{package} eq "base-files") {
if (defined($base_files_version)) {
die "more than one base-files\n";
@@ -265,53 +383,147 @@ foreach my $pkg ($inst_build_deps->get_deps()) {
if (!defined($base_files_version)) {
die "no base-files\n";
}
-if (!defined($dpkg_version)) {
- die "no dpkg\n";
-}
-# figure out the debian release from the version of base-files and dpkg
-# FIXME - this really shouldn't be hardcoded here
+# figure out the debian release from the version of base-files
my $base_dist;
-my %base_files_map = (
- "6" => "squeeze",
- "7" => "wheezy",
- "8" => "jessie",
- "9" => "stretch",
- "10" => "buster",
- "11" => "bullseye",
- "12" => "bookworm",
-);
-my %dpkg_map = (
- "15" => "squeeze",
- "16" => "wheezy",
- "17" => "jessie",
- "18" => "stretch",
- "19" => "buster",
- "20" => "bullseye",
- "21" => "bookworm",
-);
+my %base_files_map = ();
+my $di_path = '/usr/share/distro-info/debian.csv';
+eval { require Debian::DistroInfo; };
+if (!$@) {
+ # libdistro-info-perl is installed
+ my $di = DebianDistroInfo->new();
+ foreach my $series ($di->all) {
+ if (!$di->version($series)) {
+ next;
+ }
+ $base_files_map{ $di->version($series) } = $series;
+ }
+} elsif (-f $di_path) {
+ # distro-info-data is installed
+ open my $fh, '<', $di_path or die "cannot open $di_path: $!\n";
+ my $i = 0;
+ while (my $line = <$fh>) {
+ chomp($line);
+ $i++;
+ my @cells = split /,/, $line;
+ if (scalar @cells < 4) {
+ die "cannot parse line $i of $di_path\n";
+ }
+ if (
+ $i == 1
+ and ( scalar @cells < 6
+ or $cells[0] ne 'version'
+ or $cells[1] ne 'codename'
+ or $cells[2] ne 'series'
+ or $cells[3] ne 'created'
+ or $cells[4] ne 'release'
+ or $cells[5] ne 'eol')
+ ) {
+ die "cannot find correct header in $di_path\n";
+ }
+ if ($i == 1) {
+ next;
+ }
+ $base_files_map{ $cells[0] } = $cells[2];
+ }
+ close $fh;
+} else {
+ # nothing is installed -- use hard-coded values
+ %base_files_map = (
+ "6" => "squeeze",
+ "7" => "wheezy",
+ "8" => "jessie",
+ "9" => "stretch",
+ "10" => "buster",
+ "11" => "bullseye",
+ "12" => "bookworm",
+ "13" => "trixie",
+ );
+}
$base_files_version =~ s/^(\d+).*/$1/;
-#$dpkg_version =~ s/1\.(\d+)\..*/$1/;
-$base_dist = $base_files_map{$base_files_version};
+# we subtract one from $base_files_version because we want the Debian release
+# before what is currently in unstable
+$base_dist = $base_files_map{ $base_files_version - 1 };
if (!defined $base_dist) {
- die "base-files version didn't map to any Debian release";
+ die "base-files version didn't map to any Debian release\n";
}
-#if ($base_dist ne $dpkg_map{$dpkg_version}) {
-# die "base-files and dpkg versions point to different Debian releases\n";
-#}
-
-# test if all checksums in the buildinfo file check out
+my $src_date;
+{
+ print "retrieving snapshot.d.o data for $srcpkgname $srcpkgver\n";
+ my $json_url
+ = "http://snapshot.debian.org/mr/package/$srcpkgname/$srcpkgver/srcfiles?fileinfo=1";
+ my $content = LWP::Simple::get($json_url);
+ die "cannot retrieve $json_url" unless defined $content;
+ my $json = JSON::PP->new();
+ # json options taken from debsnap
+ my $json_text = $json->allow_nonref->utf8->relaxed->decode($content);
+ die "cannot decode json" unless defined $json_text;
+ foreach my $result (@{ $json_text->{result} }) {
+ # FIXME - assumption: package is from Debian official (and not ports)
+ my @package_from_main = grep { $_->{archive_name} eq "debian" }
+ @{ $json_text->{fileinfo}->{ $result->{hash} } };
+ if (scalar @package_from_main > 1) {
+ die
+ "more than one package with the same hash in Debian official\n";
+ }
+ if (scalar @package_from_main == 0) {
+ die "no package with the right hash in Debian official\n";
+ }
+ $src_date = $package_from_main[0]->{first_seen};
+ }
+}
+if (!defined($src_date)) {
+ die "cannot find .dsc\n";
+}
-#foreach my $fname ($checksums->get_files()) {
-# # Re-adding existing files to the checksum object is the current way to
-# # ask Dpkg to check the checksums for us
-# $checksums->add_from_file((dirname($buildinfo)) . '/' . $fname);
-#}
+# support timestamps being separated by a comma
+my @required_timestamps = ();
+if ($timestamp eq "first_seen") {
+ # nothing to do, timestamps will be figured out later
+} elsif ($timestamp eq "metasnap") {
+ # acquire the required timestamps using metasnap.d.n
+ print "retrieving required timestamps from metasnap.d.n\n";
+ my $ua = LWP::UserAgent->new(timeout => 10);
+ $ua->env_proxy;
+ my @pkgs = ();
+ foreach my $pkg (@inst_build_deps) {
+ my $pkg_name = $pkg->{name};
+ my $pkg_ver = $pkg->{version};
+ my $pkg_arch = $pkg->{architecture};
+ if (defined $pkg_arch) {
+ push @pkgs,
+ URI::Escape::uri_escape("$pkg_name:$pkg_arch=$pkg_ver");
+ } else {
+ push @pkgs, URI::Escape::uri_escape("$pkg_name=$pkg_ver");
+ }
+ }
+ my $response
+ = $ua->get('https://metasnap.debian.net/cgi-bin/api'
+ . '?archive=debian'
+ . "&pkgs="
+ . (join "%2C", @pkgs)
+ . "&arch=$build_arch"
+ . '&suite=unstable'
+ . '&comp=main');
+ if (!$response->is_success) {
+ die "request to metasnap.d.n failed: $response->status_line";
+ }
+ foreach my $line (split /\n/, $response->decoded_content) {
+ my ($arch, $t) = split / /, $line, 2;
+ if ($arch ne $build_arch) {
+ die
+"debrebuild is currently unable to handle multiple architectures";
+ }
+ push @required_timestamps, $t;
+ }
+} else {
+ @required_timestamps = split(/,/, $timestamp);
+}
# setup a temporary apt directory
@@ -327,10 +539,32 @@ foreach my $d ((
make_path("$tempdir/$d");
}
+# We use the Build-Date field as a heuristic to find a good date for the
+# stable release. If we would get the stable release from deb.debian.org
+# instead, then packages might be newer than in unstable of the past because
+# of point releases. The date from the source package will also work in most
+# cases but will fail for binNMU buildinfo files where the source package
+# might even come from years in the past
+my $build_date;
+{
+ local $ENV{LC_ALL} = 'C';
+ my $tp
+ = Time::Piece->strptime($cdata->{'Build-Date'}, '%a, %d %b %Y %T %z');
+ $build_date = $tp->strftime("%Y%m%dT%H%M%SZ");
+}
+
+sub get_sources_list() {
+ my @result = ();
+ push @result, "deb $base_mirror/$build_date/ $base_dist main";
+ push @result, "deb-src $base_mirror/$src_date/ unstable main";
+ foreach my $ts (@required_timestamps) {
+ push @result, "deb $base_mirror/$ts/ unstable main";
+ }
+ return @result;
+}
+
open(FH, '>', "$tempdir/etc/apt/sources.list");
-print FH <<EOF;
-deb ${apt_tor_prefix}http://deb.debian.org/debian/ $base_dist main
-EOF
+print FH (join "\n", get_sources_list) . "\n";
close FH;
# FIXME - document what's dpkg's status for
# Create dpkg status
@@ -362,7 +596,8 @@ open(FH, '>', $aptconf);
# commit 475f75506db48a7fa90711fce4ed129f6a14cc9a.
#
# Acquire::Check-Valid-Until has to be set to false because the snapshot
-# timestamps might be too far in the past to still be valid.
+# timestamps might be too far in the past to still be valid. This could be
+# fixed by a solution to https://bugs.debian.org/763419
#
# Acquire::Languages has to be set to prevent downloading of translations from
# the mirrors.
@@ -371,6 +606,14 @@ open(FH, '>', $aptconf);
# so that apt-get update fails if repositories cannot be authenticated. The
# default value of this option will change to true with apt from Debian
# Buster.
+#
+# We need APT::Get::allow-downgrades set to true, because even if we choose a
+# base distribution that was released before the state that "unstable"
+# currently is in, the package versions in that stable release might be newer
+# than what is in unstable due to security fixes. Choosing a stable release
+# from an older snapshot timestamp would fix this problem but would defeat the
+# purpose of a base distribution for builders like sbuild which can take
+# advantage of existing chroot environments.
print FH <<EOF;
Apt {
@@ -380,10 +623,19 @@ Apt {
Dir "$tempdir";
Dir::State::status "$tempdir/var/lib/dpkg/status";
-Acquire::Check-Valid-Until "false";
Acquire::Languages "none";
Binary::apt-get::Acquire::AllowInsecureRepositories "false";
EOF
+my @common_aptopts = (
+ 'Acquire::Check-Valid-Until "false";',
+ 'Acquire::http::Dl-Limit "1000";',
+ 'Acquire::https::Dl-Limit "1000";',
+ 'Acquire::Retries "5";',
+ 'APT::Get::allow-downgrades "true";',
+);
+foreach my $line (@common_aptopts) {
+ print FH "$line\n";
+}
close FH;
# add the removed keys because they are not returned by Dpkg::Vendor
@@ -434,272 +686,595 @@ sub parse_all_packages_files {
}
my $index = parse_all_packages_files();
+if (scalar @required_timestamps == 0) {
+ # go through all packages in the Installed-Build-Depends field and find out
+ # the timestamps at which they were first seen each
+ my %notfound_timestamps;
-# go through all packages in the Installed-Build-Depends field and find out
-# the timestamps at which they were first seen each
-my %notfound_timestamps;
+ my %missing;
-my (%missing, $snapshots_needed);
+ foreach my $pkg (@inst_build_deps) {
+ my $pkg_name = $pkg->{name};
+ my $pkg_ver = $pkg->{version};
+ my $pkg_arch = $pkg->{architecture};
+
+ # check if we really need to acquire this package from snapshot.d.o or if
+ # it already exists in the cache
+ if (defined $pkg->{architecture}) {
+ if ($index->get_by_key("$pkg_name $pkg_ver $pkg_arch")) {
+ print "skipping $pkg_name $pkg_ver\n";
+ next;
+ }
+ } else {
+ if ($index->get_by_key("$pkg_name $pkg_ver $build_arch")) {
+ $pkg->{architecture} = $build_arch;
+ print "skipping $pkg_name $pkg_ver\n";
+ next;
+ }
+ if ($index->get_by_key("$pkg_name $pkg_ver all")) {
+ $pkg->{architecture} = "all";
+ print "skipping $pkg_name $pkg_ver\n";
+ next;
+ }
+ }
-foreach my $pkg (@inst_build_deps) {
- my $pkg_name = $pkg->{name};
- my $pkg_ver = $pkg->{version};
- my $pkg_arch = $pkg->{architecture};
+ print "retrieving snapshot.d.o data for $pkg_name $pkg_ver\n";
+ my $json_url
+ = "http://snapshot.debian.org/mr/binary/$pkg_name/$pkg_ver/binfiles?fileinfo=1";
+ my $content = LWP::Simple::get($json_url);
+ die "cannot retrieve $json_url" unless defined $content;
+ my $json = JSON::PP->new();
+ # json options taken from debsnap
+ my $json_text = $json->allow_nonref->utf8->relaxed->decode($content);
+ die "cannot decode json" unless defined $json_text;
+ my $pkg_hash;
+ if (scalar @{ $json_text->{result} } == 1) {
+ # if there is only a single result, then the package must either be
+ # Architecture:all, be the build architecture or match the requested
+ # architecture
+ $pkg_hash = ${ $json_text->{result} }[0]->{hash};
+ $pkg->{architecture}
+ = ${ $json_text->{result} }[0]->{architecture};
+ # if a specific architecture was requested, it should match
+ if (defined $pkg_arch && $pkg_arch ne $pkg->{architecture}) {
+ die
+"package $pkg_name was explicitly requested for $pkg_arch but only $pkg->{architecture} was found\n";
+ }
+ # if no specific architecture was requested, it should be the build
+ # architecture
+ if ( !defined $pkg_arch
+ && $build_arch ne $pkg->{architecture}
+ && "all" ne $pkg->{architecture}) {
+ die
+"package $pkg_name was implicitly requested for $pkg_arch but only $pkg->{architecture} was found\n";
+ }
+ # Ensure that $pkg_arch is defined from here as we want to look it up
+ # later in a Packages file from snapshot.d.o if it is not in the
+ # current Packages file
+ $pkg_arch = $pkg->{architecture};
+ } else {
+ # Since the package occurs more than once, we expect it to be of
+ # Architecture:any
+ #
+ # If no specific architecture was requested, look for the build
+ # architecture
+ if (!defined $pkg_arch) {
+ $pkg_arch = $build_arch;
+ }
+ foreach my $result (@{ $json_text->{result} }) {
+ if ($result->{architecture} eq $pkg_arch) {
+ $pkg_hash = $result->{hash};
+ last;
+ }
+ }
+ if (!defined($pkg_hash)) {
+ die "cannot find package in architecture $pkg_arch\n";
+ }
+ # we now know that this package is not architecture:all but has a
+ # concrete architecture
+ $pkg->{architecture} = $pkg_arch;
+ }
+ # FIXME - assumption: package is from Debian official (and not ports)
+ my @package_from_main = grep { $_->{archive_name} eq "debian" }
+ @{ $json_text->{fileinfo}->{$pkg_hash} };
+ if (scalar @package_from_main > 1) {
+ die
+ "more than one package with the same hash in Debian official\n";
+ }
+ if (scalar @package_from_main == 0) {
+ die "no package with the right hash in Debian official\n";
+ }
+ my $date = $package_from_main[0]->{first_seen};
+ $pkg->{first_seen} = $date;
+ $notfound_timestamps{$date} = 1;
+ $missing{"${pkg_name}/${pkg_ver}/${pkg_arch}"} = 1;
+ }
+
+ # feed apt with timestamped snapshot.debian.org URLs until apt is able to
+ # find all the required package versions. We start with the most recent
+ # timestamp, check which packages cannot be found at that timestamp, add
+ # the timestamp of the most recent not-found package and continue doing
+ # this iteratively until all versions can be found.
+
+ while (0 < scalar keys %notfound_timestamps) {
+ print "left to check: " . (scalar keys %notfound_timestamps) . "\n";
+ my @timestamps = map { Time::Piece->strptime($_, '%Y%m%dT%H%M%SZ') }
+ (sort keys %notfound_timestamps);
+ my $newest = $timestamps[$#timestamps];
+ $newest = $newest->strftime("%Y%m%dT%H%M%SZ");
+ push @required_timestamps, $newest;
+ delete $notfound_timestamps{$newest};
+
+ my $snapshot_url = "$base_mirror/$newest/";
+
+ open(FH, '>>', "$tempdir/etc/apt/sources.list");
+ print FH "deb ${snapshot_url} unstable main\n";
+ close FH;
+
+ 0 == system 'apt-get', 'update' or die "apt-get update failed\n";
+
+ my $index = parse_all_packages_files();
+ foreach my $pkg (@inst_build_deps) {
+ my $pkg_name = $pkg->{name};
+ my $pkg_ver = $pkg->{version};
+ my $pkg_arch = $pkg->{architecture};
+ my $first_seen = $pkg->{first_seen};
+ my $cdata = $index->get_by_key("$pkg_name $pkg_ver $pkg_arch");
+ if (not defined($cdata->{"Package"})) {
+ # Not present yet; we hope a later snapshot URL will locate it.
+ next;
+ }
+ delete($missing{"${pkg_name}/${pkg_ver}/${pkg_arch}"});
+ if (defined $first_seen) {
+ # this may delete timestamps that we actually need for some other
+ # packages
+ delete $notfound_timestamps{$first_seen};
+ }
+ }
+ }
- # check if we really need to acquire this package from snapshot.d.o or if
- # it already exists in the cache
- if (defined $pkg->{architecture}) {
- if ($index->get_by_key("$pkg_name $pkg_ver $pkg_arch")) {
- print "skipping $pkg_name $pkg_ver\n";
+ if (%missing) {
+ print STDERR 'Cannot locate the following packages via snapshots'
+ . " or the current repo/mirror\n";
+ for my $key (sort(keys(%missing))) {
+ print STDERR " ${key}\n";
+ }
+ exit(1);
+ }
+} else {
+ # find out the actual package architecture for all installed build
+ # dependencies without explicit architecture qualification
+ foreach my $pkg (@inst_build_deps) {
+ my $pkg_name = $pkg->{name};
+ my $pkg_ver = $pkg->{version};
+ if (defined $pkg->{architecture}) {
next;
}
- } else {
if ($index->get_by_key("$pkg_name $pkg_ver $build_arch")) {
$pkg->{architecture} = $build_arch;
- print "skipping $pkg_name $pkg_ver\n";
next;
}
if ($index->get_by_key("$pkg_name $pkg_ver all")) {
$pkg->{architecture} = "all";
- print "skipping $pkg_name $pkg_ver\n";
next;
}
+ die "cannot find $pkg_name $pkg_ver in index\n";
}
-
- print "retrieving snapshot.d.o data for $pkg_name $pkg_ver\n";
- my $json_url
- = "http://snapshot.debian.org/mr/binary/$pkg_name/$pkg_ver/binfiles?fileinfo=1";
- my $content = LWP::Simple::get($json_url);
- die "cannot retrieve $json_url" unless defined $content;
- my $json = JSON::PP->new();
- # json options taken from debsnap
- my $json_text = $json->allow_nonref->utf8->relaxed->decode($content);
- die "cannot decode json" unless defined $json_text;
- my $pkg_hash;
- if (scalar @{ $json_text->{result} } == 1) {
- # if there is only a single result, then the package must either be
- # Architecture:all, be the build architecture or match the requested
- # architecture
- $pkg_hash = ${ $json_text->{result} }[0]->{hash};
- $pkg->{architecture} = ${ $json_text->{result} }[0]->{architecture};
- # if a specific architecture was requested, it should match
- if (defined $pkg_arch && $pkg_arch ne $pkg->{architecture}) {
- die
-"package $pkg_name was explicitly requested for $pkg_arch but only $pkg->{architecture} was found\n";
- }
- # if no specific architecture was requested, it should be the build
- # architecture
- if ( !defined $pkg_arch
- && $build_arch ne $pkg->{architecture}
- && "all" ne $pkg->{architecture}) {
- die
-"package $pkg_name was implicitly requested for $pkg_arch but only $pkg->{architecture} was found\n";
- }
- # Ensure that $pkg_arch is defined from here as we want to look it up
- # later in a Packages file from snapshot.d.o if it is not in the
- # current Packages file
- $pkg_arch = $pkg->{architecture};
- } else {
- # Since the package occurs more than once, we expect it to be of
- # Architecture:any
- #
- # If no specific architecture was requested, look for the build
- # architecture
- if (!defined $pkg_arch) {
- $pkg_arch = $build_arch;
- }
- foreach my $result (@{ $json_text->{result} }) {
- if ($result->{architecture} eq $pkg_arch) {
- $pkg_hash = $result->{hash};
- last;
- }
- }
- if (!defined($pkg_hash)) {
- die "cannot find package in architecture $pkg_arch\n";
- }
- # we now know that this package is not architecture:all but has a
- # concrete architecture
- $pkg->{architecture} = $pkg_arch;
- }
- # FIXME - assumption: package is from Debian official (and not ports)
- my @package_from_main = grep { $_->{archive_name} eq "debian" }
- @{ $json_text->{fileinfo}->{$pkg_hash} };
- if (scalar @package_from_main > 1) {
- die "more than one package with the same hash in Debian official\n";
- }
- if (scalar @package_from_main == 0) {
- die "no package with the right hash in Debian official\n";
- }
- my $date = $package_from_main[0]->{first_seen};
- $pkg->{first_seen} = $date;
- $notfound_timestamps{$date} = 1;
- $missing{"${pkg_name}/${pkg_ver}/${pkg_arch}"} = 1;
}
-# feed apt with timestamped snapshot.debian.org URLs until apt is able to find
-# all the required package versions. We start with the most recent timestamp,
-# check which packages cannot be found at that timestamp, add the timestamp of
-# the most recent not-found package and continue doing this iteratively until
-# all versions can be found.
+# remove $tempdir manually to avoid any surprises
+0 == system 'apt-get', '--option',
+ 'Dir::Etc::SourceList=/dev/null', '--option',
+ 'Dir::Etc::SourceParts=/dev/null', 'update'
+ or die "apt-get update failed\n";
+
+foreach my $f (
+ '/var/cache/apt/pkgcache.bin',
+ '/var/cache/apt/srcpkgcache.bin',
+ '/var/lib/dpkg/status',
+ '/var/lib/apt/lists/lock',
+ '/etc/apt/apt.conf',
+ '/etc/apt/sources.list',
+ '/etc/apt/trusted.gpg.d/debian-archive-removed-keys.gpg',
+ '/etc/apt/trusted.gpg.d/debian-archive-keyring.gpg'
+) {
+ unlink "$tempdir/$f" or die "cannot unlink $tempdir/$f: $!\n";
+}
-while (0 < scalar keys %notfound_timestamps) {
- print "left to check: " . (scalar keys %notfound_timestamps) . "\n";
- my @timestamps = map { Time::Piece->strptime($_, '%Y%m%dT%H%M%SZ') }
- (sort keys %notfound_timestamps);
- my $newest = $timestamps[$#timestamps];
- $newest = $newest->strftime("%Y%m%dT%H%M%SZ");
- delete $notfound_timestamps{$newest};
+foreach my $d (
+ '/var/cache/apt/archives/partial', '/var/cache/apt/archives',
+ '/var/cache/apt', '/var/cache',
+ '/var/lib/dpkg', '/var/lib/apt/lists/auxfiles',
+ '/var/lib/apt/lists/partial', '/var/lib/apt/lists',
+ '/var/lib/apt', '/var/lib',
+ '/var', '/etc/apt/sources.list.d',
+ '/etc/apt/trusted.gpg.d', '/etc/apt/preferences.d',
+ '/etc/apt/apt.conf.d', '/etc/apt',
+ '/etc', ''
+) {
+ rmdir "$tempdir/$d" or die "cannot rmdir $d: $!\n";
+}
- my $snapshot_url = "http://snapshot.debian.org/archive/debian/$newest/";
+!-e $tempdir or die "failed to remove $tempdir\n";
- open(FH, '>>', "$tempdir/etc/apt/sources.list");
- print FH "deb ${apt_tor_prefix}${snapshot_url} unstable main\n";
- close FH;
+if ($builder ne "none") {
+ if (!-e $outdir) {
+ make_path($outdir);
+ }
+}
- 0 == system 'apt-get', 'update' or die "apt-get update failed";
+my $build = '';
+my $changesarch = '';
+if ($build_archany and $build_archall) {
+ $build = "binary";
+ $changesarch = $host_arch;
+} elsif ($build_archany and !$build_archall) {
+ $build = "any";
+ $changesarch = $host_arch;
+} elsif (!$build_archany and $build_archall) {
+ $build = "all";
+ $changesarch = 'all';
+} else {
+ die "nothing to build\n";
+}
- my $index = parse_all_packages_files();
- foreach my $pkg (@inst_build_deps) {
- my $pkg_name = $pkg->{name};
- my $pkg_ver = $pkg->{version};
- my $pkg_arch = $pkg->{architecture};
- my $first_seen = $pkg->{first_seen};
- my $cdata = $index->get_by_key("$pkg_name $pkg_ver $pkg_arch");
- if (not defined($cdata->{"Package"})) {
- # Not present yet; we hope a later snapshot URL will locate it.
- next;
+my @install = ();
+foreach my $pkg (@inst_build_deps) {
+ my $pkg_name = $pkg->{name};
+ my $pkg_ver = $pkg->{version};
+ my $pkg_arch = $pkg->{architecture};
+ if (any { $_ eq $builder } ('mmdebstrap', 'none', 'dpkg')) {
+ if ($pkg_arch eq "all" || $pkg_arch eq $build_arch) {
+ push @install, "$pkg_name=$pkg_ver";
+ } else {
+ push @install, "$pkg_name:$pkg_arch=$pkg_ver";
}
- $snapshots_needed = 1;
- delete($missing{"${pkg_name}/${pkg_ver}/${pkg_arch}"});
- if (defined $first_seen) {
- delete $notfound_timestamps{$first_seen};
+ } elsif (any { $_ eq $builder } ('sbuild', 'sbuild+unshare')) {
+ if ($pkg_arch eq "all" || $pkg_arch eq $build_arch) {
+ push @install, "$pkg_name (= $pkg_ver)";
+ } else {
+ push @install, "$pkg_name:$pkg_arch (= $pkg_ver)";
}
+ } else {
+ die "unsupported builder: $builder\n";
}
}
-if (%missing) {
- print STDERR 'Cannot locate the following packages via snapshots'
- . " or the current repo/mirror\n";
- for my $key (sort(keys(%missing))) {
- print STDERR " ${key}\n";
- }
- exit(1);
-}
-
-print "\n";
-print "Manual installation and build\n";
-print "-----------------------------\n";
-print "\n";
-if ($cdata->{"Binary-Only-Changes"}) {
+if ($builder eq "none") {
+ print "\n";
+ print "Manual installation and build\n";
+ print "-----------------------------\n";
+ print "\n";
print
-"The buildinfo appears to be for a binNMU; this is not fully supported yet.\n\n";
-}
-print "The following sources.list contains all the required repositories:\n";
-print "\n";
-0 == system 'cat', "$tempdir/etc/apt/sources.list"
- or die "cannot cat $tempdir/etc/apt/sources.list";
-print "\n";
-print "You can manually install the right dependencies like this:\n";
-print "\n";
-print "apt-get install --no-install-recommends";
-
-if ($snapshots_needed) {
+ "The following sources.list contains all the required repositories:\n";
+ print "\n";
+ print(join "\n", get_sources_list);
+ print "\n";
+ print "You can manually install the right dependencies like this:\n";
+ print "\n";
+ print "apt-get install --no-install-recommends";
+
# Release files from snapshots.d.o have often expired by the time
# we fetch them. Include the option to work around that to assist
# the user.
print " -oAcquire::Check-Valid-Until=false";
-}
-
-foreach my $pkg (@inst_build_deps) {
- my $pkg_name = $pkg->{name};
- my $pkg_ver = $pkg->{version};
- my $pkg_arch = $pkg->{architecture};
- if ($pkg_arch eq "all" || $pkg_arch eq $build_arch) {
- print " $pkg_name=$pkg_ver";
+ foreach my $pkg (@install) {
+ print " $pkg";
+ }
+ print "\n";
+ print "\n";
+ print "And then build your package:\n";
+ print "\n";
+ if ($custom_build_path) {
+ require Cwd;
+ my $custom_build_parent_dir = dirname($custom_build_path);
+ my $dsc_path = Cwd::realpath($dsc_fname)
+ // die("Cannot resolve ${dsc_fname}: $!\n");
+ print "mkdir -p \"${custom_build_parent_dir}\"\n";
+ print qq{dpkg-source -x "${dsc_path}" "${custom_build_path}"\n};
+ print "cd \"$custom_build_path\"\n";
} else {
- print " $pkg_name:$pkg_arch=$pkg_ver";
- }
-}
-print "\n";
-print "\n";
-print "And then build your package:\n";
-print "\n";
-if ($custom_build_path) {
- require Cwd;
- my $custom_build_parent_dir = dirname($custom_build_path);
- my $dsc_path = Cwd::realpath($dsc_fname)
- // die("Cannot resolve ${dsc_fname}: $!\n");
- print "mkdir -p \"${custom_build_parent_dir}\"\n";
- print qq{dpkg-source -x "${dsc_path}" "${custom_build_path}"\n};
- print "cd \"$custom_build_path\"\n";
-} else {
- print qq{dpkg-source -x "${dsc_fname}"\n};
- print "cd packagedirectory\n";
-}
-print "$environment dpkg-buildpackage\n";
-print "\n";
-print "Using sbuild\n";
-print "------------\n";
-print "\n";
+ print qq{dpkg-source -x "${dsc_fname}"\n};
+ print "cd packagedirectory\n";
+ }
+ print "\n";
+ if ($cdata->{"Binary-Only-Changes"}) {
+ print( "Since this is a binNMU, you must put the following "
+ . "lines at the top of debian/changelog:\n\n");
+ print($cdata->{"Binary-Only-Changes"});
+ }
+ print "\n";
+ print( "$environment dpkg-buildpackage -uc "
+ . "--host-arch=$host_arch --build=$build\n");
+} elsif ($builder eq "dpkg") {
+ if ("$build_arch\n" ne `dpkg --print-architecture`) {
+ die "must be run on $build_arch\n";
+ }
-if ($cdata->{"Binary-Only-Changes"}) {
- print
-"The buildinfo appears to be for a binNMU; this is not fully supported yet.\n\n";
-}
+ if ($> != 0) {
+ die "you must be root for the dpkg builder\n";
+ }
-print "You can try to build the package with sbuild like this:\n";
-print "\n";
-print "SBUILD_CMDLINE=$environment sbuild";
-open(FH, '<', "$tempdir/etc/apt/sources.list");
+ if (-e $custom_build_path) {
+ die "$custom_build_path exists -- refusing to overwrite\n";
+ }
+
+ my $sources = '/etc/apt/sources.list.d/debrebuild.list';
+ if (-e $sources) {
+ die "$sources already exists -- refusing to overwrite\n";
+ }
+ open(FH, '>', $sources) or die "cannot open $sources: $!\n";
+ print FH (join "\n", get_sources_list) . "\n";
+ close FH;
+
+ my $config = '/etc/apt/apt.conf.d/23-debrebuild.conf';
+ if (-e $config) {
+ die "$config already exists -- refusing to overwrite\n";
+ }
+ open(FH, '>', $config) or die "cannot open $config: $!\n";
+ foreach my $line (@common_aptopts) {
+ print FH "$line\n";
+ }
+ close FH;
+
+ 0 == system 'apt-get', 'update' or die "apt-get update failed\n";
+
+ my @cmd
+ = ('apt-get', 'install', '--no-install-recommends', '--yes', @install);
+ 0 == system @cmd or die "apt-get install failed\n";
+
+ 0 == system 'apt-get', 'source', '--only-source', '--download-only',
+ "$srcpkgname=$srcpkgver"
+ or die "apt-get source failed\n";
+ unlink $sources or die "failed to unlink $sources\n";
+ unlink $config or die "failed to unlink $config\n";
+ make_path(dirname $custom_build_path);
+ 0 == system 'dpkg-source', '--no-check', '--extract',
+ $srcpkg->get_basename(1) . '.dsc', $custom_build_path
+ or die "dpkg-source failed\n";
+
+ if ($cdata->{"Binary-Only-Changes"}) {
+ open my $infh, '<', "$custom_build_path/debian/changelog"
+ or die "cannot open debian/changelog for reading: $!\n";
+ my $changelogcontent = do { local $/; <$infh> };
+ close $infh;
+ open my $outfh, '>', "$custom_build_path/debian/changelog"
+ or die "cannot open debian/changelog for writing: $!\n";
+ my $logentry = $cdata->{"Binary-Only-Changes"};
+ # due to storing the binnmu changelog entry in deb822 buildinfo, the
+ # first character is an unwanted newline
+ $logentry =~ s/^\n//;
+ print $outfh $logentry;
+ # while the linebreak at the beginning is wrong, there are two missing
+ # at the end
+ print $outfh "\n\n";
+ print $outfh $changelogcontent;
+ close $outfh;
+ }
+ 0 == system 'env', "--chdir=$custom_build_path", @environment,
+ 'dpkg-buildpackage', '-uc', "--host-arch=$host_arch", "--build=$build"
+ or die "dpkg-buildpackage failed\n";
+ # we are not interested in the unpacked source directory
+ 0 == system 'rm', '-r', $custom_build_path
+ or die "failed to remove $custom_build_path: $?";
+ # but instead we want the produced artifacts
+ 0 == system 'dcmd', 'mv',
+ (dirname $custom_build_path)
+ . "/${srcpkgname}_${srcpkgbinver}_$changesarch.changes", $outdir
+ or die "dcmd failed\n";
+} elsif ($builder eq "sbuild" or $builder eq "sbuild+unshare") {
+ my $tarballpath = File::HomeDir->my_home
+ . "/.cache/sbuild/$base_dist-$build_arch.tar.gz";
+ if ($builder eq "sbuild+unshare") {
+ if (!-e $tarballpath) {
+ my $chrootdir = tempdir();
+ 0 == system 'sbuild-createchroot', '--chroot-mode=unshare',
+ '--make-sbuild-tarball', $tarballpath,
+ $base_dist, $chrootdir, "$base_mirror/$build_date/"
+ or die "sbuild-createchroot failed\n";
+ !-e $chrootdir or die "$chrootdir wasn't removed\n";
+ }
+ }
+
+ my @cmd = ('env', "--chdir=$outdir", @environment, 'sbuild');
+ foreach my $line (get_sources_list) {
+ push @cmd, "--extra-repository=$line";
+ }
-while (my $line = <FH>) {
- chomp $line;
- print " --extra-repository=\"$line\"";
-}
-close FH;
-if ($snapshots_needed) {
# Release files from snapshots.d.o have often expired by the time
# we fetch them. Include the option to work around that to assist
# the user.
- print
-q{ --chroot-setup-commands='echo "Acquire::Check-Valid-Until \"false\";" | tee /etc/apt/apt.conf.d/23-debrebuild.conf'};
-}
-my @add_depends = ();
-foreach my $pkg (@inst_build_deps) {
- my $pkg_name = $pkg->{name};
- my $pkg_ver = $pkg->{version};
- my $pkg_arch = $pkg->{architecture};
- if ($pkg_arch eq "all" || $pkg_arch eq $build_arch) {
- push @add_depends, "$pkg_name (= $pkg_ver)";
+ push @cmd,
+ '--chroot-setup-commands=echo '
+ . (String::ShellQuote::shell_quote(join '\n', @common_aptopts))
+ . ' | tee /etc/apt/apt.conf.d/23-debrebuild.conf';
+
+ # sbuild chroots have build-essential already installed. This might
+ # interfere with the packages that we need to install. Example:
+ # libc6-dev : Breaks: libgcc-8-dev (< 8.4.0-2~) but 8.3.0-6 is to be inst..
+ # Thus, we remove them beforehand -- the right versions will get installed
+ # later anyways.
+ # We have to list the packages manually instead of relying on autoremove
+ # because debootstrap marks them all as manually installed.
+ push @cmd,
+ ( '--chroot-setup-commands=apt-get --yes remove build-essential'
+ . ' libc6-dev gcc g++ make dpkg-dev');
+ push @cmd, '--chroot-setup-commands=apt-get --yes autoremove';
+
+ push @cmd, "--add-depends=" . (join ",", @install);
+ push @cmd, "--build=$build_arch";
+ push @cmd, "--host=$host_arch";
+
+ if ($build_source) {
+ push @cmd, '--source';
} else {
- push @add_depends, "$pkg_name:$pkg_arch (= $pkg_ver)";
+ push @cmd, '--no-source';
}
-}
-print " --add-depends=\"" . (join ",", @add_depends) . "\"";
-print " --build-dep-resolver=aptitude";
-print " --build=$build_arch";
-if (defined $host_arch) {
- print " --host=$host_arch";
-}
-if ($build_source) {
- print " --source";
-} else {
- print " --no-source";
-}
-if ($build_archany) {
- print " --arch-any";
-} else {
- print " --no-arch-any";
-}
-if ($build_archall) {
- print " --arch-all";
+ if ($build_archany) {
+ push @cmd, '--arch-any';
+ } else {
+ push @cmd, '--no-arch-any';
+ }
+ if ($build_archall) {
+ push @cmd, '--arch-all';
+ } else {
+ push @cmd, '--no-arch-all';
+ }
+ if ($cdata->{"Binary-Only-Changes"}) {
+ push @cmd, "--binNMU-changelog=$cdata->{'Binary-Only-Changes'}";
+ }
+ if ($builder eq "sbuild+unshare") {
+ push @cmd, "--chroot=$tarballpath";
+ push @cmd, "--chroot-mode=unshare";
+ }
+ push @cmd, "--dist=$base_dist";
+ push @cmd, "--no-run-lintian";
+ push @cmd, "--no-run-autopkgtest";
+ push @cmd, "--no-apt-upgrade";
+ push @cmd, "--no-apt-distupgrade";
+ # disable the explainer
+ push @cmd, "--bd-uninstallable-explainer=";
+ # We need the aspcud resolver to install packages that are older than the
+ # ones in the latest snapshot. Apt by default will only use the latest
+ # package versions as candidates and sbuild uses a dummy package instead
+ # of crafting an apt command line with the exact version requirements.
+ push @cmd, "--build-dep-resolver=aspcud";
+
+ if ($custom_build_path) {
+ push @cmd, "--build-path=$custom_build_path";
+ }
+ push @cmd, "${srcpkgname}_$srcpkgver";
+ print((join " ", @cmd) . "\n");
+ 0 == system @cmd or die "sbuild failed\n";
+} elsif ($builder eq "mmdebstrap") {
+
+ my @binnmucmds = ();
+ if ($cdata->{"Binary-Only-Changes"}) {
+ my $logentry = $cdata->{"Binary-Only-Changes"};
+ # due to storing the binnmu changelog entry in deb822 buildinfo, the first
+ # character is an unwanted newline
+ $logentry =~ s/^\n//;
+ # while the linebreak at the beginning is wrong, there are two missing at
+ # the end
+ $logentry .= "\n\n";
+ push @binnmucmds,
+ '{ printf "%s" '
+ . (String::ShellQuote::shell_quote $logentry)
+ . "; cat debian/changelog; } > debian/changelog.debrebuild",
+ "mv debian/changelog.debrebuild debian/changelog";
+ }
+
+ my @cmd = (
+ 'env', '-i',
+ 'PATH=/usr/sbin:/usr/bin:/sbin:/bin',
+ 'mmdebstrap',
+ "--arch=$build_arch",
+ "--variant=apt",
+ (map { "--aptopt=$_" } @common_aptopts),
+ '--include=' . (join ' ', @install),
+ '--essential-hook=chroot "$1" sh -c "'
+ . (
+ join ' && ',
+ 'rm /etc/apt/sources.list',
+ 'echo '
+ . (
+ String::ShellQuote::shell_quote(
+ (join "\n", get_sources_list) . "\n"
+ ))
+ . ' >> /etc/apt/sources.list',
+ 'apt-get update'
+ )
+ . '"',
+ '--customize-hook=chroot "$1" sh -c "'
+ . (
+ join ' && ',
+ "apt-get source --only-source -d $srcpkgname=$srcpkgver",
+ "mkdir -p "
+ . (String::ShellQuote::shell_quote(dirname $custom_build_path)),
+ "dpkg-source --no-check -x /"
+ . $srcpkg->get_basename(1) . '.dsc '
+ . (String::ShellQuote::shell_quote $custom_build_path),
+ 'cd ' . (String::ShellQuote::shell_quote $custom_build_path),
+ @binnmucmds,
+"env $environment dpkg-buildpackage -uc -a $host_arch --build=$build",
+ 'cd /',
+ 'rm -r ' . (String::ShellQuote::shell_quote $custom_build_path))
+ . '"',
+ '--customize-hook=sync-out '
+ . (dirname $custom_build_path)
+ . " $outdir",
+ $base_dist,
+ '/dev/null',
+ "deb $base_mirror/$build_date/ $base_dist main"
+ );
+ print((join ' ', @cmd) . "\n");
+
+ 0 == system @cmd or die "mmdebstrap failed\n";
} else {
- print " --no-arch-all";
+ die "unsupported builder: $builder\n";
}
-print " -d $base_dist";
-print " --no-run-lintian";
-if ($custom_build_path) {
- print " --build-path='${custom_build_path}'";
+
+# test if all checksums in the buildinfo file check out
+if ($builder ne "none") {
+ print "build artifacts stored in $outdir\n";
+
+ my $checksums = Dpkg::Checksums->new();
+ $checksums->add_from_control($cdata);
+ # remove the .dsc as we only did the binaries
+ # - the .dsc cannot be reproduced anyways because we cannot reproduce its
+ # signature
+ # - binNMUs can only be done with --build=any
+ foreach my $file ($checksums->get_files()) {
+ if ($file !~ /\.dsc$/) {
+ next;
+ }
+ $checksums->remove_file($file);
+ }
+
+ my $new_cdata
+ = Dpkg::Control->new(type => CTRL_FILE_BUILDINFO, allow_pgp => 1);
+ $new_cdata->load($new_buildinfo);
+ my $new_checksums = Dpkg::Checksums->new();
+ $new_checksums->add_from_control($new_cdata);
+
+ my @files = $checksums->get_files();
+ my @new_files = $new_checksums->get_files();
+
+ if (scalar @files != scalar @new_files) {
+ print("old buildinfo:\n" . (join "\n", @files) . "\n");
+ print("new buildinfo:\n" . (join "\n", @new_files) . "\n");
+ die "new buildinfo contains a different number of files\n";
+ }
+
+ for (my $i = 0 ; $i <= $#files ; $i++) {
+ if ($files[$i] ne $new_files[$i]) {
+ die "different checksum files at position $i\n";
+ }
+ if ($files[$i] =~ /\.dsc$/) {
+ print("skipping $files[$i]\n");
+ next;
+ }
+ print("checking $files[$i]: ");
+ if ($checksums->get_size($files[$i])
+ != $new_checksums->get_size($files[$i])) {
+ die "size differs for $files[$i]\n";
+ } else {
+ print("size... ");
+ }
+ my $chksum = $checksums->get_checksum($files[$i], undef);
+ my $new_chksum = $new_checksums->get_checksum($new_files[$i], undef);
+ if (scalar keys %{$chksum} != scalar keys %{$new_chksum}) {
+ die "different algos for $files[$i]\n";
+ }
+ foreach my $algo (keys %{$chksum}) {
+ if (!exists $new_chksum->{$algo}) {
+ die "$algo is not used in both buildinfo files\n";
+ }
+ if ($chksum->{$algo} ne $new_chksum->{$algo}) {
+ die "value of $algo differs for $files[$i]\n";
+ }
+ print("$algo... ");
+ }
+ print("all OK\n");
+ }
}
-print " $dsc_fname\n";
-print "BASE_DIST=$base_dist\n";
diff --git a/scripts/debrelease.sh b/scripts/debrelease.sh
index 87ffc95..07c7f02 100755
--- a/scripts/debrelease.sh
+++ b/scripts/debrelease.sh
@@ -109,7 +109,7 @@ else
[ -r $file ] && . $file
done
- set | egrep "^(DEBRELEASE|DEVSCRIPTS)_")
+ set | grep -E "^(DEBRELEASE|DEVSCRIPTS)_")
# check sanity
case "$DEBRELEASE_UPLOADER" in
diff --git a/scripts/debrsign.sh b/scripts/debrsign.sh
index 070af98..287fbe2 100755
--- a/scripts/debrsign.sh
+++ b/scripts/debrsign.sh
@@ -97,7 +97,7 @@ eval $(
[ -r $file ] && . $file
done
- set | egrep '^DEBRSIGN_')
+ set | grep '^DEBRSIGN_')
signargs=
while [ $# != 0 ]
diff --git a/scripts/debsign.sh b/scripts/debsign.sh
index 6a7b37e..17b3b76 100755
--- a/scripts/debsign.sh
+++ b/scripts/debsign.sh
@@ -289,7 +289,7 @@ else
[ -r $file ] && . $file
done
- set | egrep '^(DEBSIGN|DEBRELEASE|DEVSCRIPTS)_')
+ set | grep -E '^(DEBSIGN|DEBRELEASE|DEVSCRIPTS)_')
# We do not replace this with a default directory to avoid accidentally
# signing a broken package
@@ -625,7 +625,7 @@ dosigning() {
fi
fi
- if [ -n "$changes" ] && echo "$changes" | egrep -q '[][*?]'
+ if [ -n "$changes" ] && echo "$changes" | grep -qE '[][*?]'
then
for changes in $changes
do
diff --git a/scripts/devscripts/__init__.py b/scripts/devscripts/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/scripts/devscripts/__init__.py
+++ /dev/null
diff --git a/scripts/diff2patches.sh b/scripts/diff2patches.sh
index 921ab6c..b3a99d3 100755
--- a/scripts/diff2patches.sh
+++ b/scripts/diff2patches.sh
@@ -79,7 +79,7 @@ fi
echo "Patches will be extracted under $DEB_PATCHES/"
-FILES=$(zcat "$diffgz" | lsdiff --strip 1 | egrep -v ^debian/) || \
+FILES=$(zcat "$diffgz" | lsdiff --strip 1 | grep -v ^debian/) || \
echo "$(basename "$diffgz") doesn't contain any patch outside debian/"
for file in $FILES; do
diff --git a/scripts/dscextract.sh b/scripts/dscextract.sh
index c988425..c33ffa1 100755
--- a/scripts/dscextract.sh
+++ b/scripts/dscextract.sh
@@ -52,7 +52,7 @@ DSCDIR=$(dirname "$DSC")
WORKDIR=$(mktemp -d --tmpdir dscextract.XXXXXX)
trap 'rm -rf "$WORKDIR"' EXIT
-if DIFFGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.diff\.(gz|xz|lzma|bz2)$' "$DSC") ; then
+if DIFFGZ=$(grep -E '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.diff\.(gz|xz|lzma|bz2)$' "$DSC") ; then
DIFFGZ=$(echo "$DIFFGZ" | cut -d ' ' -f 4 | head -n 1)
test -e "$DSCDIR/$DIFFGZ" || die "$DSCDIR/$DIFFGZ: not found"
filterdiff -p1 -i "$FILE" -z "$DSCDIR/$DIFFGZ" > "$WORKDIR/patch"
@@ -60,7 +60,7 @@ if DIFFGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.diff\.(gz|xz|lzma|bz2)$' "$DS
# case 1: file found in .diff.gz
if ! grep -q '^@@ -0,0 ' "$WORKDIR/patch" ; then
# case 1a: patch requires original file
- ORIGTGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.orig\.tar\.(gz|xz|lzma|bz2)$' "$DSC") || die "no orig.tar.* found in $DSC"
+ ORIGTGZ=$(grep -E '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.orig\.tar\.(gz|xz|lzma|bz2)$' "$DSC") || die "no orig.tar.* found in $DSC"
ORIGTGZ=$(echo "$ORIGTGZ" | cut -d ' ' -f 4 | head -n 1)
setzip $ORIGTGZ
test -e "$DSCDIR/$ORIGTGZ" || die "$DSCDIR/$ORIGTGZ not found"
@@ -77,7 +77,7 @@ if DIFFGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.diff\.(gz|xz|lzma|bz2)$' "$DS
fi
fi
-if DEBIANTARGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.debian\.tar\.(gz|xz|lzma|bz2)$' "$DSC") ; then
+if DEBIANTARGZ=$(grep -E '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.debian\.tar\.(gz|xz|lzma|bz2)$' "$DSC") ; then
case $FILE in
debian/*)
DEBIANTARGZ=$(echo "$DEBIANTARGZ" | cut -d ' ' -f 4 | head -n 1)
@@ -91,7 +91,7 @@ if DEBIANTARGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.debian\.tar\.(gz|xz|lzma
# for 3.0 format, no need to look in other places here
;;
*)
- ORIGTGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.orig\.tar\.(gz|xz|lzma|bz2)$' "$DSC") || die "no orig.tar.gz found in $DSC"
+ ORIGTGZ=$(grep -E '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.orig\.tar\.(gz|xz|lzma|bz2)$' "$DSC") || die "no orig.tar.gz found in $DSC"
ORIGTGZ=$(echo "$ORIGTGZ" | cut -d ' ' -f 4 | head -n 1)
test -e "$DSCDIR/$ORIGTGZ" || die "$DSCDIR/$ORIGTGZ not found"
setzip $ORIGTGZ
@@ -105,7 +105,7 @@ if DEBIANTARGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.debian\.tar\.(gz|xz|lzma
esac
fi
-if TARGZ=$(egrep '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.tar\.(gz|xz|lzma|bz2)$' "$DSC") ; then
+if TARGZ=$(grep -E '^ [0-9a-f]{32,64} [0-9]+ [^ ]+\.tar\.(gz|xz|lzma|bz2)$' "$DSC") ; then
TARGZ=$(echo "$TARGZ" | cut -d ' ' -f 4 | head -n 1)
test -e "$DSCDIR/$TARGZ" || die "$DSCDIR/$TARGZ not found"
setzip $TARGZ
diff --git a/scripts/list-unreleased.sh b/scripts/list-unreleased.sh
index fd47677..d61ec9e 100755
--- a/scripts/list-unreleased.sh
+++ b/scripts/list-unreleased.sh
@@ -46,9 +46,9 @@ get_list() {
for dir in $(
if [ "$RECURSE" ]; then
- find "$path" -type d | egrep -v "$vcs_dirs"
+ find "$path" -type d | grep -vE "$vcs_dirs"
else
- find "$path" -maxdepth 1 -type d | egrep -v "$vcs_dirs"
+ find "$path" -maxdepth 1 -type d | grep -vE "$vcs_dirs"
fi
); do
changelog="$dir/debian/changelog"
diff --git a/scripts/ltnu.sh b/scripts/ltnu.sh
index f0362d5..c0fbaae 100755
--- a/scripts/ltnu.sh
+++ b/scripts/ltnu.sh
@@ -42,7 +42,7 @@ fi
MAINT="${DEBEMAIL}"
if [ -n "${1}" ]; then
- if echo "${1}" | fgrep -q @; then
+ if echo "${1}" | grep -qF @; then
MAINT="${1}"
elif [ "${1}" = "pkg-gnustep" ]; then
MAINT="pkg-gnustep-maintainers@lists.alioth.debian.org"
diff --git a/scripts/namecheck.pl b/scripts/namecheck.pl
index c0024f0..a171513 100755
--- a/scripts/namecheck.pl
+++ b/scripts/namecheck.pl
@@ -223,11 +223,9 @@ __DATA__
# file ~/.namecheckrc with your own contents in the same format.
#
http://%s.tuxfamily.org/ | Not Found
-http://alioth.debian.org/projects/%s | Software Map
http://freshmeat.net/projects/%s | We encounted an error
http://launchpad.net/%s | no page with this address
http://savannah.gnu.org/projects/%s | Invalid Group
http://sourceforge.net/projects/%s | Invalid Project
-http://www.ohloh.net/projects/%s | Sorry, the page you are trying to view is not here
-https://gna.org/projects/%s | Invalid Group
+http://www.openhub.net/projects/%s | Something seems wrong with your URL
http://projects.apache.org/projects/%s.html | Not Found
diff --git a/scripts/nmudiff.sh b/scripts/nmudiff.sh
index f72d30d..ab6e787 100755
--- a/scripts/nmudiff.sh
+++ b/scripts/nmudiff.sh
@@ -100,7 +100,7 @@ else
[ -r $file ] && . $file
done
- set | egrep '^(NMUDIFF|BTS|DEVSCRIPTS)_')
+ set | grep -E '^(NMUDIFF|BTS|DEVSCRIPTS)_')
# check sanity
case "$BTS_SENDMAIL_COMMAND" in
diff --git a/scripts/origtargz.pl b/scripts/origtargz.pl
index 7ac8625..67d8e99 100755
--- a/scripts/origtargz.pl
+++ b/scripts/origtargz.pl
@@ -58,6 +58,10 @@ B<pristine-tar> is tried.
=item *
+B<pristine-lfs> is tried.
+
+=item *
+
B<apt-get source> is tried when B<apt-cache showsrc> reports a matching version.
=item *
@@ -259,6 +263,20 @@ sub download_origtar () {
return @f;
}
+ # try pristine-lfs
+
+ @files
+ = grep { /^\Q${package}_$fileversion.orig\E(?:-[\w\-]+)?\.tar\./ }
+ map { chomp; $_; } # remove newlines
+ `pristine-lfs list 2>&1`;
+ if (@files) {
+ system "pristine-lfs checkout -o .. $_" for @files;
+ }
+
+ if (my @f = glob "../${package}_$fileversion.orig*.tar.*") {
+ return @f;
+ }
+
# try apt-get source
open S, "apt-cache showsrc '$package' |";
diff --git a/scripts/pts-subscribe.sh b/scripts/pts-subscribe.sh
index 630abac..56aed70 100755
--- a/scripts/pts-subscribe.sh
+++ b/scripts/pts-subscribe.sh
@@ -77,7 +77,7 @@ else
[ -r $file ] && . $file
done
- set | egrep '^PTS_')
+ set | grep '^PTS_')
# check sanity - nothing to do here (at will complain if it's illegal)
diff --git a/scripts/salsa.bash_completion b/scripts/salsa.bash_completion
index aedc85c..c1bff67 100644
--- a/scripts/salsa.bash_completion
+++ b/scripts/salsa.bash_completion
@@ -16,7 +16,7 @@ _salsa_completion () {
opts+=" --enable-issues --no-enable-issues --disable-issues"
opts+=" --enable-mr --no-enable-mr --disable-mr --ci-config-path"
opts+=" --mr-allow-squash --no-mr-allow-squash --mr-desc --mr-title"
- opts+=" --mr-dst_branch --mr-dst_project --mr-remove-source-branch"
+ opts+=" --mr-dst-branch --mr-dst-project --mr-remove-source-branch"
opts+=" --no-remove-source-branch --mr-src-branch --mr-src-project"
opts+=" --kgb --no-kgb --kgb-options --irc-channel --path --tagpending"
opts+=" --irker --no-irker --disable-irker --no-disable-irker"
diff --git a/scripts/setup.py b/scripts/setup.py
index 5908616..179969b 100755
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -2,6 +2,7 @@
import os
import re
+from distutils.command.clean import clean as BaseCleanCommand
from setuptools import setup
@@ -15,10 +16,21 @@ def get_version():
head = open(changelog, encoding="utf8").readline()
match = re.compile(r".*\((.*)\).*").match(head)
if match:
- return match.group(1)
+ version = match.group(1)
+ with open(os.path.join("devscripts", "__init__.py"), "w") as f:
+ f.write("version = '{}'\n".format(version))
+ return version
raise Exception("Failed to determine version from debian/changelog")
+class MyCleanCommand(BaseCleanCommand):
+ def run(self):
+ super().run()
+ version_file_py = os.path.join("devscripts", "__init__.py")
+ if os.path.exists(version_file_py):
+ os.unlink(version_file_py)
+
+
if __name__ == '__main__':
setup(
name='devscripts',
@@ -26,4 +38,5 @@ if __name__ == '__main__':
scripts=SCRIPTS,
packages=['devscripts', 'devscripts/test'],
test_suite='devscripts.test',
+ cmdclass={'clean': MyCleanCommand},
)
diff --git a/scripts/uupdate.sh b/scripts/uupdate.sh
index 2914823..d6c6577 100755
--- a/scripts/uupdate.sh
+++ b/scripts/uupdate.sh
@@ -171,7 +171,7 @@ else
[ -r $file ] && . $file
done
- set | egrep '^(UUPDATE|DEVSCRIPTS)_')
+ set | grep -E '^(UUPDATE|DEVSCRIPTS)_')
# check sanity
case "$UUPDATE_PRISTINE" in
diff --git a/scripts/what-patch.sh b/scripts/what-patch.sh
index edabcdf..73330b6 100755
--- a/scripts/what-patch.sh
+++ b/scripts/what-patch.sh
@@ -66,7 +66,7 @@ if [ "$VERBOSE" -gt 0 ]; then
fi
fi
-if fgrep -q quilt debian/source/format 2>/dev/null; then
+if grep -qF quilt debian/source/format 2>/dev/null; then
echo "quilt"
exit 0
fi
@@ -75,31 +75,31 @@ fi
# tools that rely on the exisitng output. If changes in reporting is needed,
# please check the "VERBOSE" flag (see below for examples). Feel free
# to add new patchsystem detection and reporting.
-for filename in $(echo "debian/rules"; grep ^include debian/rules | fgrep -v '$(' | awk '{print $2}')
+for filename in $(echo "debian/rules"; grep ^include debian/rules | grep -vF '$(' | awk '{print $2}')
do
- fgrep patchsys.mk "$filename" | grep -q -v "^#" && {
+ grep -F patchsys.mk "$filename" | grep -q -v "^#" && {
if [ "$VERBOSE" -eq 0 ]; then
echo "cdbs"; exit 0;
else
echo "cdbs (patchsys.mk: see 'cdbs-edit-patch')"; exit 0;
fi
}
- fgrep quilt "$filename" | grep -q -v "^#" && { echo "quilt"; exit 0; }
- fgrep dbs-build.mk "$filename" | grep -q -v "^#" && {
+ grep -F quilt "$filename" | grep -q -v "^#" && { echo "quilt"; exit 0; }
+ grep -F dbs-build.mk "$filename" | grep -q -v "^#" && {
if [ "$VERBOSE" -eq 0 ]; then
echo "dbs"; exit 0;
else
echo "dbs (see 'dbs-edit-patch')"; exit 0;
fi
}
- fgrep dpatch "$filename" | grep -q -v "^#" && {
+ grep -F dpatch "$filename" | grep -q -v "^#" && {
if [ "$VERBOSE" -eq 0 ]; then
echo "dpatch"; exit 0;
else
echo "dpatch (see 'patch-edit-patch')"; exit 0;
fi
}
- fgrep '*.diff' "$filename" | grep -q -v "^#" && {
+ grep -F '*.diff' "$filename" | grep -q -v "^#" && {
if [ "$VERBOSE" -eq 0 ]; then
echo "diff splash"; exit 0;
else
diff --git a/scripts/wnpp-alert.sh b/scripts/wnpp-alert.sh
index 3d9de27..19d4e3d 100755
--- a/scripts/wnpp-alert.sh
+++ b/scripts/wnpp-alert.sh
@@ -47,11 +47,11 @@ wnppdiff () {
if [ ! -f "$CACHEDDIFF" ]; then
# First use
comm -12 $WNPP_PACKAGES $INSTALLED | sed -e 's/+/\\+/g' | \
- xargs -i egrep '^[A-Z]+ [0-9]+ {} ' $WNPP | \
+ xargs -i grep -E '^[A-Z]+ [0-9]+ {} ' $WNPP | \
tee $CACHEDDIFF
else
comm -12 $WNPP_PACKAGES $INSTALLED | sed -e 's/+/\\+/g' | \
- xargs -i egrep '^[A-Z]+ [0-9]+ {} ' $WNPP > $WNPP_DIFF
+ xargs -i grep -E '^[A-Z]+ [0-9]+ {} ' $WNPP > $WNPP_DIFF
sort -o $CACHEDDIFF $CACHEDDIFF
sort -o $WNPP_DIFF $WNPP_DIFF
comm -3 $CACHEDDIFF $WNPP_DIFF | \
@@ -136,4 +136,4 @@ if [ -f "$WNPP_DIFF" ]; then
fi
comm -12 $WNPP_PACKAGES $INSTALLED | sed -e 's/+/\\+/g' | \
-xargs -i egrep '^[A-Z]+ [0-9]+ {} ' $WNPP
+xargs -i grep -E '^[A-Z]+ [0-9]+ {} ' $WNPP
diff --git a/test/Makefile b/test/Makefile
index b573a85..7ad2342 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -25,6 +25,9 @@ OUR_TESTS= \
DESTRUCTIVE_TESTS = \
debi \
+# unset some variables that might affect tests
+undefine DEB_CHECK_COMMAND
+
test: $(foreach i,$(OUR_TESTS),test_$(i).test)
destructive-test: $(foreach i,$(DESTRUCTIVE_TESTS),test_$(i).test)
diff --git a/test/test_debchange b/test/test_debchange
index e5cbb6f..0c1f6f2 100755
--- a/test/test_debchange
+++ b/test/test_debchange
@@ -60,6 +60,16 @@ success() {
runCommand2 "-c \"$CHANGELOG\" $1" "" "" 0
}
+checkUbuntuDevelAvailable() {
+ if ubuntu-distro-info --devel 2>/dev/null >&2; then
+ # distro-info-data knows of the current devel release
+ true
+ else
+ # distro-info-data doesn't know of the current devel release
+ false
+ fi
+}
+
checkVersion() {
local start_param="$1"
local param="$2"
@@ -114,6 +124,10 @@ testDebianIncrement() {
}
testUbuntuIncrement() {
+ if ! checkUbuntuDevelAvailable; then
+ echo "No known Ubuntu devel release known, skipping related tests"
+ startSkipping
+ fi
checkUbuntuVersion "-i" "12" "12ubuntu1"
checkUbuntuVersion "-i" "3.4" "3.4ubuntu1"
checkUbuntuVersion "-i" "3.4.5" "3.4.5ubuntu1"
@@ -127,6 +141,10 @@ testUbuntuIncrement() {
}
testUbuntuRebuild() {
+ if ! checkUbuntuDevelAvailable; then
+ echo "No known Ubuntu devel release known, skipping related tests"
+ startSkipping
+ fi
checkUbuntuVersion "-R" "3.4" "3.4build1"
checkUbuntuVersion "-R" "2.0-4" "2.0-4build1"
checkUbuntuVersion "-R" "1.42-4ubuntu5" "1.42-4ubuntu6"
@@ -179,7 +197,7 @@ testEncoding() {
verifyEntryLines() {
success "--vendor Debian $1"
- local changes="$(dpkg-parsechangelog -l"$CHANGELOG" -SChanges | fgrep '*')"
+ local changes="$(dpkg-parsechangelog -l"$CHANGELOG" -SChanges | grep -F '*')"
assertEquals "\"$changes\"" 1 "$(echo "$changes" | wc -l)"
}
diff --git a/test/test_debrepro b/test/test_debrepro
index 344d663..077be1e 100755
--- a/test/test_debrepro
+++ b/test/test_debrepro
@@ -17,10 +17,10 @@
set -u
-ARCHITECTURE="$(dpkg-architecture -qDEB_HOST_ARCH)"
-if [ "$ARCHITECTURE" = "hurd-i386" ]; then
- # hurd-i386 lacks sem_open() which is required by something in here
- echo "This test is not supported on $ARCHITECTURE, skipping"
+DEB_HOST_OS="$(dpkg-architecture -qDEB_HOST_ARCH_OS)"
+if [ "$DEB_HOST_OS" = "kfreebsd" ]; then
+ # kbsd has a non-working semaphore, that is needed here.
+ echo "This test is not supported on $(dpkg-architecture -qDEB_HOST_ARCH), skipping"
exit 0
fi
diff --git a/test/test_uscan b/test/test_uscan
index d9eca3d..ebf2899 100755
--- a/test/test_uscan
+++ b/test/test_uscan
@@ -56,7 +56,7 @@ tearDown(){
trap tearDown EXIT
containsName(){
- echo "$1" | fgrep -q "$2"
+ echo "$1" | grep -qF "$2"
echo $?
}
diff --git a/test/test_uscan_ftp b/test/test_uscan_ftp
index 8f5676a..e49a9a9 100755
--- a/test/test_uscan_ftp
+++ b/test/test_uscan_ftp
@@ -21,10 +21,10 @@ set -u
TESTTYPE=FTP
. ./lib_test_uscan
-ARCHITECTURE="$(dpkg-architecture -qDEB_HOST_ARCH)"
-if [ "$ARCHITECTURE" = "hurd-i386" ]; then
- # hurd-i386 lacks sem_open() which is required by the python ftp server
- echo "This test is not supported on $ARCHITECTURE, skipping"
+DEB_HOST_OS="$(dpkg-architecture -qDEB_HOST_ARCH_OS)"
+if [ "$DEB_HOST_OS" = "kfreebsd" ]; then
+ # kbsd has a non-working semaphore, that is needed here.
+ echo "This test is not supported on $(dpkg-architecture -qDEB_HOST_ARCH), skipping"
exit 0
fi
@@ -83,7 +83,7 @@ spawnFtpServer(){
trap cleanup 1 2 3 13 15
containsName(){
- echo "$1" | fgrep -q "$2"
+ echo "$1" | grep -qF "$2"
echo $?
}
diff --git a/test/test_uscan_group b/test/test_uscan_group
index 1fd20d5..dca4b9d 100755
--- a/test/test_uscan_group
+++ b/test/test_uscan_group
@@ -56,7 +56,7 @@ tearDown(){
trap tearDown EXIT
containsName(){
- echo "$1" | fgrep -q "$2"
+ echo "$1" | grep -qF "$2"
echo $?
}
diff --git a/test/test_uscan_mangle b/test/test_uscan_mangle
index fc3ac44..7ab651e 100755
--- a/test/test_uscan_mangle
+++ b/test/test_uscan_mangle
@@ -53,7 +53,7 @@ tearDown(){
trap tearDown EXIT
containsName(){
- echo "$1" | fgrep -q "$2"
+ echo "$1" | grep -qF "$2"
echo $?
}
@@ -742,11 +742,13 @@ testWatch4NonNativeDMangle() {
WATCHVER=4
WATCHLINE='opts="dirversionmangle=s/^\d*[13579]\./0~$&/, uversionmangle=s/^\d*[13579]\./0~$&/" @@@url@@@([\.\d]+)/(.+)/(.+)/ @PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ debian uupdate'
helperWatch "siteNonNative foo EXTRA"
+}
- rm -rf "$TEMP_PKG_DIR"/foo/debian
- #and without dirversionmangle, should return version 3
+# ... and without dirversionmangle, should return version 3
+testWatch4NonNativeDMangleWithoutD() {
+ WATCHVER=4
WATCHLINE='@@@url@@@([\.\d]+)/(.+)/(.+)/ @PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ debian uupdate'
- helperWatch ":" 1.0 3.0
+ helperWatch "siteNonNative foo EXTRA" 1.0 3.0
}
# test non-native package with uupdate, bare HTTP server with dirversionmangle and base
@@ -754,11 +756,13 @@ testWatch4NonNativeDMangleB() {
WATCHVER=4
WATCHLINE='opts="dirversionmangle=s/^\d*[13579]\./0~$&/, uversionmangle=s/^\d*[13579]\./0~$&/" @@@url@@@([\.\d]+)/ @PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ debian uupdate'
helperWatch "siteWebNonNativeRecWithBase foo EXTRA"
+}
- rm -rf "$TEMP_PKG_DIR"/foo/debian
- #and without dirversionmangle, should return version 3
+# ... and without dirversionmangle, should return version 3
+testWatch4NonNativeDMangleBWithoutD() {
+ WATCHVER=4
WATCHLINE='@@@url@@@([\.\d]+)/ @PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ debian uupdate'
- helperWatch ":" 1.0 3.0
+ helperWatch "siteWebNonNativeRecWithBase foo EXTRA" 1.0 3.0
}
# test 3 parameter watch line
diff --git a/test/test_uscan_svn b/test/test_uscan_svn
index 825699b..60dc906 100755
--- a/test/test_uscan_svn
+++ b/test/test_uscan_svn
@@ -19,6 +19,13 @@
set -u
#set -x
+DEB_HOST_OS="$(dpkg-architecture -qDEB_HOST_ARCH_OS)"
+if [ "$DEB_HOST_OS" = "kfreebsd" ]; then
+ # kbsd has a non-working semaphore, that is needed here.
+ echo "This test is not supported on $(dpkg-architecture -qDEB_HOST_ARCH), skipping"
+ exit 0
+fi
+
TESTTYPE=Svn
. ./lib_test_uscan