diff -Nru aptfs-0.13.1/AptFs/aptfile.py aptfs-1.0.1/AptFs/aptfile.py --- aptfs-0.13.1/AptFs/aptfile.py 2019-03-06 09:47:06.000000000 +0000 +++ aptfs-1.0.1/AptFs/aptfile.py 2019-09-09 19:56:17.000000000 +0000 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # aptfs — FUSE filesystem for APT source repositories -# Copyright © 2008—2017 Chris Lamb +# Copyright © 2008—2019 Chris Lamb # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru aptfs-0.13.1/AptFs/aptfs.py aptfs-1.0.1/AptFs/aptfs.py --- aptfs-0.13.1/AptFs/aptfs.py 2019-03-06 09:47:06.000000000 +0000 +++ aptfs-1.0.1/AptFs/aptfs.py 2019-09-09 19:56:17.000000000 +0000 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # aptfs — FUSE filesystem for APT source repositories -# Copyright © 2008—2017 Chris Lamb +# Copyright © 2008—2019 Chris Lamb # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -100,7 +100,7 @@ dir = path.split('/')[1:] if len(dir) == 1: st = MyStat() - st.st_mode = stat.S_IFDIR | 0755 + st.st_mode = stat.S_IFDIR | 0x755 pkg = dir[0] if pkg == '': @@ -108,12 +108,14 @@ else: st.st_nlink = 3 - if pkg not in self.source_packages and \ - pkg not in self.binary_packages: + if ( + pkg not in self.source_packages + and pkg not in self.binary_packages + ): return -errno.ENOENT if pkg in self.binary_packages: - st.st_mode = stat.S_IFLNK | 0777 + st.st_mode = stat.S_IFLNK | 0x777 return st @@ -153,8 +155,7 @@ entries = self.source_packages if self.show_binary_symlinks: entries = itertools.chain( - self.source_packages, - self.binary_packages, + self.source_packages, self.binary_packages ) for x in sorted(entries): diff -Nru aptfs-0.13.1/AptFs/download.py aptfs-1.0.1/AptFs/download.py --- aptfs-0.13.1/AptFs/download.py 2019-03-06 09:47:06.000000000 +0000 +++ aptfs-1.0.1/AptFs/download.py 2019-09-09 19:56:17.000000000 +0000 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # aptfs — FUSE filesystem for APT source repositories -# Copyright © 2008—2017 Chris Lamb +# Copyright © 2008—2019 Chris Lamb # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,8 +17,8 @@ # along with this program. If not, see . import os -import commands import tempfile +import subprocess class DownloadError(Exception): @@ -42,25 +42,25 @@ basedir = tempfile.mkdtemp('_%s' % srcpkg, 'aptfs_', tempdir) if secure: - cmds = ( - 'cd "%s"' % basedir, - 'apt-get source "%s"' % srcpkg, - ) + cmds = ('cd "%s"' % basedir, 'apt-get source "%s"' % srcpkg) else: cmds = ( 'cd "%s"' % basedir, - 'dget --quiet --download-only --allow-unauthenticated $(apt-get source ' + - '--print-uris "%s" | sed -n "s/\'\(http[^\']*.dsc\).*/\\1/p")' \ - % srcpkg, - + 'dget --quiet --download-only --allow-unauthenticated $(apt-get source ' + + '--print-uris "%s" | sed -n "s/\'\(http[^\']*.dsc\).*/\\1/p")' + % srcpkg, # Break the signature such that dpkg-source does not attempt to # verify it. 'awk -v X=0 \'/^[ ]*$/ { X=1 } { if (X) print }\' *.dsc > src.dsc', 'dpkg-source -x src.dsc unpacked', ) - status, output = commands.getstatusoutput(' && '.join(cmds)) - if status != 0: + p = subprocess.Popen( + ' && '.join(cmds), shell=True, stderr=subprocess.STDOUT + ) + output = p.communicate()[0] + + if p.returncode != 0: raise DownloadError(output, basedir) for x in os.listdir(basedir): diff -Nru aptfs-0.13.1/AptFs/utils.py aptfs-1.0.1/AptFs/utils.py --- aptfs-0.13.1/AptFs/utils.py 2019-03-06 09:47:06.000000000 +0000 +++ aptfs-1.0.1/AptFs/utils.py 2019-09-09 19:56:17.000000000 +0000 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # aptfs — FUSE filesystem for APT source repositories -# Copyright © 2008—2017 Chris Lamb +# Copyright © 2008—2019 Chris Lamb # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,25 +26,32 @@ def get_package_info(): - filenames = subprocess.check_output(( - 'apt-get', - 'indextargets', - '--format', '$(FILENAME)', - 'Created-By: Sources', - )).splitlines() - - apt_helper = subprocess.Popen(( - '/usr/lib/apt/apt-helper', - 'cat-file', - ) + tuple(filenames), stdout=subprocess.PIPE) - - stdout = subprocess.check_output(( - 'grep-dctrl', - '-FSource:Package', - '--regex', '.', - '--no-field-names', - '--show-field=Package,Binary', - ), stdin=apt_helper.stdout) + filenames = subprocess.check_output( + ( + 'apt-get', + 'indextargets', + '--format', + '$(FILENAME)', + 'Created-By: Sources', + ) + ).splitlines() + + apt_helper = subprocess.Popen( + ('/usr/lib/apt/apt-helper', 'cat-file') + tuple(filenames), + stdout=subprocess.PIPE, + ) + + stdout = subprocess.check_output( + ( + 'grep-dctrl', + '-FSource:Package', + '--regex', + '.', + '--no-field-names', + '--show-field=Package,Binary', + ), + stdin=apt_helper.stdout, + ).decode('utf-8') apt_helper.wait() @@ -56,11 +63,7 @@ def flag_to_mode(flags): - md = { - os.O_RDWR: 'w+', - os.O_RDONLY: 'r', - os.O_WRONLY: 'w', - } + md = {os.O_RDWR: 'wb+', os.O_RDONLY: 'rb', os.O_WRONLY: 'wb'} m = md[flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)] diff -Nru aptfs-0.13.1/debian/changelog aptfs-1.0.1/debian/changelog --- aptfs-0.13.1/debian/changelog 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/changelog 2019-09-09 19:56:17.000000000 +0000 @@ -1,3 +1,29 @@ +aptfs (2:1.0.1) unstable; urgency=medium + + * Fix opening/reading of files after Python 3.x migration. + + -- Chris Lamb Mon, 09 Sep 2019 20:56:17 +0100 + +aptfs (2:1.0.0) unstable; urgency=medium + + * Port to Python 3.x. (Closes: #936131) + - Update all ackaging to reflect move to Python 3.x. + * Move to a native package. + - Move Debian packaging from pkg-aptfs into this repository. + - Update Vcs-Git and Vcs-Browser. + - Drop debian/source/options. + - Ensure that our Debian package version does not get out of sync with + setup.py. + * Misc tidying: + - Update debian/copyright and copyright years in source. + - Move to debhelper-compat virtual package, level 12. + - Bump Standards-Version to 4.4.0. + - Move to pybuild for debhelper compatibility level 12. + * Add a pyproject.toml and apply "black" to the source tree. + * Drop TODO file; we use our code hosting platform's issue tracker now. + + -- Chris Lamb Mon, 09 Sep 2019 11:21:45 +0100 + aptfs (2:0.13.1-1) unstable; urgency=medium * New upstream release. (Closes: #923811) diff -Nru aptfs-0.13.1/debian/compat aptfs-1.0.1/debian/compat --- aptfs-0.13.1/debian/compat 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru aptfs-0.13.1/debian/control aptfs-1.0.1/debian/control --- aptfs-0.13.1/debian/control 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/control 2019-09-09 19:56:17.000000000 +0000 @@ -3,22 +3,22 @@ Priority: optional Maintainer: Chris Lamb Build-Depends: - debhelper (>= 11), + debhelper-compat (= 12), dh-python, - python, -Standards-Version: 4.3.0 + python3-all, +Standards-Version: 4.4.0 Homepage: https://chris-lamb.co.uk/projects/aptfs -Vcs-Git: https://salsa.debian.org/lamby/pkg-aptfs.git -Vcs-Browser: https://salsa.debian.org/lamby/pkg-aptfs +Vcs-Git: https://salsa.debian.org/lamby/aptfs.git +Vcs-Browser: https://salsa.debian.org/lamby/aptfs Package: aptfs Architecture: all Depends: dctrl-tools, devscripts, - python-fuse, + python3-fuse, ${misc:Depends}, - ${python:Depends}, + ${python3:Depends}, Description: FUSE filesystem for APT source repositories AptFs is a FUSE-based filesystem that provides a view to unpacked Debian source packages (obtained via APT) as regular folders. Binary packages are diff -Nru aptfs-0.13.1/debian/copyright aptfs-1.0.1/debian/copyright --- aptfs-0.13.1/debian/copyright 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/copyright 2019-09-09 19:56:17.000000000 +0000 @@ -4,7 +4,7 @@ Source: https://chris-lamb.co.uk/projects/aptfs/ Files: * -Copyright: (C) 2008 - 2015 Chris Lamb +Copyright: (C) 2008 - 2019 Chris Lamb License: GPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru aptfs-0.13.1/debian/gitlab-ci.yml aptfs-1.0.1/debian/gitlab-ci.yml --- aptfs-0.13.1/debian/gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ aptfs-1.0.1/debian/gitlab-ci.yml 2019-09-09 19:56:17.000000000 +0000 @@ -0,0 +1,12 @@ +image: registry.salsa.debian.org/salsa-ci-team/ci-image-git-buildpackage:latest + +pages: + stage: deploy + except: + - tags + artifacts: + paths: + - public + script: + - gitlab-ci-git-buildpackage-all + - gitlab-ci-aptly diff -Nru aptfs-0.13.1/debian/rules aptfs-1.0.1/debian/rules --- aptfs-0.13.1/debian/rules 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/rules 2019-09-09 19:56:17.000000000 +0000 @@ -1,4 +1,10 @@ #!/usr/bin/make -f +include /usr/share/dpkg/default.mk + +ifeq (,$(findstring ^$(firstword $(subst +, ,$(DEB_VERSION_UPSTREAM))),^$(shell python3 setup.py --version))) +$(error (version in setup.py out of sync with Debian version)) +endif + %: - dh $@ --with python2 + dh $@ --with python3 --buildsystem=pybuild diff -Nru aptfs-0.13.1/debian/source/format aptfs-1.0.1/debian/source/format --- aptfs-0.13.1/debian/source/format 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/source/format 2019-09-09 19:56:17.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff -Nru aptfs-0.13.1/debian/source/options aptfs-1.0.1/debian/source/options --- aptfs-0.13.1/debian/source/options 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/source/options 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -extend-diff-ignore = "^\.travis\.yml$" diff -Nru aptfs-0.13.1/debian/watch aptfs-1.0.1/debian/watch --- aptfs-0.13.1/debian/watch 2019-03-06 09:52:48.000000000 +0000 +++ aptfs-1.0.1/debian/watch 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -version=4 -https://pypi.python.org/packages/source/a/aptfs/ aptfs-(.+)\.tar\.gz debian uupdate diff -Nru aptfs-0.13.1/MANIFEST.in aptfs-1.0.1/MANIFEST.in --- aptfs-0.13.1/MANIFEST.in 1970-01-01 00:00:00.000000000 +0000 +++ aptfs-1.0.1/MANIFEST.in 2019-09-09 19:56:17.000000000 +0000 @@ -0,0 +1,3 @@ +include COPYING +include HACKING +include mount.aptfs.1 diff -Nru aptfs-0.13.1/mount.aptfs aptfs-1.0.1/mount.aptfs --- aptfs-0.13.1/mount.aptfs 2019-03-06 09:47:06.000000000 +0000 +++ aptfs-1.0.1/mount.aptfs 2019-09-09 19:56:17.000000000 +0000 @@ -1,8 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # aptfs — FUSE filesystem for APT source repositories -# Copyright © 2008—2017 Chris Lamb +# Copyright © 2008—2019 Chris Lamb # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru aptfs-0.13.1/PKG-INFO aptfs-1.0.1/PKG-INFO --- aptfs-0.13.1/PKG-INFO 2019-03-06 09:49:13.000000000 +0000 +++ aptfs-1.0.1/PKG-INFO 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: aptfs -Version: 0.13.1 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: Chris Lamb -Author-email: lamby@debian.org -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN diff -Nru aptfs-0.13.1/pyproject.toml aptfs-1.0.1/pyproject.toml --- aptfs-0.13.1/pyproject.toml 1970-01-01 00:00:00.000000000 +0000 +++ aptfs-1.0.1/pyproject.toml 2019-09-09 19:56:17.000000000 +0000 @@ -0,0 +1,4 @@ +[tool.black] +line-length = 79 +py36 = true +skip-string-normalization = true diff -Nru aptfs-0.13.1/setup.py aptfs-1.0.1/setup.py --- aptfs-0.13.1/setup.py 2019-03-06 09:48:32.000000000 +0000 +++ aptfs-1.0.1/setup.py 2019-09-09 19:56:17.000000000 +0000 @@ -1,8 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # aptfs — FUSE filesystem for APT source repositories -# Copyright © 2008—2017 Chris Lamb +# Copyright © 2008—2019 Chris Lamb # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,13 +21,9 @@ setup( name='aptfs', - version='0.13.1', + version='1.0.1', author="Chris Lamb", author_email="lamby@debian.org", - packages=( - 'AptFs', - ), - scripts=( - 'mount.aptfs', - ), + packages=('AptFs',), + scripts=('mount.aptfs',), )