summaryrefslogtreecommitdiff
path: root/dh_illumos_gate
diff options
context:
space:
mode:
Diffstat (limited to 'dh_illumos_gate')
-rwxr-xr-xdh_illumos_gate50
1 files changed, 39 insertions, 11 deletions
diff --git a/dh_illumos_gate b/dh_illumos_gate
index 4a584f3..75e02af 100755
--- a/dh_illumos_gate
+++ b/dh_illumos_gate
@@ -40,7 +40,7 @@ L<dh_illumos_make(1)> provides more convenient way to do this.
=over 4
-=item B<-B> B<--build>
+=item B<--build>
Unpack or pack (by B<--create-orig>) files known to be required for building illumos components.
These are F<usr/src/tools/scripts/bldenv.sh>, F<usr/src/Makefile*>,
@@ -55,10 +55,9 @@ Do not pack or unpack files or directories matching I<PATTERN>.
This option can be used multiple times. I<PATTERN> is passed
as is to L<tar(1)> via I<--exclude=PATTERN>.
-=item B<-D>I<destdir> B<--destdir=>I<destdir>
+=item B<--destdir=>I<destdir>
-Copy all unpacked files into this directory, and
-make any changes in there instead of the current directory.
+Destination directory for B<--configure>, B<--checkout> and unpacking (default action).
=item B<--create-orig>
@@ -75,6 +74,16 @@ and then configure it.
Only unpack illumos-gate tarball, do not configure.
+=item B<--checkout=>I<git-hash>
+
+Clone illumos-gate git repository and checkout I<git-hash> in there.
+Could be used for B<--create-orig>. Repository is https://github.com/illumos/illumos-gate.git,
+unless specified by B<--repository>. You should also set B<--destdir>.
+
+=item B<--repository=>I<URI>
+
+illumos-gate git repository. Default is https://github.com/illumos/illumos-gate.git.
+
=back
=head1 EXAMPLES
@@ -117,6 +126,11 @@ then add F<usr/src/uts/common/sys/>
dh_illumos_gate --unpack-only files...
dh_illumos_gate --create-orig files...
+=item Create new orig tarball
+
+ dh_illumos_gate --checkout=a5723... --destdir=foo
+ dh_illumos_gate --create-orig foo/usr/src
+
=back
=head1 FILES
@@ -143,15 +157,18 @@ Here are things which this helper does after unpacking illumos sources.
=cut
-$dh{DESTDIR} = '.';
+$dh{DESTDIR} = '.';
+$dh{REPOSITORY} = 'https://github.com/illumos/illumos-gate.git';
init(
options => {
- 'build|B' => \$dh{BUILD},
- 'destdir|D=s' => \$dh{DESTDIR},
- 'create-orig' => \$dh{CREATE_ORIG},
- 'configure' => \$dh{CONFIGURE},
- 'unpack-only' => \$dh{UNPACK_ONLY},
+ 'build' => \$dh{BUILD},
+ 'checkout=s' => \$dh{CHECKOUT},
+ 'configure' => \$dh{CONFIGURE},
+ 'create-orig' => \$dh{CREATE_ORIG},
+ 'destdir=s' => \$dh{DESTDIR},
+ 'repository=s' => \$dh{REPOSITORY},
+ 'unpack-only' => \$dh{UNPACK_ONLY},
}
);
@@ -168,7 +185,15 @@ if ( defined( $dh{'EXCLUDE'} ) && $dh{'EXCLUDE'} ) {
}
}
-if ( $dh{CREATE_ORIG} ) {
+if ( $dh{CHECKOUT} ) {
+ if ( -e $dh{DESTDIR} ) {
+ error("Destination path `$dh{DESTDIR}' exists.");
+ }
+ doit( 'git', 'clone', '-n', $dh{REPOSITORY}, $dh{DESTDIR} );
+ complex_doit(qq(cd $dh{DESTDIR} && git checkout $dh{CHECKOUT}));
+ exit;
+}
+elsif ( $dh{CREATE_ORIG} ) {
my $source = $changelog->{'Source'};
my $source_version = $version =~ s!^(.*)-[^-]+$!$1!r;
my $tarball = "$cwd/../${source}_${source_version}.orig.tar.xz";
@@ -210,8 +235,11 @@ elsif ( $dh{CONFIGURE} ) {
}
doit( 'mkdir', '-p', $dh{DESTDIR} );
doit( 'cp', '-a', 'usr', "$dh{DESTDIR}/usr" );
+
+ # fall through
}
else {
+ # Default is to unpack for backward compatibility
my $ver;
if ( $version =~ /^(\d+(\.\d+)+(\.git\w+)?).*$/ ) {