Bug#831521: uscan: Implement new 'nomktar' option on watch file

2016-07-18 Thread Gianfranco Costamagna
Hi Osamu,


>By the way, can you tall me exact case you are thinking so we know we
>are attacking the real problem (not just theoretical cases).


You can see an use case here [1] with another use case in one of my replies to
the thread, because I can't use uscan to download virtualbox-guest-additions
iso file.

[1] https://lists.debian.org/debian-mentors/2016/07/msg00389.html

hope this helps,

Gianfranco



Bug#831521: uscan: Implement new 'nomktar' option on watch file

2016-07-17 Thread Osamu Aoki
Hi,

On Sat, Jul 16, 2016 at 05:51:21PM -0400, Sergio Durigan Junior wrote:
> Package: devscripts
> Tags: patch
> 
> Hi,
> 
> Rationale: 
> 
> Some Debian maintainers have to deal with upstream projects that do not
> offer tarballs for releases.  The modus operandi for working around this
> "issue" is to provide your own replacement for the 'uupdate' script,
> which should be responsible for manipulating the file(s) downloaded from
> upstream and prepare a "fake" tarball to be provided to 'uupdate'.
> 
> This works, but has one drawback: there is no "easy" way to suppress the
> 'mk-origtargz' program to run.  And the problem with this is that
> 'mk-origtargz' expects a compressed tarball as its input, always.
> Calling it in the situation described above leads to an error.  So, the
> user is left with some non-ideal options:
> 
> 1) Invoke 'uscan' passing '--no-symlink' as one of the parameters.  This
> has the side-effect of skipping the call to 'mk-origtargz'.  The obvious
> disadvantages are: (a) it is not obvious to the user that this option
> solves the problem described above, and (b) the user will have to
> remember to pass this option every time.
> 
> 2) Hacking the 'uupdate'-replacement script in order to invoke it by
> hand.  The obvious disadvantage is that the user won't be able to use
> 'uscan', and also will have to remember this every time.
> 
> Therefore, to fix this issue, I am proposing a new option, to be
> provided via 'opts=' in the watch file, whose purpose is to suppress the
> execution of 'mk-origtargz'.  Its effect will be similar to passing
> '--no-symlink', although the user will still be able to provide
> '--rename', for example.
> 
> Opinions?

This is certainly one way to solve your problem  and I see some
people abused uupdate slot for this purpose.

But replacing uupdate (updating source tree from repackaged tarball and
old source tree) with a command for another purpose seems to complicate
situation.  We want to run your alternative command in place of
mk-origtargz.  How about ...  if debian/mk-mk-origtargz exists, use it
instead of mk-origtargz.

I know there are some resentments to run a script in debian/* but this
part is not executed when just scanning archive.  So situation is no
worse than uupdate situation.

Currently, mk-origtargz output is scanned to set some parameters so your
mk-origtargz may need to be written carefully.  That's the negative of
this approach but certainly this is another way to solve your problem.

By the way, can you tall me exact case you are thinking so we know we
are attacking the real problem (not just theoretical cases).

Note:

There is a question on how you call your alternative uupdate command
$cmd.  Currently, uscan invokes non-uupdate $cmd as:
 Version 4  : "$cmd --upstream-version "
 Version 2,3: "$cmd --upstream-version  "
 Version 1  : "$cmd  "
This  is the full path filename of the file downloaded.

Maybe, I should also make version 4 to do the same as version 3 if $cmd
is not uupdate.  If $cmd is uupdate for version 4, it calls
 Version 4  : "uupdate --find --upstream-version "
(This is because the  should be pointing the file in ../)

Anyway, these needs to be updated with documentation if this is
something needs to be done...

Osamu



Bug#831521: uscan: Implement new 'nomktar' option on watch file

2016-07-16 Thread Sergio Durigan Junior
Package: devscripts
Tags: patch

Hi,

Rationale: 

Some Debian maintainers have to deal with upstream projects that do not
offer tarballs for releases.  The modus operandi for working around this
"issue" is to provide your own replacement for the 'uupdate' script,
which should be responsible for manipulating the file(s) downloaded from
upstream and prepare a "fake" tarball to be provided to 'uupdate'.

This works, but has one drawback: there is no "easy" way to suppress the
'mk-origtargz' program to run.  And the problem with this is that
'mk-origtargz' expects a compressed tarball as its input, always.
Calling it in the situation described above leads to an error.  So, the
user is left with some non-ideal options:

1) Invoke 'uscan' passing '--no-symlink' as one of the parameters.  This
has the side-effect of skipping the call to 'mk-origtargz'.  The obvious
disadvantages are: (a) it is not obvious to the user that this option
solves the problem described above, and (b) the user will have to
remember to pass this option every time.

2) Hacking the 'uupdate'-replacement script in order to invoke it by
hand.  The obvious disadvantage is that the user won't be able to use
'uscan', and also will have to remember this every time.

Therefore, to fix this issue, I am proposing a new option, to be
provided via 'opts=' in the watch file, whose purpose is to suppress the
execution of 'mk-origtargz'.  Its effect will be similar to passing
'--no-symlink', although the user will still be able to provide
'--rename', for example.

Opinions?

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

From b40dbd4f6b052f0753aede3822a372149d8d0c7f Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior 
Date: Sat, 16 Jul 2016 17:36:29 -0400
Subject: [PATCH] uscan: Implement 'nomktar' option to allow user to specify
 when she does not want mk-origtargz to be invoked.

---
 debian/changelog |  6 ++
 scripts/uscan.pl | 11 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 3b9e5a0..3207485 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
 devscripts (2.16.7) UNRELEASED; urgency=medium
 
+  [ Paul Wise ]
   * grep-excuses:
 + Fix the script for the removal of testing.pl from release.debian.org
 
+  [ Sergio Durigan Junior ]
+  * uscan:
++ Implement 'nomktar' option to allow user to specify when she does
+  not want mk-origtargz to be invoked.
+
  -- Paul Wise   Fri, 15 Jul 2016 22:36:19 +0800
 
 devscripts (2.16.6) unstable; urgency=medium
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 9403ba6..818292e 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -408,6 +408,13 @@ No signature available. (No warning.)
 
 Decompress compressed archive before the pgp/gpg signature verification.
 
+=item B
+
+Do not invoke B after saving the downloaded file.  This
+is useful if you are dealing with files that are not tarballs, for
+example.  The side effect of this option is that no symlink will be
+created.
+
 =item B
 
 Disable all site specific special case code such as URL redirector uses and
@@ -2551,6 +2558,8 @@ sub process_watchline ($$)
 		$options{'pgpmode'} = 'mangle';
 		} elsif ($opt =~ /^\s*oversionmangle\s*=\s*(.+?)\s*$/) {
 		@{$options{'oversionmangle'}} = split /;/, $1;
+		} elsif ($opt =~ /^\s*nomktar\s*$/) {
+		$options{'nomktar'} = 1;
 		} else {
 		uscan_warn "unrecognised option $opt\n";
 		}
@@ -3700,7 +3709,7 @@ EOF
 my $mk_origtargz_out;
 my $path = "$destdir/$newfile_base";
 my $target = $newfile_base;
-unless ($symlink eq "no") {
+unless ($symlink eq "no" || $options{'nomktar'} ) {
 	my @cmd = ("mk-origtargz");
 	push @cmd, "--package", $pkg;
 	push @cmd, "--version", $common_mangled_newversion;
-- 
2.8.1



signature.asc
Description: PGP signature