[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Minor wanna-build improvements



On Fri, Jul 24, 2009 at 03:08:45PM +0200, Joachim Breitner wrote:
> Hi. These patches can also be pulled from
> http://git.debian.org/?p=users/nomeata/wanna-build.git;a=summary
> (i.e. git://git.debian.org/users/nomeata/wanna-build.git)

Also merged into sbuild.git with minor modifications (attached).

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
From 9fc4eedabaeed61583c94351ffa1d1b4348330fc Mon Sep 17 00:00:00 2001
From: Joachim Breitner <nomeata@debian.org>
Date: Sat, 25 Jul 2009 12:54:47 +0100
Subject: [PATCH 2/4] wanna-build: Create valid dctrl-like output

Instead of adding the dots for empty lines when reading the input, and
adding the extra space when outputting, save the data as is and create
the correct format when outputting. This makes sure that multi-line-data
passed to -m is also represented correctly.

Signed-off-by: Roger Leigh <rleigh@debian.org>
---
 lib/Sbuild/DB/Base.pm      |    8 ++++----
 lib/WannaBuild/Database.pm |    1 -
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/Sbuild/DB/Base.pm b/lib/Sbuild/DB/Base.pm
index dfd276b..173982e 100644
--- a/lib/Sbuild/DB/Base.pm
+++ b/lib/Sbuild/DB/Base.pm
@@ -53,8 +53,8 @@ sub dump {
 	my $pkg = $self->get_package($name);
 	foreach $key (keys %{$pkg}) {
 	    my $val = $pkg->{$key};
-	    chomp( $val );
-	    $val =~ s/\n/\n /g;
+	    $val =~ s/^/ /mg;
+	    $val =~ s/^ $/ ./mg;
 	    print F "$key: $val\n";
 	}
 	print F "\n";
@@ -66,8 +66,8 @@ sub dump {
 	    if (!defined($ui->{'User'}));
 	foreach $key (keys %{$ui}) {
 	    my $val = $ui->{$key};
-	    chomp($val);
-	    $val =~ s/\n/\n /g;
+	    $val =~ s/^/ /mg;
+	    $val =~ s/^ $/ ./mg;
 	    print F "$key: $val\n";
 	}
 	print F "\n";
diff --git a/lib/WannaBuild/Database.pm b/lib/WannaBuild/Database.pm
index 9cb9523..e1f5027 100644
--- a/lib/WannaBuild/Database.pm
+++ b/lib/WannaBuild/Database.pm
@@ -168,7 +168,6 @@ sub run {
 	    while(!eof(STDIN)) {
 		$line = <STDIN>;
 		last if $line eq ".\n";
-		$line = ".\n" if $line eq "\n";
 		$log .= $line;
 	    }
 	    chomp($log);
-- 
1.6.3.3

From 788fb9a018873fe058015b1d0186641a590c4893 Mon Sep 17 00:00:00 2001
From: Joachim Breitner <nomeata@debian.org>
Date: Sat, 25 Jul 2009 12:55:14 +0100
Subject: [PATCH 3/4] wanna-build: Indent multi-line output of --info more

Since the field names are indented by two, make the mult-line fields be
indented by 4 instead of 1.

Signed-off-by: Roger Leigh <rleigh@debian.org>
---
 lib/WannaBuild/Database.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/WannaBuild/Database.pm b/lib/WannaBuild/Database.pm
index e1f5027..eb0e31a 100644
--- a/lib/WannaBuild/Database.pm
+++ b/lib/WannaBuild/Database.pm
@@ -1747,7 +1747,7 @@ sub info_packages {
 		my $val = $pkg->{$key};
 		chomp( $val );
 		$val = "\n$val" if isin( $key, qw(Failed Old-Failed));
-		$val =~ s/\n/\n /g;
+		$val =~ s/\n/\n    /g;
 		printf "  %-20s: %s\n", $key, $val;
 	    }
 	    foreach $key (sort keys %$pkg) {
@@ -1755,7 +1755,7 @@ sub info_packages {
 		my $val = $pkg->{$key};
 		chomp( $val );
 		$val = "\n$val" if isin( $key, qw(Failed Old-Failed));
-		$val =~ s/\n/\n /g;
+		$val =~ s/\n/\n    /g;
 		printf "  %-20s: %s\n", $key, $val;
 	    }
 	}
-- 
1.6.3.3

From c2a849f1c0fa9d250929fcd3fbd15aeb046fd662 Mon Sep 17 00:00:00 2001
From: Joachim Breitner <nomeata@debian.org>
Date: Sat, 25 Jul 2009 12:57:38 +0100
Subject: [PATCH 4/4] man: wanna-build: Further document --give-back

Signed-off-by: Roger Leigh <rleigh@debian.org>
---
 man/wanna-build.1.in |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/man/wanna-build.1.in b/man/wanna-build.1.in
index 7e1f63e..28b7cc9 100644
--- a/man/wanna-build.1.in
+++ b/man/wanna-build.1.in
@@ -173,10 +173,11 @@ removed from the database completely. This is for maintainence purposes, not
 for day-by-day use. A mail will be sent to the database maintainer.
 .TP
 \-\-give\-back
-If you decide to stop building a package that you have taken before (i.e.,
-which is in state Building and you're the builder), but that package hasn't
-failed, you can give it back with this option. The state changes back to
-Needs-Build.
+Mark a package as ready to build that is in state Building, Built or
+Build-Attempted. To give back a package in state Failed, use \-\-override.  If
+you decide to stop building a package that you have taken before (i.e., which
+is in state Building and you're the builder), but that package hasn't failed,
+you can give it back with this option.  The state changes back to Needs-Build.
 .TP
 \-\-merge\-quinn
 Merge quinn\-diff output into database.
-- 
1.6.3.3

Attachment: signature.asc
Description: Digital signature


Reply to: