On Thursday 11 June 2015 04:26 PM, Peter Laird wrote: > > Attached is a patch for apt-offline version 1.5 to fix bug#787730 and > bug#787736. I've done an update using this patched version and it > works OK. > The changes for bug#787730 (around line 1155) means that the code is > the same as in version 1.6. > The changes for bug#787736 (around line 1643) apply to code which is > specific to an update, therefore other uses (eg. upgrade, installing > packages) should not be affected. > > Is it possible for this change to be included in the stable release? >
Oh!! Thank you. I hadn't realized that the bug fixes were that small. Some comments below. > > apt_offline_v1.5.patch > > > diff -ur apt-offline-1.5.orig/apt_offline_core/AptOfflineCoreLib.py > apt-offline-1.5.patch/apt_offline_core/AptOfflineCoreLib.py > --- apt-offline-1.5.orig/apt_offline_core/AptOfflineCoreLib.py > 2014-09-15 19:28:06.000000000 +0100 > +++ apt-offline-1.5.patch/apt_offline_core/AptOfflineCoreLib.py > 2015-06-10 21:25:06.000000000 +0100 > @@ -1155,7 +1155,7 @@ > os.rename(temp_filename, filename) > else: > os.unlink(temp_filename) > - elif magicMIME.file( archive_file ) == > "application/x-gnupg-keyring": > + elif magicMIME.file( archive_file ) == > "application/x-gnupg-keyring" or magicMIME.file( archive_file ) == > "application/pgp-signature": > filename = os.path.join(apt_update_target_path, > filename) > shutil.copy2(archive_file, filename) > # PGP armored data should be bypassed This one looks good. Stable team shouldn't have any issue allowing its inclusion. > @@ -1643,6 +1643,10 @@ > # We strip item.destfile because that's how > apt-get had historically presented it to us > destFile = item.destfile.split("/")[-1] > > + # strip any compression file extension > (bug#787736) > + if os.path.splitext(destFile)[1] in [".bz2", > ".gz", ".lzma"]: > + destFile = > os.path.splitext(destFile)[0] > + > writeFH.write("'" + item.desc_uri + "'" + " > " + destFile + " " + str(item.filesize) + " " + ":" + "\n") > log.verbose("Writing string %s %s %d %s to > file %s\n" % (item.desc_uri, destFile, item.filesize, ":", self.WriteTo) ) > writeFH.flush() Ah!! Now I get the context here. I think this one is wrong. I doubt if that code path is even executed. In 1.5 (and 1.6, and my repo), we have following code. #INFO: Check if python-apt is installed PythonApt = True try: import apt import apt_pkg except ImportError: PythonApt = False PythonApt = False #Remove it after porting to python-apt That means python-apt is never used. I just haven't had enough time to test and enable it. That said.... Your actual issue was about ..... After applying the fix to apt-offline described in bug #787730, I did: apt-offline install update.zip The package list files etc. are correctly synced to /var/lib/apt/lists but with filename extension .bz2 eg. -rw-r--r-- 1 root root 33775581 Jun 1 21:12 /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_jessie_main_binary-amd64_Packages -rw-r--r-- 1 root root 33775581 Jun 3 21:45 /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_jessie_main_binary-amd64_Packages.bz2 Although they have a .bz2 extension, they are actually plain text files - the output from the "file" command is: /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_jessie_main_binary-amd64_Packages.bz2: ASCII text, with very long lines Where as the code referenced above is in the setter(), which only is invoked in the `set` operation. Your bug report has to do with some issue in the installer() function. The way it works is: * We copy the update data in a temp location. * then we verify its integrity (using the gpg keys) * If it is pristine, we push it to the right location We may have a problem in that flow, somewhere, when upgrading from Wheezy to Jessie. -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention."
signature.asc
Description: OpenPGP digital signature