[Buildd-tools-devel] Patches for sbuild and buildd packages

Otavio Salvador otavio at debian.org
Wed Mar 29 15:18:15 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello folks,

Since we're using buildd and sbuild here at O.S. Systems, we built
some patches around it that I would like to whare with Debian to have
them merged if you think it's the case.

Bellow I provide my current patchset against current svn of
buildd. Feel free to apply any of it.

-------------- next part --------------
Index: debian/changelog
===================================================================
--- debian/changelog	(revis??o 97)
+++ debian/changelog	(c??pia de trabalho)
@@ -1,5 +1,5 @@
-wanna-build (2006.01.08) stable; urgency=high
+wanna-build (2006.03.15+oss1) stable; urgency=high
 
   * Initial non-release. [*DO NOT USE THESE DEBS*]
 
- -- Ryan Murray <rmurray at debian.org>  Sun,  8 Jan 2006 15:37:11 -0800
+ -- Otavio Salvador <otavio at debian.org>  Wed, 15 Mar 2006 21:46:19 -0300
Index: sbuild
===================================================================
--- sbuild	(revis??o 97)
+++ sbuild	(c??pia de trabalho)
@@ -88,6 +88,9 @@
 
 %main::dist_order = ( 'oldstable-security' => 0, stable => 1, 'stable-security' => 1, testing => 2, 'testing-security' => 2, unstable => 3 );
 
+# use user setting
+%main::dist_order = %conf::dist_order if %conf::dist_order;
+
 chomp( $main::arch = `$conf::dpkg --print-installation-architecture` );
 $main::username = (getpwuid($<))[0] || $ENV{'LOGNAME'} || $ENV{'USER'};
 $main::debug = 0;
