Package: piuparts
Version: 0.84
Severity: normal
Tags: patch

Hi holger, I've moved the creation of ${ENV}/dev/null ASAP, because in some
environments it is created as a regular file and then `apt-get update` hangs
forever.

-- 
TiN
From afbee5ef7a72bc29cc18452c34e3c8b8cd97a602 Mon Sep 17 00:00:00 2001
From: Agustin Henze <t...@aayy.com.ar>
Date: Tue, 10 Apr 2018 16:58:19 -0300
Subject: [PATCH 1/2] Create ${ENV}/dev/null if it doesn't exist ASAP

Signed-off-by: Agustin Henze <t...@aayy.com.ar>
---
 piuparts.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/piuparts.py b/piuparts.py
index 90a2851b..16df93d7 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1134,6 +1134,8 @@ class Chroot:
         self.create_resolv_conf()
         for bindmount in settings.bindmounts:
             self.mount(bindmount, bindmount, opts="bind")
+        if not os.path.exists(self.name + '/dev/null'):
+            run(['mknod', '-m' ,'666', self.name + '/dev/null', 'c', '1', '3'])
 
     def remember_available_md5(self):
         """Keep a history of 'apt-cache dumpavail | md5sum' after initial
@@ -1416,9 +1418,6 @@ class Chroot:
                     'broken-symlink',
             ]
             ignored_tags = []
-            if not os.path.exists(self.name + '/dev/null'):
-                device = os.makedev(1, 3)
-                os.mknod(self.name + '/dev/null', 0o666, device)
             (status, output) = run(["adequate", "--root", self.name] + packages, ignore_errors=True)
             for tag in ignored_tags:
                 # ignore some tags
-- 
2.17.0

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to