daca2: handle xz compression

This commit is contained in:
Daniel Marjamäki 2013-10-20 12:45:05 +02:00
parent f58b4b61e2
commit 47766736fc
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import time
FTPSERVER = 'ftp.sunet.se'
FTPPATH = '/pub/Linux/distributions/Debian/debian/pool/main/'
def getpackages(folder):
print('Connect')
f = ftplib.FTP(FTPSERVER)
@ -133,6 +134,8 @@ def scanarchive(fullpath):
subprocess.call(['wget', fullpath])
if filename[-3:] == '.gz':
subprocess.call(['tar', 'xzvf', filename])
elif filename[-3:] == '.xz':
subprocess.call(['tar', 'xJvf', filename])
elif filename[-4:] == '.bz2':
subprocess.call(['tar', 'xjvf', filename])