Reimplement repo_add as db_modify and clean code accordingly

This commit is contained in:
Eric Torres
2019-02-20 15:22:18 -08:00
parent 99492bbb4a
commit 387c5f7d33
3 changed files with 42 additions and 73 deletions

View File

@ -104,13 +104,10 @@ if __name__ == '__main__':
exit(E_NOFILESERR)
try:
repos.repo_add('add', db, *pkg_tarballs, opts=opts)
repos.db_modify('add', db, *opts, *pkg_tarballs)
except repos.RepoAddError as e:
syslog.error(e)
exit(E_REPO_ADDERR)
for pkg_tarball in pkg_tarballs:
add_pkgfile(pkg_tarball, cachedir)
for sigfile in sigfiles:
add_pkgfile(sigfile, cachedir)
for pkgfile in (*pkg_tarballs, *sigfiles):
add_pkgfile(pkgfile, cachedir)