Source: simple-cdd
Version: 0.6.1
Severity: normal
Tags: patch

Dear Maintainer.

After reprepo simple-cdd use debcheck for check package dependency.


For example, if we have non-free deb package with dependency of main deb
package, debcheck says error dependencies.
Because simple-cdd don't use -bg option.

I think this is wrong. So I corrected this behavior in patch.



-- System Information:
Debian Release: stretch/sid
  APT prefers xenial-updates
  APT policy: (500, 'xenial-updates'), (500, 'xenial-security'), (500,
'xenial'), (100, 'xenial-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-28-generic (SMP w/4 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
>From c04f51af33901f3b78f220b2984f77fb7fea836e Mon Sep 17 00:00:00 2001
From: Lev Borodin <faun...@gmail.com>
Date: Wed, 27 Jul 2016 12:54:22 +0500
Subject: [PATCH 3/3] Fix problem with check dependents

---
 build-simple-cdd                    | 20 ++++++++++++++++----
 simple_cdd/tools/mirror_reprepro.py | 22 ++++++++++++++++++++--
 2 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/build-simple-cdd b/build-simple-cdd
index 39c1be2..204eff0 100755
--- a/build-simple-cdd
+++ b/build-simple-cdd
@@ -550,14 +550,26 @@ class SimpleCDD:
                         continue
                     yield os.path.join(root, wanted_arch)
 
-            for pathname in find_packages_dirs(dists_root, a):
+            packages_dirs = find_packages_dirs(dists_root, a)
+
+            for pathname in packages_dirs:
+                bg_pkgfile = [os.path.join(i, "Packages.gz") for i in packages_dirs if i != pathname]
+                bg_command = []
+
+                for file in bg_pkgfile:
+                    bg_command.append('--bg')
+                    bg_command.append(file)
+
+                command = [debcheck, "--failures", "--explain"]
+                command.extend(bg_command)
+
                 pkgfile = os.path.join(pathname, "Packages.gz")
                 if not os.path.exists(pkgfile): continue
-
+                command.append(pkgfile)
                 output = io.StringIO()
                 retval = run_command(
-                    "{} {}".format(pkgfile, debcheck),
-                    [debcheck, "--failures", "--explain", pkgfile],
+                    "distcheck:",
+                    command,
                     logfd=output
                 )
                 if retval != 0:
diff --git a/simple_cdd/tools/mirror_reprepro.py b/simple_cdd/tools/mirror_reprepro.py
index 6ede389..cdf4b1b 100644
--- a/simple_cdd/tools/mirror_reprepro.py
+++ b/simple_cdd/tools/mirror_reprepro.py
@@ -269,13 +269,31 @@ class ToolMirrorReprepro(ToolShell):
             return
 
         for a in self.env.get("ARCHES"):
-            for component in self.env.get("mirror_components"):
+            mirror_components = self.env.get("mirror_components")
+            for component in mirror_components:
+
+                bg_pkgfile = [
+                    self.env.format(
+                        "{MIRROR}/dists/{CODENAME}/{component}/binary-{a}/Packages",
+                        component=i, a=a)
+                    for i in mirror_components if i != component
+                ]
+
+                bg_command = []
+                for file in bg_pkgfile:
+                    bg_command.append('--bg')
+                    bg_command.append(file)
+
+                command = [debcheck, "--failures", "--explain"]
+                command.extend(bg_command)
                 pkgfile = self.env.format(
                     "{MIRROR}/dists/{CODENAME}/{component}/binary-{a}/Packages",
                     component=component, a=a)
                 if os.stat(pkgfile).st_size == 0: continue
                 log.info("Checking package file %s using %s", pkgfile, debcheck)
-                proc = subprocess.Popen([debcheck, "--failures", "--explain", pkgfile], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+                command.append(pkgfile)
+
+                proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                 stdout, stderr = proc.communicate()
                 retval = proc.wait()
                 if retval != 0:
-- 
2.7.4

Reply via email to