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.000000000 +0200
+++ svn-buildpackage-0.6.14/debian/changelog 2006-09-19 15:22:26.000000000 +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.000000000 +0200
+++ svn-buildpackage-0.6.14/doc/svn-buildpackage.1 2006-09-19 15:20:57.000000000 +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.000000000 +0200
+++ svn-buildpackage-0.6.14/svn-buildpackage 2006-09-19 15:17:41.000000000 +0200
@@ -38,6 +38,7 @@
--svn-pkg PACKAGE Specifies the package name
--svn-export Just prepares the build directory and exits
--svn-reuse Reuse 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 package detected, needing some kind of upstream source for
@@ -387,34 +398,34 @@
print "Reusing old build directory\n" if $opt_verbose;
}
else {
- withecho "tar", "zxf", $origfile, "-C", "$ba/tmp-$mod";
+ runcmd "tar", "zxf", $origfile, "-C", "$ba/tmp-$mod";
my @entries = (<$ba/tmp-$mod/*>);
if (@entries == 1) {
# The files are stored in the archive under a top directory, we
# presume
- withecho "mv", (<$ba/tmp-$mod/*>), $bdir;
+ runcmd "mv", (<$ba/tmp-$mod/*>), $bdir;
}
else {
# Otherwise, we put them into a new directory
- withecho "mv", "$ba/tmp-$mod", $bdir;
+ runcmd "mv", "$ba/tmp-$mod", $bdir;
}
}
if($opt_nolinks || $opt_ignnew) {
- withecho ("svn", "--force", "export", $$c{"trunkDir"},"$bdir");
+ runcmd ("svn", "--force", "export", $$c{"trunkDir"},"$bdir");
}
else {
mkdir $bdir;
#fixme maybe rewrite to withecho
if( system("mkdir","-p", map { "$bdir/$_" } @dirs) + system ("cp", "--parents", "-laf", @files, $bdir) )
{ # cp failed...
- withecho "svn", "--force", "export", $$c{"trunkDir"},"$bdir";
+ runcmd "svn", "--force", "export", $$c{"trunkDir"},"$bdir";
}
}
- withecho "rm", "-rf", "$ba/tmp-$mod";
+ runcmd "rm", "-rf", "$ba/tmp-$mod";
}
else {
if($opt_nolinks) {
- withecho "svn","--force", "export",$$c{"trunkDir"},"$bdir";
+ runcmd "svn","--force", "export",$$c{"trunkDir"},"$bdir";
}
else {
mkdir $bdir;
@@ -426,7 +437,7 @@
#if(system ("cp", "--parents", "-laf", @files, $bdir))
{ # cp failed...
system "rm", "-rf", $bdir;
- withecho "svn", "--force", "export",$$c{"trunkDir"},$bdir;
+ runcmd "svn", "--force", "export",$$c{"trunkDir"},$bdir;
}
}
}
@@ -441,9 +452,9 @@
chomp($afile=`mktemp`);
chomp($bfile=`mktemp`);
chomp($cfile=`mktemp`);
- withecho "svn diff ".$$c{"upsCurrentUrl"}." ".$$c{"trunkUrl"}." > $afile";
- withecho "cd ".$$c{"trunkDir"}." ; svn diff > $bfile";
- withecho "combinediff $afile $bfile > $cfile";
+ runcmd "svn diff ".$$c{"upsCurrentUrl"}." ".$$c{"trunkUrl"}." > $afile";
+ runcmd "cd ".$$c{"trunkDir"}." ; svn diff > $bfile";
+ runcmd "combinediff $afile $bfile > $cfile";
open(diffin, "cat $cfile |");
}
else {
@@ -468,7 +479,7 @@
if($opt_export) { print "Build directory exported to $bdir\n"; exit 0;}
-if (!withecho(@builder,@ARGV)) {
+if (!runcmd(@builder,@ARGV)) {
system "$opt_postbuild" if($opt_postbuild);
print STDERR "build command failed in $bdir\nAborting.\n";
print STDERR "W: build directory not purged!\n";
@@ -523,7 +534,7 @@
# cleanup
if(!$opt_dontpurge) {
- withecho "rm", "-rf", $bdir if(length($tagVersion));
+ runcmd "rm", "-rf", $bdir if(length($tagVersion));
unlink $tmpfile;
unlink $afile;
unlink $bfile;
@@ -531,20 +542,20 @@
}
if($opt_lintian) {
- withecho "lintian", "$destdir/$chfile";
+ runcmd "lintian", "$destdir/$chfile";
}
if($opt_linda) {
- withecho "linda", "$destdir/$chfile";
+ runcmd "linda", "$destdir/$chfile";
}
if($opt_tag) {
system "$opt_pretag" if($opt_pretag);
checktag;
- 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);
chdir $$c{"trunkDir"};
- withecho "dch", "-D", "UNRELEASED", "-i", "NOT RELEASED YET";
+ runcmd "dch", "-D", "UNRELEASED", "-i", "NOT RELEASED YET";
print "\nI: Done! Created the next changelog entry, please commit later or revert.\n";
}
}