Add --files-only flag to addpkg and delpkg
This commit is contained in:
parent
a36ed7e2bc
commit
f576032dae
16
bin/addpkg
16
bin/addpkg
@ -66,6 +66,11 @@ if __name__ == "__main__":
|
||||
"--db-filename",
|
||||
help="alternative filename for database without extension",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--files-only",
|
||||
action="store_true",
|
||||
help="only add the built files to the repository",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sign",
|
||||
@ -118,11 +123,12 @@ if __name__ == "__main__":
|
||||
syslog.critical("No package tarballs have been found, exiting")
|
||||
exit(E_NOFILESERR)
|
||||
|
||||
try:
|
||||
repos.db_modify("add", db, *opts, *pkg_tarballs)
|
||||
except repos.RepoAddError as e:
|
||||
syslog.error(e)
|
||||
exit(E_REPO_ADDERR)
|
||||
if not args.files_only:
|
||||
try:
|
||||
repos.db_modify("add", db, *opts, *pkg_tarballs)
|
||||
except repos.RepoAddError as e:
|
||||
syslog.error(e)
|
||||
exit(E_REPO_ADDERR)
|
||||
|
||||
for pkgfile in (*pkg_tarballs, *sigfiles):
|
||||
add_pkgfile(pkgfile, cachedir)
|
||||
|
14
bin/delpkg
14
bin/delpkg
@ -61,6 +61,11 @@ if __name__ == "__main__":
|
||||
"--db-filename",
|
||||
help="alternative filename for database without extension",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--files-only",
|
||||
action="store_true",
|
||||
help="only add the built files to the repository",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sign",
|
||||
@ -111,7 +116,8 @@ if __name__ == "__main__":
|
||||
for pkgfile in (*pkg_tarballs, *sigfiles):
|
||||
del_pkgfile(pkgfile)
|
||||
|
||||
try:
|
||||
repos.db_modify("remove", db, *opts, *pkgs)
|
||||
except repos.RepoAddError as e:
|
||||
syslog.error(e)
|
||||
if not args.files_only:
|
||||
try:
|
||||
repos.db_modify("remove", db, *opts, *pkgs)
|
||||
except repos.RepoAddError as e:
|
||||
syslog.error(e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user