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

potential issues on debci current code



Hello,

Looking at current debci code I found what I think is a couple of issues - As I can't push to debci, here are the patches I am proposing. If you need more explanation let me know.

more later

Regards

Thierry

From de72d29c096f5062fde2e5dd2dd84884a5b59221 Mon Sep 17 00:00:00 2001
From: Thierry Fauck <thiery@linux.vnet.ibm.com>
Date: Wed, 11 Sep 2019 09:05:54 +0200
Subject: [PATCH] Sometimes results get a nil entry

Signed-off-by: Thierry Fauck <thiery@linux.vnet.ibm.com>
---
 bin/debci-status | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/debci-status b/bin/debci-status
index fa1ae59..ceb584f 100755
--- a/bin/debci-status
+++ b/bin/debci-status
@@ -101,6 +101,7 @@ else
   results = packages.map do |p|
     read_status_file(p)
   end
+  results.reject! { |pkg| pkg.nil? }
   if !$all && results.size == 1
     puts format_field(results.first[$field])
   else
-- 
2.20.1

From fb5c91ec85cd91bf971f6570edd1b16f4bda68f1 Mon Sep 17 00:00:00 2001
From: Thierry Fauck <thiery@linux.vnet.ibm.com>
Date: Wed, 11 Sep 2019 09:03:06 +0200
Subject: [PATCH] Suite parameter is last argument of
 debci-generate-apt-sources

Signed-off-by: Thierry Fauck <thiery@linux.vnet.ibm.com>
---
 bin/debci-setup-chdist | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/debci-setup-chdist b/bin/debci-setup-chdist
index af82c46..1e5b630 100755
--- a/bin/debci-setup-chdist
+++ b/bin/debci-setup-chdist
@@ -54,21 +54,21 @@ case "$mirror" in
   (*debian*)
     debci-generate-apt-sources \
       --mirror="$mirror" \
-      --suite="$SUITE" \
       --components="$COMPONENTS" \
       --source \
       --buildd \
       --dbgsym \
       --arch="$debci_arch" \
+      "$SUITE" \
       > "$TARGET/etc/apt/sources.list"
     ;;
   (*)
     debci-generate-apt-sources \
       --mirror="$mirror" \
-      --suite="$SUITE" \
       --components="$COMPONENTS" \
       --source \
       --arch="$debci_arch" \
+      "$SUITE" \
       > "$TARGET/etc/apt/sources.list"
     ;;
 esac
-- 
2.20.1

From 75e574ce4689776a2fedad2a7126caea61941f41 Mon Sep 17 00:00:00 2001
From: Thierry Fauck <thiery@linux.vnet.ibm.com>
Date: Wed, 11 Sep 2019 08:59:11 +0200
Subject: [PATCH] test of null variable is not efficient

Signed-off-by: Thierry Fauck <thiery@linux.vnet.ibm.com>
---
 bin/debci-autopkgtest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/debci-autopkgtest b/bin/debci-autopkgtest
index df66b57..bedb069 100755
--- a/bin/debci-autopkgtest
+++ b/bin/debci-autopkgtest
@@ -8,7 +8,7 @@ if [ $# -lt 1 ]; then
 fi
 
 opts=''
-if [ "$debci_backend" != null ]; then
+if [ ! "${debci_backend+x}" ]; then
   opts='--apt-upgrade'
 fi
 
-- 
2.20.1


Reply to: