Your message dated Sat, 01 Jul 2023 20:49:38 +0000
with message-id <e1qfhxg-004lo4...@fasolo.debian.org>
and subject line Bug#1021060: fixed in apt-clone 0.4.3+nmu2
has caused the Debian Bug report #1021060,
regarding apt-clone fails when the lsb_release Python module is not available
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
1021060: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021060
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: apt-clone
Version: 0.4.3+nmu1
Severity: serious
Tags: patch
apt-clone currently fails when the `lsb_release` Python module is not
available, as it is the case since 2022-09-26 in Debian unstable.
The attached patch (tested via autopkgtest) makes `apt-clone` use the
`lsb_release` command when the namesake Python module is not available.
Regards,
--
Gioele Barabucci
From 994c8d7149f688eeab7b89b1797ec15b3ddddb5d Mon Sep 17 00:00:00 2001
From: Gioele Barabucci <gio...@svario.it>
Date: Sat, 1 Oct 2022 13:11:38 +0200
Subject: [PATCH] Run lsb_release as command if the Python modules is not
available
apt-clone currently fails when the `lsb_release` Python module
is not available, as it is the case since 2022-09-26 in Debian unstable.
The attached patch makes `apt-clone` use the `lsb_release` command
when the namesake Python module is not available.
---
apt-clone | 9 +++++++--
apt_clone.py | 14 +++++++++++---
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/apt-clone b/apt-clone
index 20b2f60..4633a8f 100755
--- a/apt-clone
+++ b/apt-clone
@@ -21,6 +21,7 @@ from __future__ import print_function
import argparse
import os
+import subprocess
import sys
from apt_clone import AptClone
@@ -132,8 +133,12 @@ if __name__ == "__main__":
# packages because they are probably new defaults pkgs. If however
# we are not yet on the new release its fine to remove installed
# pkgs as part of the upgrade
- import lsb_release
- codename = lsb_release.get_os_release()["CODENAME"]
+ try:
+ import lsb_release
+ codename = lsb_release.get_os_release()["CODENAME"]
+ except ImportError:
+ codename = subprocess.getoutput("lsb_release --codename --short")
+
if (args.new_distro_codename and args.new_distro_codename == codename):
protect_installed = True
else:
diff --git a/apt_clone.py b/apt_clone.py
index 0598d2a..0351f2c 100644
--- a/apt_clone.py
+++ b/apt_clone.py
@@ -26,7 +26,10 @@ import fnmatch
import glob
import hashlib
import logging
-import lsb_release
+try:
+ import lsb_release
+except ImportError:
+ lsb_release = None
import os
import re
import shutil
@@ -71,8 +74,10 @@ class LowLevelCommands(object):
return (ret == 0)
def debootstrap(self, targetdir, distro=None):
- if distro is None:
+ if distro is None and lsb_release:
distro = lsb_release.get_distro_information()['CODENAME']
+ if distro is None:
+ distro = subprocess.getoutput("lsb_release --codename --short")
ret = subprocess.call(["debootstrap", distro, targetdir])
return (ret == 0)
@@ -187,7 +192,10 @@ class AptClone(object):
cache = self._cache_cls(rootdir=sourcedir)
s = ""
foreign = ""
- distro_id = lsb_release.get_distro_information()['ID']
+ if lsb_release:
+ distro_id = lsb_release.get_distro_information()['ID']
+ else:
+ distro_id = subprocess.getoutput("lsb_release --id --short")
for pkg in cache:
if pkg.is_installed:
# a version identifies the pacakge
--
2.35.1
--- End Message ---
--- Begin Message ---
Source: apt-clone
Source-Version: 0.4.3+nmu2
Done: Boyuan Yang <by...@debian.org>
We believe that the bug you reported is fixed in the latest version of
apt-clone, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1021...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Boyuan Yang <by...@debian.org> (supplier of updated apt-clone package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Sat, 17 Jun 2023 14:27:03 -0400
Source: apt-clone
Architecture: source
Version: 0.4.3+nmu2
Distribution: unstable
Urgency: medium
Maintainer: Michael Vogt <michael.v...@ubuntu.com>
Changed-By: Boyuan Yang <by...@debian.org>
Closes: 1021060
Changes:
apt-clone (0.4.3+nmu2) unstable; urgency=medium
.
* Non-maintainer upload.
.
[ Dave Jones ]
* Apply PR #17 to have apt-clone call lsb_release as a command, instead of
importing the Python module which no longer exists (LP: #2007566)
.
.
[ Boyuan Yang ]
* Import Ubuntu patch to fix crashes caused by missing lsb_release
Python module. (Closes: #1021060)
* debian/control: Replace deprecated Priority: extra with Priority:
optional.
Checksums-Sha1:
87ddf862740a29a24e008e37be3499ee3226105d 1745 apt-clone_0.4.3+nmu2.dsc
1b0e91bbf91b839bea242b4e7e62088a89e65c19 459612 apt-clone_0.4.3+nmu2.tar.xz
4bc3587f13ddb5b70c713f59e347c2311faa5d5b 7263
apt-clone_0.4.3+nmu2_amd64.buildinfo
Checksums-Sha256:
da28c9b1986bde14543bf0e6a39f8faf1114d3b4891625a5b481cd8d42cdda81 1745
apt-clone_0.4.3+nmu2.dsc
941a10ddccfc09d2bfbffb39f50abfe9a6d81f5046bac9cf481a6f335a7754e5 459612
apt-clone_0.4.3+nmu2.tar.xz
e95261a69c0a4342f908d5b5054a57b85e17ef4e0f7cdc588eb875c1237e6b6d 7263
apt-clone_0.4.3+nmu2_amd64.buildinfo
Files:
33970588981bcf2050779acc7ac42296 1745 admin optional apt-clone_0.4.3+nmu2.dsc
2c0325888c6500406722512bdfcefbbc 459612 admin optional
apt-clone_0.4.3+nmu2.tar.xz
1ab315c7965108ebbf2a404945b14deb 7263 admin optional
apt-clone_0.4.3+nmu2_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEfncpR22H1vEdkazLwpPntGGCWs4FAmSN/EIACgkQwpPntGGC
Ws4RORAAmuGSJ73oxTv4dOY1Wm+QZ6wu/nDIl8lAddaYwDY+OAQ18z7We1yQlWy6
xmT8znQF1tqNjP8kj1D8L2vQHtdxnUSmoBloYBREJ6tIE+w9qW3DNrVPON90wR6y
XLIOlXvwDOs9Ehd79qCZF9KwlbvXKcGzHfyfkOXNk4czlGE2parH5LgEhFz6cJJe
cVcMlyluHIBx/F+AE5shg1gERpnYQMzx58TB9EXI979gXzgWVv3w3JVIzbZ8Acbu
JdfBcnzkCYVaWk+nbapNQFTk8nqvB/rb2SHnx7I5OSLNjzTz8ylw40npbehzL7a0
AP87eliIPuB88eldDczCQon2C72+sYbYbmjZeapKHaitDuS9Oi5okbNQnPmFnc5D
W267/Mx6kzfqkmzSuQ7cWCQBPsmOzpaDbqT++L35e1nMPh0OQAy327DJ7p9xl2+A
hajojbvew0Aq4DLlmPVMAJt5HJFS3AyfEqY2y5M5hOdGS7b9mHAcM6phcbBRya4c
/ZgqTgFtALxT1gSiIxz+VqPnNGB2VFWmMlqD1QwvsUNa28130A78K+NCuwjmTUNQ
ferJyW6AAUeJaJDzUfG3wWFFsLxLuKHDK+X+tygWZXI9DxKNcOtYRVf1YO/GZxnZ
QrnmmSP+1nwCXJvHiNVCyjrjnXqox9VdAyjbh1FKDRfHvZLv7Fs=
=2o0r
-----END PGP SIGNATURE-----
--- End Message ---