Bug#831521: Custom repacking
Sergio Durigan Junior
sergiodj at sergiodj.net
Sun Aug 27 21:24:43 UTC 2017
On Sunday, August 27 2017, Osamu Aoki wrote:
> Hi,
>
> Just because uupdate entry in watch file enables to run custom script,
> abusing it is not good idea.
>
> uscan deligates its key functions to:
> * repacking of upstream tarball/signature -- mk-origtargz
> * updating new sorce tree -- uupdate
>
> So adding uscan a capability to run custom script in place of calling
> mk-origtargz is the right approach.
>
> That's exactly like repack.stub discussed in # 858319
>
> I need to address these bugs without making overcomplicated uscan to do
> more work. Maybe if debian/mk-origtargz exists, it is used instead of
> the default one. That's simple. This also enables if someone have
> good script, I can merge into mk-origtargz.
Hi Osamu,
Thanks for following up this bug. I confess I had forgotten about it!
Anyway, I took the liberty and implemented the following mostly-untested
patch to uscan which uses your idea and executes debian/mk-origtargz (if
it exists and is executable) instead of the system's mk-origtargz.
What do you thing?
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index f871daf2..49a7acb2 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -60,8 +60,9 @@ than the last upstream version.
=item * B<uscan> saves the downloaded tarball to the parent B<../> directory:
I<< ../<upkg>-<uversion>.tar.gz >>
-=item * B<uscan> invokes B<mk-origtargz> to create the source tarball: I<<
-../<spkg>_<oversion>.orig.tar.gz >>
+=item * B<uscan> invokes B<mk-origtargz> to create the source tarball:
+I<< ../<spkg>_<oversion>.orig.tar.gz >> (if F<debian/mk-origtargz>
+exists and is executable, then execute it instead).
=over
@@ -706,7 +707,8 @@ doesn't work.
B<uscan> invokes B<mk-origtargz> to create the source tarball properly named
for the source package with B<.orig.> (or B<< .orig-<component>. >> for the
-secondary tarballs) in its filename.
+secondary tarballs) in its filename. If F<debian/mk-origtargz> exists and is
+executable, then B<uscan> invokes it instead.
=over
@@ -3764,7 +3766,15 @@ EOF
my $path = "$destdir/$newfile_base";
my $target = $newfile_base;
unless ($symlink eq "no") {
- my @cmd = ("mk-origtargz");
+ my @cmd = ();
+ if (-x 'debian/mk-origtargz') {
+ # If the user has specified a personalized 'mk-origtargz'
+ # under debian/, we use it instead of the system script.
+ push @cmd "debian/mk-origtargz";
+ uscan_verbose "Using debian/mk-origtargz instead of mk-origtargz\n";
+ } else {
+ push @cmd "mk-origtargz";
+ }
push @cmd, "--package", $pkg;
push @cmd, "--version", $common_mangled_newversion;
push @cmd, '--repack-suffix', $options{repacksuffix} if defined $options{repacksuffix};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/devscripts-devel/attachments/20170827/b3a0df5b/attachment.sig>
More information about the devscripts-devel
mailing list