Bug#349979: svn-buildpackage: Cannot be used non-interactively.

2006-09-19 Thread Gonéri Le Bouder
Hi,

I attached a patch to add this feature.

Regards,

Gonéri
Index: svn-buildpackage-0.6.14/debian/changelog
===
--- svn-buildpackage-0.6.14.orig/debian/changelog	2006-09-19 15:21:13.0 +0200
+++ svn-buildpackage-0.6.14/debian/changelog	2006-09-19 15:22:26.0 +0200
@@ -1,3 +1,10 @@
+svn-buildpackage (0.6.15) unstable; urgency=low
+
+  [ Gonéri Le Bouder ]
+  * add --svn-noninteractive feature
+
+ -- Eduard Bloch [EMAIL PROTECTED]  Tue, 19 Sep 2006 15:21:54 +0200
+
 svn-buildpackage (0.6.14) unstable; urgency=low
 
   * made the .changes file lookup code more robust, not failing on missing
Index: svn-buildpackage-0.6.14/doc/svn-buildpackage.1
===
--- svn-buildpackage-0.6.14.orig/doc/svn-buildpackage.1	2006-09-19 15:18:03.0 +0200
+++ svn-buildpackage-0.6.14/doc/svn-buildpackage.1	2006-09-19 15:20:57.0 +0200
@@ -107,6 +107,9 @@
 \fB \-\-svn\-prebuild, \-\-svn\-postbuild, \-\-svn\-pretag, \-\-svn\-posttag\fR
 Commands (hooks) to be executed before/after the build/tag command invocations.
 Examples to fetch the orig tarball from a local pool (trying pool/libX/... to):
+.TP
+\fB \-\-svn\-noninteractive\fR
+With this parameter svn-buildpackage will not interact with use
 .P
 .RS
 .PD 0
@@ -189,6 +192,10 @@
 .TP
 \fBFORCEEXPORT\fR
 Export upstream source from the repository even if mergeWithUpstream property is set
+.TP
+\fBDEBIAN_FRONTEND\fR
+If DEBIAN_FRONTEND is set to 'noninteractive' --svn-noninteractive is called
+silently
 
 .SH RECOMMENDATIONS
 First thing, using shell aliases makes sense. Example for the Bash:
Index: svn-buildpackage-0.6.14/svn-buildpackage
===
--- svn-buildpackage-0.6.14.orig/svn-buildpackage	2006-09-19 15:09:37.0 +0200
+++ svn-buildpackage-0.6.14/svn-buildpackage	2006-09-19 15:17:41.0 +0200
@@ -38,6 +38,7 @@
   --svn-pkg PACKAGE  Specifies the package name
   --svn-export   Just prepares the build directory and exits
   --svn-reuseReuse an existing build directory, copy trunk over it
+  --svn-noninteractive Don't ask question
 
 If the debian directory has the mergeWithUpstream property, svn-buildpackage
 will extract .orig.tar.gz file first and add the Debian files to it.
@@ -56,6 +57,7 @@
 my $opt_lintian;
 my $opt_linda;
 my $opt_nolinks;
+my $opt_noninteractive;
 my $opt_pretag;
 my $opt_prebuild;
 my $opt_posttag;
@@ -82,6 +84,7 @@
svn-lintian   = \$opt_lintian,
svn-linda   = \$opt_linda,
svn-no-links  = \$opt_nolinks,
+   svn-noninteractive= \$opt_noninteractive,
svn-pass-diff  = \$opt_pass_diff,
svn-prebuild=s = \$opt_prebuild,
svn-postbuild=s = \$opt_postbuild,
@@ -132,6 +135,14 @@
 
 setallenv;
 
+sub runcmd {
+  if ($ENV{DEBIAN_FRONTEND} =~ /^noninteractive$/ || $opt_noninteractive) {
+withecho(@_);
+} else {
+withechoNoPrompt(@_);
+}
+}
+
 for $file ($ENV{HOME}./.svn-buildpackage.conf, .svn/svn-buildpackage.conf) {
 
 if(open($rc, $file)) {
@@ -169,7 +180,7 @@
 $SDCommon::opt_verbose=$opt_verbose;
 $package = $SDCommon::package if(!$package);
 
-withecho fakeroot debian/rules clean || debian/rules clean if ! ($opt_dontclean || (`svn proplist debian` =~ /mergeWithUpstream/i));
+runcmd fakeroot debian/rules clean || debian/rules clean if ! ($opt_dontclean || (`svn proplist debian` =~ /mergeWithUpstream/i));
 SDCommon::check_uncommited if(!$opt_ignnew);
 
 SDCommon::configure;
@@ -224,7 +235,7 @@
 sub checktag {
if(insvn($$c{tagsUrl}./$tagVersion)) {
   if($opt_retag) {
- withecho (svn, -m, $scriptname Removing old tag $package-$tagVersion, rm, $$c{tagsUrl}./$tagVersion);
+ runcmd (svn, -m, $scriptname Removing old tag $package-$tagVersion, rm, $$c{tagsUrl}./$tagVersion);
   }
   else {
  die Could not create tag copy\n.
@@ -243,9 +254,9 @@
checktag;
chdir $$c{trunkDir};
system $opt_pretag if($opt_pretag);
-   withecho (svn, -m, $scriptname Tagging $package ($tagVersion), cp, $$c{trunkUrl}, $$c{tagsUrl}./$tagVersion);
+   runcmd (svn, -m, $scriptname Tagging $package ($tagVersion), cp, $$c{trunkUrl}, $$c{tagsUrl}./$tagVersion);
system $opt_posttag if($opt_posttag);
-   withecho dch -D UNRELEASED -i \NOT RELEASED YET\;
+   runcmd dch -D UNRELEASED -i \NOT RELEASED YET\;
print \nI: Done! Last commit pending, please execute manually.\n;
SDCommon::sd_exit 0;
 }
@@ -290,8 +301,8 @@
needs_upsCurrentUrl;
$upsVersUrl=$$c{upsTagUrl}./$upVersion;
defined($$c{upsCurrentUrl}) || print STDERR upsCurrentUrl not set and not located, expect problems...\n;
-   withecho(rm, -rf, $bdir.orig);
-   withecho svn, export,$$c{upsCurrentUrl},$bdir.orig;
+   runcmd(rm, -rf, $bdir.orig);
+   runcmd svn, export,$$c{upsCurrentUrl},$bdir.orig;
 }
 
 # non-Debian-native 

Bug#349979: svn-buildpackage: Cannot be used non-interactively.

2006-01-26 Thread John Morton
Package: svn-buildpackage
Version: 0.6.7
Severity: wishlist

svn-buildpackage will prompt the user to either quit, retry or ignore
errors that crop up during a build. This isn't particularly helpful in
a non-interactive build situation, like a nightly build, however.

Is there any chance we can get an option to always quit on errors?

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.14-amd-contextify
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)

Versions of packages svn-buildpackage depends on:
ii  devscripts 2.8.14Scripts to make the life of a Debi
ii  perl   5.8.4-8sarge3 Larry Wall's Practical Extraction 
ii  subversion 1.1.4-3   advanced version control system (a
ii  subversion-tools   1.1.4-3   assorted tools related to Subversi

-- debconf-show failed


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]