Bug#880985: Change python-lzma from Recommends to Depends

2017-11-08 Thread Valmiky Arquissandas

Hello Ritesh,


- Considering that, at least in Debian 9, using the default
deb.debian.org entry in sources.list, the database files are xzipped
(therefore, depending on python-lzma), this is a problem, and the
error
message is misleading.



Hmmm. I was under the impression that this functionality (that of what
archive backend) was left out to the mirror admins. In today's day,
though, the standard practise is to simply use what the master node
serves.


I believe so. It may depend on which mirror I was directed to, and 
perhaps it was bad luck I got one using XZ.
However, if there is a chance of this happening, then either apt-offline 
in the offline machine should ensure it supports XZ, or the apt-offline 
in the online machine should make the necessary arrangements to ensure 
the offline machine is able to handle the archives (e.g. repacking them 
with a supported backend).


This appears to be much more trouble than it's worth, which is why my 
suggestion was to just ensure the python-lzma package becomes required.




Given this scenario, I suggest the Debian package to have python-lzma
in
Depends instead of Recommends, and/or the upstream apt-offline to
present more information if the module lzma is not available, even
if
only with --verbose, and especially when that is a cause of failure.



For quite some time, Debian has enabled to install Recommends, by
default. That is why I marked it as a Recommends, so that it remains
flexible for users who don't use the lzma based backend.

Can you please check if you have explicitly disabled installation of
Recommends in your setup ?


As I said earlier, my use case has the implication that I can not 
connect the computer, ever. Not even to install apt-offline.


The way I bootstrapped apt-offline (in a brand-new Debian system) was by 
downloading its .deb, and the .debs of all the *depended* packages, and 
installed them with dpkg -i in the offline machine. This is how I missed 
python-lzma.


It's okay to keep it in Recommends. I like to keep things simple, too, 
and often skip the recommended packages when they appear to make no 
sense to me. I respect that.
The alternative here is to let the user know when the missing package is 
making a difference, and what are its consequences.
I do think it deserves being a Depend, though, if XZ is commonly used to 
compress the archives, since that undermines apt-offline's operation.


Alternatively, if python-lzma is not installed, apt-offline running from 
the online machine could download its package anyway, giving the user a 
choice to install it when needed, even while offline.
This avoids a situation where a user has infrequent access to the 
Internet and the lack of this package blocks the user until the next 
Internet access (but since it's the package lists themselves that are 
compressed with XZ and APT will not function without them, this is a 
chicken-and-egg problem, in which the user has to know they need to dpkg 
-i python-lzma.deb before populating the APT database with apt-offline).


Notwithstanding, including it in Depends only solves a symptom. The real 
problem was the lack of error detail.


I could have easily installed python-lzma, if only I knew _that_ was the 
problem.




I know that the current versions are written in Python 3, but as long
as
Debian 9 is the current stable, this issue may burn someone else.


I have added the following warning. Will backport some time for
Stretch. Let's keep this bug open until then. If you don't see activity
on this bug report in the next 2 months, please do ping.


rrs@priyasi:~/rrs-home/devel/apt-offline/apt-offline (master)$ ./apt-
offline install /var/tmp/upgrade.zip
WARN: lzma module unavailable
WARN: Please install python lzma module for APT lzma backend


Yup, I believe that mitigates the problem.
I was considering changing the code this weekend and creating a pull 
request, but it may no longer be needed. I might still add some more 
lines to the verbose log, though, if you agree!


Thank you for your attention!
Valmiky Arquissandas



Bug#880985: Change python-lzma from Recommends to Depends

2017-11-07 Thread Ritesh Raj Sarraf
Control: tag -1 +fixed-upstream

Hello Valmiky,


Thank you for the bug report.

On Mon, 2017-11-06 at 17:04 +, Valmiky Arquissandas wrote:
> - Considering that, at least in Debian 9, using the default 
> deb.debian.org entry in sources.list, the database files are xzipped 
> (therefore, depending on python-lzma), this is a problem, and the
> error 
> message is misleading.
> 

Hmmm. I was under the impression that this functionality (that of what
archive backend) was left out to the mirror admins. In today's day,
though, the standard practise is to simply use what the master node
serves.


> Given this scenario, I suggest the Debian package to have python-lzma 
> in 
> Depends instead of Recommends, and/or the upstream apt-offline to 
> present more information if the module lzma is not available, even
> if 
> only with --verbose, and especially when that is a cause of failure.
> 

For quite some time, Debian has enabled to install Recommends, by
default. That is why I marked it as a Recommends, so that it remains
flexible for users who don't use the lzma based backend.

Can you please check if you have explicitly disabled installation of
Recommends in your setup ?


> I know that the current versions are written in Python 3, but as long
> as 
> Debian 9 is the current stable, this issue may burn someone else.

I have added the following warning. Will backport some time for
Stretch. Let's keep this bug open until then. If you don't see activity
on this bug report in the next 2 months, please do ping.


rrs@priyasi:~/rrs-home/devel/apt-offline/apt-offline (master)$ ./apt-
offline install /var/tmp/upgrade.zip 
WARN: lzma module unavailable
WARN: Please install python lzma module for APT lzma backend

PS: You have a very cool name. In Sanskrit, this name is after a great sage who 
wrote the holy Ramayana.
https://en.wikipedia.org/wiki/Valmiki


-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System

signature.asc
Description: This is a digitally signed message part


Bug#880985: Change python-lzma from Recommends to Depends

2017-11-06 Thread Valmiky Arquissandas

Package: apt-offline
Version: 1.7.2

During the initial sync of the APT database in apt-offline (apt-offline 
install target/ --verbose), apt-offline kept failing with errors like 
"Failed to sync file 
/var/lib/apt/lists/partial/deb.debian.org_debian_dists_stretch_main_binary-amd64_Packages".


After debugging, I finally realized that the issue was on a missing 
python-lzma on the offline machine, failing silently.


Please consider the following:
- In this use case, apt-offline is being used to maintain a reasonably 
air-gapped machine, which means it was never connected to any network.
- This means that the initial APT database update also depended on 
apt-offline. There was no online database update whatsoever.

- The missing LZMA module was NOT apparent, not even with --verbose
- The following lines in 
/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineLib.py are 
especially significant, as they are effectively a silent failure:


---
try:
import lzma
except ImportError:
modLZMA = False
---

- Considering that, at least in Debian 9, using the default 
deb.debian.org entry in sources.list, the database files are xzipped 
(therefore, depending on python-lzma), this is a problem, and the error 
message is misleading.


Given this scenario, I suggest the Debian package to have python-lzma in 
Depends instead of Recommends, and/or the upstream apt-offline to 
present more information if the module lzma is not available, even if 
only with --verbose, and especially when that is a cause of failure.


I know that the current versions are written in Python 3, but as long as 
Debian 9 is the current stable, this issue may burn someone else.


Thank you for your attention,
Valmiky Arquissandas