dpkg-buildpackage.pl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. #!/usr/bin/perl
  2. #
  3. # dpkg-buildpackage
  4. #
  5. # Copyright © 1996 Ian Jackson
  6. # Copyright © 2000 Wichert Akkerman
  7. # Copyright © 2006-2010,2012-2013 Guillem Jover <guillem@debian.org>
  8. # Copyright © 2007 Frank Lichtenheld
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 2 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  22. use strict;
  23. use warnings;
  24. use Carp;
  25. use Cwd;
  26. use File::Basename;
  27. use POSIX qw(:sys_wait_h);
  28. use Dpkg ();
  29. use Dpkg::Gettext;
  30. use Dpkg::ErrorHandling;
  31. use Dpkg::BuildOptions;
  32. use Dpkg::BuildProfiles qw(set_build_profiles);
  33. use Dpkg::Compression;
  34. use Dpkg::Version;
  35. use Dpkg::Changelog::Parse;
  36. use Dpkg::Path qw(find_command);
  37. use Dpkg::IPC;
  38. textdomain('dpkg-dev');
  39. sub showversion {
  40. printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION;
  41. print _g('
  42. This is free software; see the GNU General Public License version 2 or
  43. later for copying conditions. There is NO warranty.
  44. ');
  45. }
  46. sub usage {
  47. printf _g(
  48. 'Usage: %s [<option>...]')
  49. . "\n\n" . _g(
  50. 'Options:
  51. -F (default) normal full build (binaries and sources).
  52. -b binary-only, do not build source.
  53. -B binary-only, no arch-indep files.
  54. -A binary-only, only arch-indep files.
  55. -S source only, no binary files.
  56. -nc do not clean source tree (implies -b).
  57. -tc clean source tree when finished.
  58. -D (default) check build dependencies and conflicts.
  59. -d do not check build dependencies and conflicts.
  60. -P<profiles> assume given build profiles as active (comma-separated list).
  61. -R<rules> rules file to execute (default is debian/rules).
  62. -T<target> call debian/rules <target> with the proper environment.
  63. --as-root ensure -T calls the target with root rights.
  64. -j[<number>] specify jobs to run simultaneously (passed to <rules>).
  65. -r<gain-root-command>
  66. command to gain root privileges (default is fakeroot).
  67. --check-command=<check-command>
  68. command to check the .changes file (no default).
  69. --check-option=<opt>
  70. pass <opt> to <check-command>.
  71. -p<sign-command>
  72. command to sign .dsc and/or .changes files
  73. (default is gpg2 or gpg).
  74. -k<keyid> the key to use for signing.
  75. -ap add pause before starting signature process.
  76. -us unsigned source package.
  77. -uc unsigned .changes file.
  78. --force-sign
  79. force signing the resulting files.
  80. --admindir=<directory>
  81. change the administrative directory.
  82. -?, --help show this help message.
  83. --version show the version.')
  84. . "\n\n" . _g(
  85. 'Options passed to dpkg-architecture:
  86. -a<arch> Debian architecture we build for.
  87. -t<system> set GNU system type.')
  88. . "\n\n" . _g(
  89. 'Options passed to dpkg-genchanges:
  90. -si (default) source includes orig if new upstream.
  91. -sa uploaded source always includes orig.
  92. -sd uploaded source is diff and .dsc only.
  93. -v<version> changes since version <version>.
  94. -m<maint> maintainer for package is <maint>.
  95. -e<maint> maintainer for release is <maint>.
  96. -C<descfile> changes are described in <descfile>.
  97. --changes-option=<opt>
  98. pass option <opt> to dpkg-genchanges.')
  99. . "\n\n" . _g(
  100. 'Options passed to dpkg-source:
  101. -sn force Debian native source format.
  102. -s[sAkurKUR] see dpkg-source for explanation.
  103. -z<level> compression level to use for source.
  104. -Z<compressor> compression to use for source (gz|xz|bzip2|lzma).
  105. -i[<regex>] ignore diffs of files matching regex.
  106. -I[<pattern>] filter out files when building tarballs.
  107. --source-option=<opt>
  108. pass option <opt> to dpkg-source.
  109. '), $Dpkg::PROGNAME;
  110. }
  111. my $admindir;
  112. my @debian_rules = ('debian/rules');
  113. my @rootcommand = ();
  114. my $signcommand;
  115. my $noclean;
  116. my $cleansource;
  117. my $parallel;
  118. my $checkbuilddep = 1;
  119. my @checkbuilddep_opts;
  120. my @source_opts;
  121. my $check_command = $ENV{DEB_CHECK_COMMAND};
  122. my @check_opts;
  123. my $signpause;
  124. my $signkey = $ENV{DEB_SIGN_KEYID};
  125. my $signforce = 0;
  126. my $signreleased = 1;
  127. my $signsource = 1;
  128. my $signchanges = 1;
  129. my $buildtarget = 'build';
  130. my $binarytarget = 'binary';
  131. my $targetarch = '';
  132. my $targetgnusystem = '';
  133. my @build_profiles = ();
  134. my $call_target = '';
  135. my $call_target_as_root = 0;
  136. my $since;
  137. my $maint;
  138. my $changedby;
  139. my $desc;
  140. my @changes_opts;
  141. use constant BUILD_DEFAULT => 1;
  142. use constant BUILD_SOURCE => 2;
  143. use constant BUILD_ARCH_DEP => 4;
  144. use constant BUILD_ARCH_INDEP => 8;
  145. use constant BUILD_BINARY => BUILD_ARCH_DEP | BUILD_ARCH_INDEP;
  146. use constant BUILD_ALL => BUILD_BINARY | BUILD_SOURCE;
  147. my $include = BUILD_ALL | BUILD_DEFAULT;
  148. sub build_normal() { return ($include & BUILD_ALL) == BUILD_ALL; }
  149. sub build_sourceonly() { return $include == BUILD_SOURCE; }
  150. sub build_binaryonly() { return !($include & BUILD_SOURCE); }
  151. sub build_binaryindep() { return ($include == BUILD_ARCH_INDEP); }
  152. sub build_opt {
  153. if ($include == BUILD_BINARY) {
  154. return '-b';
  155. } elsif ($include == BUILD_ARCH_DEP) {
  156. return '-B';
  157. } elsif ($include == BUILD_ARCH_INDEP) {
  158. return '-A';
  159. } elsif ($include == BUILD_SOURCE) {
  160. return '-S';
  161. } else {
  162. croak "build_opt called with include=$include";
  163. }
  164. }
  165. while (@ARGV) {
  166. $_ = shift @ARGV;
  167. if (/^(--help|-\?)$/) {
  168. usage;
  169. exit 0;
  170. } elsif (/^--version$/) {
  171. showversion;
  172. exit 0;
  173. } elsif (/^--admindir$/) {
  174. $admindir = shift @ARGV;
  175. } elsif (/^--admindir=(.*)$/) {
  176. $admindir = $1;
  177. } elsif (/^--source-option=(.*)$/) {
  178. push @source_opts, $1;
  179. } elsif (/^--changes-option=(.*)$/) {
  180. push @changes_opts, $1;
  181. } elsif (/^-j(\d*)$/) {
  182. $parallel = $1 || '';
  183. } elsif (/^-r(.*)$/) {
  184. @rootcommand = split /\s+/, $1;
  185. } elsif (/^--check-command=(.*)$/) {
  186. $check_command = $1;
  187. } elsif (/^--check-option=(.*)$/) {
  188. push @check_opts, $1;
  189. } elsif (/^-p(.*)$/) {
  190. $signcommand = $1;
  191. } elsif (/^-k(.*)$/) {
  192. $signkey = $1;
  193. } elsif (/^-([dD])$/) {
  194. $checkbuilddep = ($1 eq 'D');
  195. } elsif (/^-s(gpg|pgp)$/) {
  196. # Deprecated option
  197. warning(_g('-s%s is deprecated; always using gpg style interface'), $1);
  198. } elsif (/^--force-sign$/) {
  199. $signforce = 1;
  200. } elsif (/^-us$/) {
  201. $signsource = 0;
  202. } elsif (/^-uc$/) {
  203. $signchanges = 0;
  204. } elsif (/^-ap$/) {
  205. $signpause = 1;
  206. } elsif (/^-a(.*)$/) {
  207. $targetarch = $1;
  208. } elsif (/^-P(.*)$/) {
  209. @build_profiles = split /,/, $1;
  210. } elsif (/^-s[iad]$/) {
  211. push @changes_opts, $_;
  212. } elsif (/^-(?:s[insAkurKUR]|[zZ].*|i.*|I.*)$/) {
  213. push @source_opts, $_; # passed to dpkg-source
  214. } elsif (/^-tc$/) {
  215. $cleansource = 1;
  216. } elsif (/^-t(.*)$/) {
  217. $targetgnusystem = $1; # Order DOES matter!
  218. } elsif (/^(--target|-T)$/) {
  219. $call_target = shift @ARGV;
  220. } elsif (/^(--target=|-T)(.+)$/) {
  221. $call_target = $2;
  222. } elsif (/^--as-root$/) {
  223. $call_target_as_root = 1;
  224. } elsif (/^-nc$/) {
  225. $noclean = 1;
  226. } elsif (/^-b$/) {
  227. usageerr(_g('cannot combine %s and %s'), build_opt(), $_)
  228. if build_sourceonly;
  229. $include = BUILD_BINARY;
  230. push @changes_opts, '-b';
  231. @checkbuilddep_opts = ();
  232. $buildtarget = 'build';
  233. $binarytarget = 'binary';
  234. } elsif (/^-B$/) {
  235. usageerr(_g('cannot combine %s and %s'), build_opt(), $_)
  236. if build_sourceonly;
  237. $include = BUILD_ARCH_DEP;
  238. push @changes_opts, '-B';
  239. @checkbuilddep_opts = qw(-B);
  240. $buildtarget = 'build-arch';
  241. $binarytarget = 'binary-arch';
  242. } elsif (/^-A$/) {
  243. usageerr(_g('cannot combine %s and %s'), build_opt(), $_)
  244. if build_sourceonly;
  245. $include = BUILD_ARCH_INDEP;
  246. push @changes_opts, '-A';
  247. @checkbuilddep_opts = qw(-A);
  248. $buildtarget = 'build-indep';
  249. $binarytarget = 'binary-indep';
  250. } elsif (/^-S$/) {
  251. usageerr(_g('cannot combine %s and %s'), build_opt(), $_)
  252. if build_binaryonly;
  253. $include = BUILD_SOURCE;
  254. push @changes_opts, '-S';
  255. @checkbuilddep_opts = qw(-A -B);
  256. } elsif (/^-F$/) {
  257. usageerr(_g('cannot combine %s and %s'), build_opt(), $_)
  258. if not build_normal;
  259. $include = BUILD_ALL;
  260. @checkbuilddep_opts = ();
  261. } elsif (/^-v(.*)$/) {
  262. $since = $1;
  263. } elsif (/^-m(.*)$/) {
  264. $maint = $1;
  265. } elsif (/^-e(.*)$/) {
  266. $changedby = $1;
  267. } elsif (/^-C(.*)$/) {
  268. $desc = $1;
  269. } elsif (m/^-[EW]$/) {
  270. # Deprecated option
  271. warning(_g('-E and -W are deprecated, they are without effect'));
  272. } elsif (/^-R(.*)$/) {
  273. @debian_rules = split /\s+/, $1;
  274. } else {
  275. usageerr(_g('unknown option or argument %s'), $_);
  276. }
  277. }
  278. if ($noclean) {
  279. # -nc without -b/-B/-A/-S/-F implies -b
  280. $include = BUILD_BINARY if ($include & BUILD_DEFAULT);
  281. }
  282. if ($< == 0) {
  283. warning(_g('using a gain-root-command while being root')) if (@rootcommand);
  284. } else {
  285. push @rootcommand, 'fakeroot' unless @rootcommand;
  286. }
  287. if (@rootcommand and not find_command($rootcommand[0])) {
  288. if ($rootcommand[0] eq 'fakeroot' and $< != 0) {
  289. error(_g("fakeroot not found, either install the fakeroot\n" .
  290. 'package, specify a command with the -r option, ' .
  291. 'or run this as root'));
  292. } else {
  293. error(_g("gain-root-commmand '%s' not found"), $rootcommand[0]);
  294. }
  295. }
  296. if ($check_command and not find_command($check_command)) {
  297. error(_g("check-commmand '%s' not found"), $check_command);
  298. }
  299. if ($signcommand) {
  300. if (!find_command($signcommand)) {
  301. error(_g("sign-commmand '%s' not found"), $signcommand);
  302. }
  303. } elsif (($ENV{GNUPGHOME} && -e $ENV{GNUPGHOME}) ||
  304. ($ENV{HOME} && -e "$ENV{HOME}/.gnupg")) {
  305. if (find_command('gpg2')) {
  306. $signcommand = 'gpg2';
  307. } elsif (find_command('gpg')) {
  308. $signcommand = 'gpg';
  309. }
  310. }
  311. my $build_opts = Dpkg::BuildOptions->new();
  312. if (defined $parallel) {
  313. $parallel = $build_opts->get('parallel') if $build_opts->has('parallel');
  314. $ENV{MAKEFLAGS} ||= '';
  315. $ENV{MAKEFLAGS} .= " -j$parallel";
  316. $build_opts->set('parallel', $parallel);
  317. $build_opts->export();
  318. }
  319. set_build_profiles(@build_profiles) if @build_profiles;
  320. my $cwd = cwd();
  321. my $dir = basename($cwd);
  322. my $changelog = changelog_parse();
  323. my $pkg = mustsetvar($changelog->{source}, _g('source package'));
  324. my $version = mustsetvar($changelog->{version}, _g('source version'));
  325. my ($ok, $error) = version_check($version);
  326. error($error) unless $ok;
  327. (my $sversion = $version) =~ s/^\d+://;
  328. my $distribution = mustsetvar($changelog->{distribution}, _g('source distribution'));
  329. my $maintainer;
  330. if ($changedby) {
  331. $maintainer = $changedby;
  332. } elsif ($maint) {
  333. $maintainer = $maint;
  334. } else {
  335. $maintainer = mustsetvar($changelog->{maintainer}, _g('source changed by'));
  336. }
  337. open my $arch_env, '-|', 'dpkg-architecture', "-a$targetarch",
  338. "-t$targetgnusystem", '-f' or subprocerr('dpkg-architecture');
  339. while ($_ = <$arch_env>) {
  340. chomp;
  341. my ($key, $value) = split /=/, $_, 2;
  342. $ENV{$key} = $value;
  343. }
  344. close $arch_env or subprocerr('dpkg-architecture');
  345. my $arch;
  346. if (build_sourceonly) {
  347. $arch = 'source';
  348. } elsif (build_binaryindep) {
  349. $arch = 'all';
  350. } else {
  351. $arch = mustsetvar($ENV{DEB_HOST_ARCH}, _g('host architecture'));
  352. }
  353. my $pv = "${pkg}_$sversion";
  354. my $pva = "${pkg}_${sversion}_$arch";
  355. if (not $signcommand) {
  356. $signsource = 0;
  357. $signchanges = 0;
  358. } elsif ($signforce) {
  359. $signsource = 1;
  360. $signchanges = 1;
  361. } elsif (($signsource or $signchanges) and $distribution eq 'UNRELEASED') {
  362. $signreleased = 0;
  363. $signsource = 0;
  364. $signchanges = 0;
  365. }
  366. if ($signsource && build_binaryonly) {
  367. $signsource = 0;
  368. }
  369. #
  370. # Preparation of environment stops here
  371. #
  372. if (not -x 'debian/rules') {
  373. warning(_g('debian/rules is not executable; fixing that'));
  374. chmod(0755, 'debian/rules'); # No checks of failures, non fatal
  375. }
  376. unless ($call_target) {
  377. chdir('..') or syserr('chdir ..');
  378. withecho('dpkg-source', @source_opts, '--before-build', $dir);
  379. chdir($dir) or syserr("chdir $dir");
  380. }
  381. if ($checkbuilddep) {
  382. push @checkbuilddep_opts, "--admindir=$admindir" if $admindir;
  383. system('dpkg-checkbuilddeps', @checkbuilddep_opts);
  384. if (not WIFEXITED($?)) {
  385. subprocerr('dpkg-checkbuilddeps');
  386. } elsif (WEXITSTATUS($?)) {
  387. warning(_g('build dependencies/conflicts unsatisfied; aborting'));
  388. warning(_g('(Use -d flag to override.)'));
  389. if (build_sourceonly) {
  390. warning(_g('this is currently a non-fatal warning with -S, but ' .
  391. 'will probably become fatal in the future'));
  392. } else {
  393. exit 3;
  394. }
  395. }
  396. }
  397. if ($call_target) {
  398. if ($call_target_as_root or
  399. $call_target =~ /^(clean|binary(|-arch|-indep))$/)
  400. {
  401. withecho(@rootcommand, @debian_rules, $call_target);
  402. } else {
  403. withecho(@debian_rules, $call_target);
  404. }
  405. exit 0;
  406. }
  407. unless ($noclean) {
  408. withecho(@rootcommand, @debian_rules, 'clean');
  409. }
  410. if ($include & BUILD_SOURCE) {
  411. warning(_g('building a source package without cleaning up as you asked; ' .
  412. 'it might contain undesired files')) if $noclean;
  413. chdir('..') or syserr('chdir ..');
  414. withecho('dpkg-source', @source_opts, '-b', $dir);
  415. chdir($dir) or syserr("chdir $dir");
  416. }
  417. if ($buildtarget ne 'build' and scalar(@debian_rules) == 1) {
  418. # Verify that build-{arch,indep} are supported. If not, fallback to build.
  419. # This is a temporary measure to not break too many packages on a flag day.
  420. my $pid = spawn(exec => [ 'make', '-f', @debian_rules, '-qn', $buildtarget ],
  421. from_file => '/dev/null', to_file => '/dev/null',
  422. error_to_file => '/dev/null');
  423. my $cmdline = "make -f @debian_rules -qn $buildtarget";
  424. wait_child($pid, nocheck => 1, cmdline => $cmdline);
  425. my $exitcode = WEXITSTATUS($?);
  426. subprocerr($cmdline) unless WIFEXITED($?);
  427. if ($exitcode == 2) {
  428. warning(_g("%s must be updated to support the 'build-arch' and " .
  429. "'build-indep' targets (at least '%s' seems to be " .
  430. 'missing)'), "@debian_rules", $buildtarget);
  431. $buildtarget = 'build';
  432. }
  433. }
  434. if ($include & BUILD_BINARY) {
  435. withecho(@debian_rules, $buildtarget);
  436. withecho(@rootcommand, @debian_rules, $binarytarget);
  437. }
  438. push @changes_opts, "-m$maint" if defined $maint;
  439. push @changes_opts, "-e$changedby" if defined $changedby;
  440. push @changes_opts, "-v$since" if defined $since;
  441. push @changes_opts, "-C$desc" if defined $desc;
  442. my $chg = "../$pva.changes";
  443. print { *STDERR } " dpkg-genchanges @changes_opts >$chg\n";
  444. open my $changes_fh, '-|', 'dpkg-genchanges', @changes_opts
  445. or subprocerr('dpkg-genchanges');
  446. open my $out_fh, '>', $chg or syserr(_g('write changes file'));
  447. my $infiles = my $files = '';
  448. while ($_ = <$changes_fh>) {
  449. print { $out_fh } $_ or syserr(_g('write changes file'));
  450. chomp;
  451. if (/^Files:/i) {
  452. $infiles = 1;
  453. } elsif ($infiles && /^\s+(.*)$/) {
  454. $files .= " $1 ";
  455. } elsif ($infiles && /^\S/) {
  456. $infiles = 0;
  457. }
  458. }
  459. close $changes_fh or subprocerr(_g('dpkg-genchanges'));
  460. close $out_fh or syserr(_g('write changes file'));
  461. if ($cleansource) {
  462. withecho(@rootcommand, @debian_rules, 'clean');
  463. }
  464. chdir('..') or syserr('chdir ..');
  465. withecho('dpkg-source', @source_opts, '--after-build', $dir);
  466. chdir($dir) or syserr("chdir $dir");
  467. printf "$Dpkg::PROGNAME: %s\n", describe_build($files);
  468. if ($check_command) {
  469. withecho($check_command, @check_opts, $chg);
  470. }
  471. if ($signpause && ($signchanges || $signsource)) {
  472. print _g("Press the return key to start signing process\n");
  473. getc();
  474. }
  475. if ($signsource && signfile("$pv.dsc")) {
  476. error(_g('failed to sign .dsc and .changes file'));
  477. }
  478. if ($signchanges && signfile("$pva.changes")) {
  479. error(_g('failed to sign .changes file'));
  480. }
  481. if (not $signreleased) {
  482. warning(_g('not signing UNRELEASED build; use --force-sign to override'));
  483. }
  484. sub mustsetvar {
  485. my ($var, $text) = @_;
  486. error(_g('unable to determine %s'), $text)
  487. unless defined($var);
  488. print "$Dpkg::PROGNAME: $text $var\n";
  489. return $var;
  490. }
  491. sub withecho {
  492. print { *STDERR } " @_\n";
  493. system(@_)
  494. and subprocerr("@_");
  495. }
  496. sub signfile {
  497. my ($file) = @_;
  498. print { *STDERR } " signfile $file\n";
  499. my $qfile = quotemeta($file);
  500. system("(cat ../$qfile ; echo '') | " .
  501. "$signcommand --utf8-strings --local-user " .
  502. quotemeta($signkey || $maintainer) .
  503. " --clearsign --armor --textmode > ../$qfile.asc");
  504. my $status = $?;
  505. unless ($status) {
  506. system('mv', '--', "../$file.asc", "../$file")
  507. and subprocerr('mv');
  508. } else {
  509. system('rm', '-f', "../$file.asc")
  510. and subprocerr('rm -f');
  511. }
  512. print "\n";
  513. return $status
  514. }
  515. sub fileomitted {
  516. my ($files, $regex) = @_;
  517. return $files !~ /$regex/
  518. }
  519. sub describe_build {
  520. my ($files) = @_;
  521. my $ext = compression_get_file_extension_regex();
  522. if (fileomitted($files, '\.deb')) {
  523. # source only upload
  524. if (fileomitted($files, "\.diff\.$ext") and
  525. fileomitted($files, "\.debian\.tar\.$ext")) {
  526. return _g('source only upload: Debian-native package');
  527. } elsif (fileomitted($files, "\.orig\.tar\.$ext")) {
  528. return _g('source only, diff-only upload (original source NOT included)');
  529. } else {
  530. return _g('source only upload (original source is included)');
  531. }
  532. } elsif (fileomitted($files, '\.dsc')) {
  533. return _g('binary only upload (no source included)');
  534. } elsif (fileomitted($files, "\.diff\.$ext") and
  535. fileomitted($files, "\.debian\.tar\.$ext")) {
  536. return _g('full upload; Debian-native package (full source is included)');
  537. } elsif (fileomitted($files, "\.orig\.tar\.$ext")) {
  538. return _g('binary and diff upload (original source NOT included)');
  539. } else {
  540. return _g('full upload (original source is included)');
  541. }
  542. }