def _import_filelist(self, filelist):
log.debug("Importing filelist for %s" % self)
- # XXX capabilities
-
self.db.executemany("""
INSERT INTO
package_files
digest_blake2b512,
digest_blake2s256,
digest_sha3_512,
- digest_sha3_256
+ digest_sha3_256,
+ capabilities
)
VALUES
(
- %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s
+ %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s
)""",
((
self.id,
file.digest("blake2s256"),
file.digest("sha3-512"),
file.digest("sha3-256"),
+ file.capabilities,
) for file in filelist),
)
@property
def capabilities(self):
- return self.data.capabilities
+ try:
+ return self.data.capabilities.split()
+ except AttributeError:
+ return []
# Digest SHA512
mode integer NOT NULL,
uname text NOT NULL,
gname text NOT NULL,
- capabilities text,
ctime timestamp without time zone NOT NULL,
mtime timestamp without time zone NOT NULL,
digest_sha2_512 bytea,
digest_blake2s256 bytea,
digest_sha3_512 bytea,
digest_sha3_256 bytea,
- mimetype text
+ mimetype text,
+ capabilities text[] DEFAULT ARRAY[]::text[] NOT NULL
);