Package: svn-buildpackage
Version: 0.6.14
Severity: normal
Tags: patch

Current version of svn-buildpackage doesn't support quoted strings in
the "--svn-builder" option. I needed to use: 

  --svn-builder="pdebuild --debbuildopts '-b -sa'"

But it's not possible without the included patch, since the debbuildopts
option is broken into two strings '"-b' and '-sa"'.

Mikael

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (750, 'testing'), (671, 'stable'), (30, 'unstable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-vserver-k7
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)

Versions of packages svn-buildpackage depends on:
ii  devscripts                  2.9.20       Scripts to make the life of a Debi
ii  libsvn-core-perl            1.2.3dfsg1-3 perl bindings for Subversion (aka.
ii  perl                        5.8.8-4      Larry Wall's Practical Extraction 
ii  subversion                  1.2.3dfsg1-3 advanced version control system (a
ii  subversion-tools            1.2.3dfsg1-3 assorted tools related to Subversi

svn-buildpackage recommends no packages.

-- no debconf information
--- /usr/bin/svn-buildpackage   2005-10-23 04:24:32.000000000 +0200
+++ /home/mikael/sh/svn-buildpackage2   2006-07-01 17:33:40.970749776 +0200
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 # (c) Eduard Bloch <[EMAIL PROTECTED]>, 2003
+# Copyright (C) 2006 Mikael Magnusson <[EMAIL PROTECTED]>
 # License: GPL
 # Version: $Id: svn-buildpackage 2100 2005-10-13 19:29:24Z par ame ter $
 
@@ -132,6 +133,47 @@
 
 &setallenv;
 
+sub split_command_line {
+       my ($line) = @_;
+
+       $line =~ s/^\s*//;
+       $line =~ s/\s*$//;
+
+       my @chars = split(//, $line);
+       my @args;
+       my $res = "";
+       my $quote = undef;
+       my $escape = 0;
+
+       for my $c (@chars) {
+               if ($escape) {
+                       $escape = 0;
+                       $res .= $c;
+               } elsif ($c eq '\\') {
+                       $escape = 1;
+               } elsif (!defined $quote){
+                       if ($c eq ' ') {
+                               push @args, $res;
+                               $res = "";
+                       } elsif ($c eq '\'' || $c eq '"') {
+                               $quote = $c;
+                       } else {
+                               $res .= $c;
+                       }
+               } else {
+                       if ($c eq $quote) {
+                               $quote = undef;
+                       } else {
+                               $res .= $c;
+                       }
+               }
+       }
+
+       push @args, $res unless ($res eq '');
+
+       return @args;
+}
+
 for $file ($ENV{"HOME"}."/.svn-buildpackage.conf", 
".svn/svn-buildpackage.conf") {
     
     if(open($rc, $file)) {
@@ -181,7 +223,7 @@
 
 
 if($opt_buildcmd || $opt_export) {
-   @builder = split / /, $opt_buildcmd;
+   @builder = &split_command_line( $opt_buildcmd );
    if($opt_buildcmd=~/;|\||&/) {
       print "I: Looks like a shell construct in the build command, running 
trough the shell\n";
       [EMAIL PROTECTED] = (join(" ", @builder, @ARGV));

Reply via email to