summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-10-11 18:34:16 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-10-11 19:29:49 +0300
commite5ac12269637741cefca74d932b3c39ae7149583 (patch)
tree069e7504664ca3d7b48b00a67e4968f67e64cd0d
parent488a041f665c74a60de82997c4880f19a100c5c0 (diff)
downloaddh-illumos-e5ac12269637741cefca74d932b3c39ae7149583.tar.gz
Also pack files known to be required for building illumos components
-rwxr-xr-xdh_illumos_gate30
1 files changed, 24 insertions, 6 deletions
diff --git a/dh_illumos_gate b/dh_illumos_gate
index 5e81879..cdf9906 100755
--- a/dh_illumos_gate
+++ b/dh_illumos_gate
@@ -42,7 +42,7 @@ L<dh_illumos_make(1)> provides more convenient way to do this.
=item B<-B> B<--build>
-Extract files known to be required for building illumos components.
+Extract or pack files known to be required for building illumos components.
These are F<usr/src/tools/scripts/bldenv.sh>, F<usr/src/Makefile*>,
F<usr/src/common/mapfiles/*>. If any file under F<usr/src/lib> is
requested, F<usr/src/lib/Makefile*> are extracted too. Same for
@@ -151,12 +151,30 @@ if ( $dh{CREATE_ORIG} ) {
my $source_version = $version =~ s!^(.*)-[^-]+$!$1!r;
my $tarball = "$cwd/../${source}_${source_version}.orig.tar.xz";
my $transform = "s,.*usr/src,$source-$source_version/usr/src,";
- doit(
- 'tar', '-c', '-J', '--owner',
- '0', '--group', '0', '--mode',
- 'u=rwX,go=rX', '--transform', $transform, '-f',
- $tarball, @tar_X, @ARGV
+ my @tar = (
+ 'tar', '-c', '-J', '--owner=0',
+ '--group=0', '--mode', 'u=rwX,go=rX', '--transform',
+ "'$transform'", '-f', "'$tarball'", @tar_X
);
+ my @extra = ();
+ if ( $dh{'BUILD'} ) {
+ my $r = $ARGV[0] =~ s!(.*)usr/src.*!$1!r; # XXX Sloppy
+ push @extra,
+ (
+ "${r}usr/src/Makefile*",
+ "${r}usr/src/common/mapfiles",
+ "${r}usr/src/tools/scripts/bldenv.sh",
+ );
+ if ( grep { m|(.*)usr/src/lib/.*| } @ARGV ) {
+ push @extra, "$1usr/src/lib/Makefile*";
+ }
+ if ( grep { m|(.*)usr/src/cmd/.*| } @ARGV ) {
+ push @extra, "$1usr/src/cmd/Makefile*";
+ }
+ }
+
+ # We need shell wildcards here, thus complex_doit, not doit:
+ complex_doit("@tar @ARGV @extra");
exit;
}
else {