summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-10-15 10:39:17 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-10-15 10:39:17 +0300
commit467b74e66a0943e6d967453c64a50c9f795a9da2 (patch)
treea17afcf4829aeb6e630f16e7686d781ba3dd52bc
parent518a74bbe09ffe34f186b3f798024ed9d42ab636 (diff)
downloaddh-illumos-467b74e66a0943e6d967453c64a50c9f795a9da2.tar.gz
Checkout illumos gate
-rw-r--r--debian/control1
-rwxr-xr-xdh_illumos_gate50
2 files changed, 40 insertions, 11 deletions
diff --git a/debian/control b/debian/control
index 07e4ab3..abc7404 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Multi-Arch: foreign
Depends: ${perl:Depends}, ${misc:Depends}, debhelper,
ksh93, make, ld-gnu-to-sun,
onbld, tar (>= 1.28),
+Recommends: git
Breaks: onbld (<< 4.3)
Enhances: debhelper
Description: debhelper addons to work with illumos sources
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+)?).*$/ ) {