diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-10-17 17:09:35 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-10-17 17:09:35 +0300 |
commit | 2c42e52f0d7eefac6152324015081733efcaed36 (patch) | |
tree | c8ecb5eaad4c23d1186101f4a37c0d1741031a91 | |
parent | f9644655d1bf1421f4b4c1bdd256feebf527194a (diff) | |
download | dh-illumos-2c42e52f0d7eefac6152324015081733efcaed36.tar.gz |
dh_illumos_gate: extract git revision
-rwxr-xr-x | dh_illumos_gate | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/dh_illumos_gate b/dh_illumos_gate index c348436..7c18f2b 100755 --- a/dh_illumos_gate +++ b/dh_illumos_gate @@ -74,9 +74,11 @@ and then configure it. Only unpack illumos-gate tarball, do not configure. -=item B<--checkout=>I<git-hash> +=item B<--checkout>[I<=git-hash>] Clone illumos-gate git repository and checkout I<git-hash> in there. +If not specified, hash is extracted from topmost version in F<debian/changelog>: +C<1.2.3.git.<hash>-4>. 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>. @@ -157,13 +159,14 @@ Here are things which this helper does after unpacking illumos sources. =cut +$dh{CHECKOUT} = undef; $dh{DESTDIR} = '.'; $dh{REPOSITORY} = 'https://github.com/illumos/illumos-gate.git'; init( options => { 'build' => \$dh{BUILD}, - 'checkout=s' => \$dh{CHECKOUT}, + 'checkout:s' => \$dh{CHECKOUT}, 'configure' => \$dh{CONFIGURE}, 'create-orig' => \$dh{CREATE_ORIG}, 'destdir=s' => \$dh{DESTDIR}, @@ -185,10 +188,13 @@ if ( defined( $dh{'EXCLUDE'} ) && $dh{'EXCLUDE'} ) { } } -if ( $dh{CHECKOUT} ) { +if ( defined $dh{CHECKOUT} ) { if ( -e $dh{DESTDIR} ) { error("Destination path `$dh{DESTDIR}' exists."); } + if ( !$dh{CHECKOUT} ) { + $dh{CHECKOUT} = $version =~ s!.*\.git\.(\w+)-[^-]+$!$1!r; + } doit( 'git', 'clone', '-n', $dh{REPOSITORY}, $dh{DESTDIR} ); doit( 'git', '-C', $dh{DESTDIR}, 'checkout', $dh{CHECKOUT} ); exit; |