Index: buildd
===================================================================
--- buildd	(revis??o 97)
+++ buildd	(c??pia de trabalho)
@@ -466,7 +466,7 @@
 
 	my @sbuild_args = ( 'nice', '-n', "$conf::nice_level", 'sbuild',
 			    '--batch', "--stats-dir=$main::HOME/stats",
-			    "--dist=$dist" );
+			    "--dist=$dist", "--arch-all" );
 	my $sbuild_gb = '--auto-give-back';
 	if ($conf::sshcmd) {
 		$sbuild_gb .= "=";
Index: buildd-reply.el
===================================================================
--- buildd-reply.el	(revis??o 97)
+++ buildd-reply.el	(c??pia de trabalho)
@@ -21,47 +21,69 @@
 ;;; $Id$
 ;;;
 
+;;; Set this for 'rmail or 'gnus depending of your mail client
+(defvar mail-client 'gnus)
+
 (defun buildd-prepare-mail (label send-now &rest ins)
-  (if label
-	  (rmail-set-label label t))
-  (rmail-reply t)
-  (goto-char (point-max))
+  (cond ((eq mail-client 'rmail)
+	 (if label 
+	     (rmail-add-label label))
+	 (rmail-reply t))
+	((eq mail-client 'gnus)
+	 (gnus-summary-reply)))
+  
+  (if (message-goto-signature)
+      (if message-signature-insert-empty-line
+	  (forward-line -2) (forward-line -1)))
+  (delete-region (point) (point-max))
+
   (while ins
-	(insert (car ins))
-	(setq ins (cdr ins)))
+    (insert (car ins))
+    (setq ins (cdr ins)))
   (if send-now
-      (mail-send-and-exit nil)))
+      (message-send-and-exit nil)))
 
 ;; Reply to buildd logs with a signed .changes file (which must be
 ;; extracted from the mail)
 (defun buildd-reply-ok ()
+  (when (eq mail-client 'gnus)
+    (gnus-summary-select-article-buffer))
+
   (interactive)
   (save-excursion
     (let (beg end str)
       (goto-char (point-max))
       (if (not (re-search-backward "^[^ 	]*\\.changes:$"))
-		  (error "Can't find .changes: line"))
+	  (error "Can't find .changes: line"))
       (forward-line 1)
       (beginning-of-line)
       (setq beg (point))
       (if (not (re-search-forward "^Files: $"))
-		  (error "Can't find Files: line"))
+	  (error "Can't find Files: line"))
       (beginning-of-line)
       (forward-line 1)
       (while (looking-at "^ ")
-		(forward-line 1))
+	(forward-line 1))
       (setq end (point))
       (setq str (buffer-substring beg end))
-	  (rmail-set-label "ok" t)
+
+      (cond ((eq mail-client 'rmail)
+	     (rmail-set-label "ok" t)
+	     (rmail-reply t))
+	    ((eq mail-client 'gnus)
+	     (gnus-summary-reply)))
       
-      (rmail-reply t)
-      (goto-char (point-max))
+      (if (message-goto-signature)
+	  (if message-signature-insert-empty-line
+	      (forward-line -2) (forward-line -1)))
+      (delete-region (point) (point-max))
+
       (setq beg (point))
       (insert str)
       (goto-char (point-max))
       (setq end (point))
       (mc-sign-region 0 beg end)
-      (mail-send-and-exit nil))))
+      (message-send-and-exit nil))))
 
 (defun buildd-reply-newversion ()
   (interactive)
@@ -150,36 +172,45 @@
 (defun buildd-bug ()
   (interactive)
   (save-excursion
-	(let (pkgv pkg vers dist time)
-	  (goto-char (point-min))
-	  (if (not (re-search-forward "^Subject: Log for .* build of \\([^ 	][^ 	]*\\)_\\([^ 	][^ 	]*\\) (dist=\\([a-z]*\\))"))
-		  (error "Can't find package+version in subject"))
-	  (setq pkg (buffer-substring (match-beginning 1) (match-end 1))
-			vers (buffer-substring (match-beginning 2) (match-end 2))
-			dist (buffer-substring (match-beginning 3) (match-end 3)))
-	  (setq pkgv (concat pkg "_" vers))
-	  (if (not (re-search-forward "^Build started at \\([0-9-]*\\)"))
-		  (error "Can't find package+version in subject"))
-	  (setq time (buffer-substring (match-beginning 1) (match-end 1)))
-	  (rmail-set-label "bug" t)
+    (when (eq mail-client 'gnus)
+      (gnus-summary-select-article-buffer))
+
+    (let (pkgv pkg vers dist time)
+      (goto-char (point-min))
+      (if (not (re-search-forward "^Subject: Log for .* build of \\([^ 	][^ 	]*\\)_\\([^ 	][^ 	]*\\) (dist=\\([a-z]*\\))"))
+	  (error "Can't find package+version in subject"))
+      (setq pkg (buffer-substring (match-beginning 1) (match-end 1))
+	    vers (buffer-substring (match-beginning 2) (match-end 2))
+	    dist (buffer-substring (match-beginning 3) (match-end 3)))
+      (setq pkgv (concat pkg "_" vers))
+      (if (not (re-search-forward "^Build started at \\([0-9-]*\\)"))
+	  (error "Can't find package+version in subject"))
+      (setq time (buffer-substring (match-beginning 1) (match-end 1)))
 	  
-	  (rmail-mail)
-	  (goto-char (point-min))
-	  (end-of-line)
-	  (insert "submit at bugs.debian.org")
-	  (forward-line 1)
-	  (end-of-line)
-	  (insert (concat pkgv "(" dist "): "))
-	  (goto-char (point-max))
-	  (insert
-	   (concat "Package: " pkg "\nVersion: " vers
-			   "\nSeverity: important\n\n\n"
-			   "A complete build log can be found at\n"
-			   buildd-log-base-addr pkgv "_" time "\n"))
-	  (goto-char (point-min))
-	  (forward-line 1)
-	  (end-of-line))))
+      (cond ((eq mail-client 'rmail)
+	     (rmail-set-label "bug" t)
+	     (rmail-mail))
+	    ((eq mail-client 'gnus)
+	     (gnus-summary-mail-other-window)))
 
+      (message-goto-to)
+      (insert "submit at bugs.debian.org")
+      (message-goto-subject)
+      (insert (concat pkgv "(" dist "): "))
+
+      (if (message-goto-signature)
+	  (if message-signature-insert-empty-line
+	      (forward-line -2) (forward-line -1)))
+      (delete-region (point) (point-max))
+
+      (insert (concat "Package: " pkg "\nVersion: " vers
+		      "\nSeverity: important\n\n\n"
+		      "A complete build log can be found at\n"
+		      buildd-log-base-addr pkgv "_" time "\n"))
+      (goto-char (point-min))
+      (forward-line 1)
+      (end-of-line))))
+
 (defvar buildd-mail-addr "buildd")
 
 (defun buildd-bug-ack-append (edit-addr)
@@ -204,7 +235,7 @@
 	  (goto-char (point-max))
 	  (insert (concat "fail\n(see #" bugno ")\n"))
 	  (if (null edit-addr)
-		  (mail-send-and-exit nil)
+		  (message-send-and-exit nil)
 		(progn (goto-char (point-min)) (forward-word 2) (forward-word -1))))))
 
 (defun buildd-bug-comment ()
@@ -259,7 +290,7 @@
 	  (goto-char (point-max))
 	  (insert (concat "fail\n[" cat "]\n"))
 	  (if (null edit-addr)
-		  (mail-send-and-exit nil)
+		  (message-send-and-exit nil)
 		(progn (goto-char (point-min)) (forward-word 2) (forward-word -1))))))
 
 (defun buildd-reopen-bug (bugno)
@@ -342,22 +373,43 @@
 		(insert ", "))
 	(buildd-find-place-for-new-source-dep package)))
 
