aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Unit 193 <unit193@ubuntu.com>2016-01-25 03:28:00 -0500
committerLibravatar Unit 193 <unit193@ubuntu.com>2016-01-25 03:28:00 -0500
commitacad13c115a98d6b5cb032c9bcf77707523f4ea0 (patch)
tree32ef1f156e3ff990ba3ad1f8c1af8a192b2c634f
parentcc3760fa7cfe262197294f1bbca900582559f8fd (diff)
downloadmini-dinstall-acad13c115a98d6b5cb032c9bcf77707523f4ea0.tar.bz2
mini-dinstall-acad13c115a98d6b5cb032c9bcf77707523f4ea0.tar.xz
mini-dinstall-acad13c115a98d6b5cb032c9bcf77707523f4ea0.tar.zst
Add xz support for package files.
-rw-r--r--debian/control2
-rwxr-xr-xmini-dinstall12
2 files changed, 10 insertions, 4 deletions
diff --git a/debian/control b/debian/control
index 2de88ad..6f36804 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ X-Python-Version: >= 2.5
Package: mini-dinstall
Architecture: all
-Depends: ${python:Depends}, python-apt (>= 0.7.93), apt-utils, ${misc:Depends}
+Depends: ${python:Depends}, python-apt (>= 0.7.93), apt-utils, ${misc:Depends}, python-lzma
Recommends: gpgv
Suggests: debian-keyring
Description: daemon for updating Debian packages in a repository
diff --git a/mini-dinstall b/mini-dinstall
index 8590496..6e0ea84 100755
--- a/mini-dinstall
+++ b/mini-dinstall
@@ -18,7 +18,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-import os, sys, re, glob, getopt, time, traceback, gzip, bz2, getpass, socket
+import os, sys, re, glob, getopt, time, traceback, gzip, bz2, lzma, getpass, socket
import shutil, signal, threading, select, Queue, SocketServer
import logging, logging.handlers
#logging.basicConfig()
@@ -1147,16 +1147,20 @@ class ArchiveDirIndexer(threading.Thread):
newpackagesfilename = packagesfilename + '.new'
zpackagesfilename = packagesfilename + '.gz'
bz2packagesfilename = packagesfilename + '.bz2'
+ xzpackagesfilename = packagesfilename + '.xz'
newzpackagesfilename = newpackagesfilename + '.gz'
newbz2packagesfilename = newpackagesfilename + '.bz2'
+ newxzpackagesfilename = newpackagesfilename + '.xz'
newpackagesfile = open(newpackagesfilename, 'w')
newzpackagesfile = gzip.GzipFile(newzpackagesfilename, 'w')
newbz2packagesfile = bz2.BZ2File(newbz2packagesfilename, 'w')
+ newxzpackagesfile = lzma.LZMAFile(newxzpackagesfilename, 'w')
buf = stdout.read(8192)
while buf != '':
newpackagesfile.write(buf)
newzpackagesfile.write(buf)
newbz2packagesfile.write(buf)
+ newxzpackagesfile.write(buf)
buf = stdout.read(8192)
stdout.close()
(pid, status) = os.waitpid(pid, 0)
@@ -1165,9 +1169,11 @@ class ArchiveDirIndexer(threading.Thread):
newpackagesfile.close()
newzpackagesfile.close()
newbz2packagesfile.close()
+ newxzpackagesfile.close()
shutil.move(newpackagesfilename, packagesfilename)
shutil.move(newzpackagesfilename, zpackagesfilename)
shutil.move(newbz2packagesfilename, bz2packagesfilename)
+ shutil.move(newxzpackagesfilename, xzpackagesfilename)
def _make_packagesfile(self, dir):
self._make_indexfile(dir, 'packages', 'Packages')
@@ -1384,7 +1390,7 @@ class SimpleSubdirArchiveDirIndexer(ArchiveDirIndexer):
release_needed = 0
uncompr_indexfile = os.path.join(arch, 'Packages')
indexfiles = [uncompr_indexfile]
- comprexts = ['.gz', '.bz2']
+ comprexts = ['.gz', '.bz2', '.xz']
for ext in comprexts:
indexfiles = indexfiles + [uncompr_indexfile + ext]
if os.access(targetname, os.R_OK):
@@ -1472,7 +1478,7 @@ class FlatArchiveDirIndexer(ArchiveDirIndexer):
release_needed = 0
uncompr_indexfiles = self._get_all_indexfiles()
indexfiles = []
- comprexts = ['.gz', '.bz2']
+ comprexts = ['.gz', '.bz2', '.xz']
for index in uncompr_indexfiles:
indexfiles = indexfiles + [index]
for ext in comprexts: