Package: sbuild
Version: 0.65.2-1
Severity: wishlist
Tags: patch

sbuild-update gives a very cryptic error when no chroot is specified:

% sbuild-update -udcar
E: Incorrect number of options
I: Run “sbuild-update --help” to list usage example and all available options

The attached patch gives a more meaningful message:

% ./bin/sbuild-update -udcar
E: No chroot was specified
I: Run “sbuild-update --help” to list usage example and all available options

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages sbuild depends on:
ii  adduser         3.113+nmu3
ii  apt-utils       1.0.9.9
ii  libsbuild-perl  0.65.2-1
ii  perl            5.20.2-6

Versions of packages sbuild recommends:
ii  debootstrap  1.0.69
ii  fakeroot     1.20.2-1

Versions of packages sbuild suggests:
pn  deborphan  <none>
ii  wget       1.16.3-2

-- Configuration Files:
/etc/sbuild/sbuild.conf changed [not included]

-- no debconf information
>From 2a5a3b146eb8daa5aba29da69c7ebfba21712463 Mon Sep 17 00:00:00 2001
From: Felipe Sateler <fsate...@debian.org>
Date: Thu, 21 May 2015 17:21:01 -0300
Subject: [PATCH] Print better message when no chroot is specified

---
 bin/sbuild-update | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/sbuild-update b/bin/sbuild-update
index cb0bd48..98e6ed4 100755
--- a/bin/sbuild-update
+++ b/bin/sbuild-update
@@ -133,9 +133,11 @@ if ($conf->get('COMPAT')) {
     $conf->set('UPDATE', 1);
 }
 
-if ((@ARGV < 1 && !$conf->get('KEYGEN')) ||
-    (@ARGV >= 1 && $conf->get('KEYGEN'))) {
-    usage_error("sbuild-update", "Incorrect number of options")
+if (@ARGV >= 1 && $conf->get('KEYGEN')) {
+    usage_error("sbuild-update", "Incorrect number of options");
+}
+if (@ARGV < 1 && !$conf->get('KEYGEN')) {
+    usage_error("sbuild-update", "No chroot was specified");
 }
 
 my $status = 0;
-- 
2.1.4

Reply via email to