-(require 'rmail)
-(add-hook 'rmail-mode-hook
-		  (lambda ()
-			(define-key rmail-mode-map "\C-c\C-o" 'buildd-reply-ok)
-			(define-key rmail-mode-map "\C-c\C-n" 'buildd-reply-newversion)
-			(define-key rmail-mode-map "\C-c\C-r" 'buildd-reply-retry)
-			(define-key rmail-mode-map "\C-c\C-d" 'buildd-reply-depretry)
-			(define-key rmail-mode-map "\C-c\C-m" 'buildd-reply-manual)
-			(define-key rmail-mode-map "\C-c\C-p" 'buildd-reply-purge)
-			(define-key rmail-mode-map "\C-c\C-f" 'buildd-reply-fail)
-			(define-key rmail-mode-map "\C-c\M-g" 'buildd-reply-giveback)
-			(define-key rmail-mode-map "\C-c\M-n" 'buildd-reply-notforus)
-			(define-key rmail-mode-map "\C-c\C-s" 'buildd-edit-manual-source-deps)
-			(define-key rmail-mode-map "\C-c\C-b" 'buildd-bug)
-			(define-key rmail-mode-map "\C-c\M-b" 'buildd-reopen-bug)
-			(define-key rmail-mode-map "\C-c\C-a\C-n" 'buildd-bug-ack-append)
-			(define-key rmail-mode-map "\C-c\C-a\C-a" 'buildd-bug-comment)
-			(define-key rmail-mode-map "\C-c\C-a\C-c" 'buildd-bug-change-category)))
-(global-set-key "\C-c\C-v" 'buildd-add-sd-map)
+;; (require 'mailcrypt)
+;; (cond ((eq mail-client 'rmail)
+;;        (require 'rmail)
+;;        (add-hook 'rmail-mode-hook
+;; 		 (lambda ()
+;; 		   (define-key rmail-mode-map "\C-c\C-o" 'buildd-reply-ok)
+;; 		   (define-key rmail-mode-map "\C-c\C-n" 'buildd-reply-newversion)
+;; 		   (define-key rmail-mode-map "\C-c\C-r" 'buildd-reply-retry)
+;; 		   (define-key rmail-mode-map "\C-c\C-d" 'buildd-reply-depretry)
+;; 		   (define-key rmail-mode-map "\C-c\C-m" 'buildd-reply-manual)
+;; 		   (define-key rmail-mode-map "\C-c\C-p" 'buildd-reply-purge)
+;; 		   (define-key rmail-mode-map "\C-c\C-f" 'buildd-reply-fail)
+;; 		   (define-key rmail-mode-map "\C-c\M-g" 'buildd-reply-giveback)
+;; 		   (define-key rmail-mode-map "\C-c\M-n" 'buildd-reply-notforus)
+;; 		   (define-key rmail-mode-map "\C-c\C-s" 'buildd-edit-manual-source-deps)
+;; 		   (define-key rmail-mode-map "\C-c\C-b" 'buildd-bug)
+;; 		   (define-key rmail-mode-map "\C-c\M-b" 'buildd-reopen-bug)
+;; 		   (define-key rmail-mode-map "\C-c\C-a\C-n" 'buildd-bug-ack-append)
+;; 		   (define-key rmail-mode-map "\C-c\C-a\C-a" 'buildd-bug-comment)
+;; 		   (define-key rmail-mode-map "\C-c\C-a\C-c" 'buildd-bug-change-category))))
+;;       ((eq mail-client 'gnus)
+;;        (require 'gnus)
+;;        (add-hook 'gnus-summary-mode-hook (lambda ()
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-o" 'buildd-reply-ok)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-n" 'buildd-reply-newversion)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-r" 'buildd-reply-retry)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-d" 'buildd-reply-depretry)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-m" 'buildd-reply-manual)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-p" 'buildd-reply-purge)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-f" 'buildd-reply-fail)
+;; 					   (define-key gnus-summary-mode-map "\C-c\M-g" 'buildd-reply-giveback)
+;; 					   (define-key gnus-summary-mode-map "\C-c\M-n" 'buildd-reply-notforus)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-s" 'buildd-edit-manual-source-deps)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-b" 'buildd-bug)
+;; 					   (define-key gnus-summary-mode-map "\C-c\M-b" 'buildd-reopen-bug)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-a\C-n" 'buildd-bug-ack-append)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-a\C-a" 'buildd-bug-comment)
+;; 					   (define-key gnus-summary-mode-map "\C-c\C-a\C-c" 'buildd-bug-change-category)))))
+
+;; (global-set-key "\C-c\C-v" 'buildd-add-sd-map)
Index: wanna-build
===================================================================
--- wanna-build	(revis??o 97)
+++ wanna-build	(c??pia de trabalho)
@@ -59,6 +59,11 @@
 $mail_logs = "";
 @distributions = qw(oldstable-security stable testing unstable stable-security testing-security);
 %dist_order = ( 'oldstable-security' => 0, stable => 1, 'stable-security' => 1, testing => 2, 'testing-security' => 2, unstable => 3 );
+
+# use user setting for it
+ at distributions = @conf::distributions if @conf::distributions;
+%dist_order = %conf::dist_order if %conf::dist_order;
+
 $curr_date = strftime("%Y %b %d %H:%M:%S",localtime);
 $short_date = strftime("%m/%d/%y",localtime);
 $| = 1;
-------------- next part --------------

There's some specific changes like the build of arch all packages
since we're using source-only uploads here. There's also a fix to
support Gnus in the elisp code. Of course, we're open for any
questions and critics since we're trying to use it to hit the highest
quality that we can and we're also wanting to contrib back all
improvement that we do inside of our structure.

Thanks in advance,

- -- 
        O T A V I O    S A L V A D O R
- ---------------------------------------------
 E-mail: otavio at debian.org      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://www.freedom.ind.br/otavio
- ---------------------------------------------
"Microsoft gives you Windows ... Linux gives
 you the whole house."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFEKqU2LqiZQEml+FURAidWAKCiWSfyA03bmvmEaJ4lCslmXkLARgCfW37M
q4zzsRRHM6EA+sXSmmMiG9k=
=3mhI
-----END PGP SIGNATURE-----


More information about the Buildd-tools-devel mailing list