diff --git a/pisi/build.py b/pisi/build.py index 94aa053c..92507280 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -344,8 +344,8 @@ class Builder: for path in package.files: size += util.dir_size(util.join_path(d, path.path)) - metadata.package.installedSize = int(size) # should be enough for everyone! - # mwahahah! FIXME: really? + metadata.package.installedSize = size + # build no if ctx.config.options.ignore_build_no: metadata.package.build = None # means, build no information n/a @@ -380,10 +380,10 @@ class Builder: frpath = util.removepathprefix(install_dir, fpath) # relative path ftype = get_file_type(frpath, package.files) try: # broken links and empty dirs can cause problem - fsize = str(os.path.getsize(fpath)) + fsize = os.path.getsize(fpath) except OSError: fsize = None - d[frpath] = FileInfo(frpath, ftype, fsize, fhash) + d[frpath] = FileInfo(path=frpath, type=ftype, size=fsize, hash=fhash) for pinfo in package.files: wildcard_path = util.join_path(install_dir, pinfo.path) @@ -424,8 +424,8 @@ class Builder: locate_package_names(files) if not found: - return 0 - ctx.ui.warning(_('(no previous build found, setting build no to 0.)')) + return 1 + ctx.ui.warning(_('(no previous build found, setting build no to 1.)')) else: a = filter(lambda (x,y): y != None, found) ctx.ui.debug(str(a)) diff --git a/pisi/files.py b/pisi/files.py index 16bb3ca5..65b1afb5 100644 --- a/pisi/files.py +++ b/pisi/files.py @@ -26,7 +26,7 @@ class File: t_Path = [ xmlfile.String, xmlfile.mandatory ] t_Type = [ xmlfile.String, xmlfile.mandatory ] - t_Size = [ xmlfile.Integer, xmlfile.mandatory ] + t_Size = [ xmlfile.Long, xmlfile.mandatory ] t_Hash = [ xmlfile.String, xmlfile.optional, "SHA1Sum" ] def __str__(self): @@ -42,6 +42,9 @@ class Files(xmlfile.XmlFile): t_List = [ [File], xmlfile.optional, "File"] + def append(self, fileinfo): + self.list.append(fileinfo) + class FilesDB(shelve.LockedDBShelf): def __init__(self): diff --git a/pisi/metadata.py b/pisi/metadata.py index 6c051ccb..4ba474b2 100644 --- a/pisi/metadata.py +++ b/pisi/metadata.py @@ -42,7 +42,7 @@ class Package(specfile.Package): t_Distribution = [ xmlfile.String, xmlfile.mandatory] t_DistributionRelease = [ xmlfile.String, xmlfile.mandatory] t_Architecture = [ xmlfile.String, xmlfile.mandatory] - t_InstalledSize = [ xmlfile.Integer, xmlfile.mandatory] + t_InstalledSize = [ xmlfile.Long, xmlfile.mandatory] t_PackageURI = [ xmlfile.String, xmlfile.optional] def decode_hook(self, node, errs, where):