self.hash1 = ""
def __cmp__(self, other):
- return cmp(self.pkg, other.pkg) or cmp(self.name, other.name)
+ ret = cmp(self.name, other.name)
+
+ print self.pkg, other.pkg
+
+ if not ret:
+ ret = cmp(self.pkg, other.pkg)
+
+ return ret
def is_dir(self):
# XXX TODO
# Sort files by the length of their name to remove all files in
# a directory first and then check, if there are any files left.
- files.sort(cmp=lambda x,y: cmp(len(x), len(y)), reverse=True)
+ files.sort(cmp=lambda x,y: cmp(len(x.name), len(y.name)), reverse=True)
i = 0
for _file in files:
logging.debug("Removing file: %s" % _file)
if prefix:
- file = os.path.join(prefix, _file[1:])
+ file = os.path.join(prefix, _file.name[1:])
assert file.startswith("%s/" % prefix)
else:
- file = _file
+ file = _file.name
# If the file was removed by the user, we can skip it.
if not os.path.exists(file):
@property
def configfiles(self):
- return [] # XXX to be done
+ ret = []
+
+ for file in self.filelist:
+ if not file.is_config():
+ continue
+
+ ret.append(file)
+
+ return ret
def _does_provide_file(self, requires):
"""
else:
self.filelist[file.name] = [file,]
- #self.errors.append((self.ERROR_TYPE_CONFLICT, file))
-
def remove(self, pkg):
for file in pkg.filelist:
try:
self.filelist[file.name].remove(file)
- except KeyError:
+ except (KeyError, ValueError):
pass
def update(self, pkg):
return
check.print_errors()
- raise TransactionCheckError, _("Transaction test was not successful")
+ #raise TransactionCheckError, _("Transaction test was not successful")
def run(self):
# Download all packages.