import apt_pkg
import database
import time
+import tarfile
from dak_exceptions import *
from regexes import re_html_escaping, html_escaping, re_single_line_field, \
re_multi_line_field, re_srchasver, re_verwithext, \
Generate a list of flies contained in a .deb
@type filename: string
- @param filename: the path to a .deb
+ @param filename: the path to a data.tar.gz or data.tar.bz2
@rtype: list
@return: a list of files in the data.tar.* portion of the .deb
# and pieces the deb had ...
if chunks[2] == "data.tar.gz":
data = tarfile.open("data.tar.gz", "r:gz")
- elif data_tar == "data.tar.bz2":
+ elif chunks[2] == "data.tar.bz2":
data = tarfile.open("data.tar.bz2", "r:bz2")
else:
os.remove(chunks[2])
finally:
if os.path.exists( chunks[2] ):
+ shutil.rmtree( chunks[2] )
os.remove( chunks[2] )
return contents