Add new flags -c and -d for overriding cachedir and database filenames
This commit is contained in:
parent
86f2f83e4e
commit
bc54dd803a
2
PKGBUILD
2
PKGBUILD
@ -1,6 +1,6 @@
|
||||
# Maintainer: Eric Torres <erictorres4@protonmail.com>
|
||||
pkgname=packaging-scripts
|
||||
pkgver=1.0.3
|
||||
pkgver=1.1
|
||||
pkgrel=1
|
||||
pkgdesc="A set of helper scripts for handling Arch Linux packages"
|
||||
arch=('any')
|
||||
|
19
bin/addpkg
19
bin/addpkg
@ -58,6 +58,16 @@ def add_pkgfile(pkgfile, cachedir):
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--cachedir",
|
||||
help="alternative directory to use for moving package"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--db-filename",
|
||||
help="alternative filename for database without extension"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sign",
|
||||
@ -86,9 +96,14 @@ if __name__ == "__main__":
|
||||
else:
|
||||
opts = args.opts
|
||||
|
||||
if args.cachedir is not None:
|
||||
cachedir = args.cachedir
|
||||
else:
|
||||
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
||||
# this assumes that the db file for the repo
|
||||
# has the same name as that repo
|
||||
|
||||
if args.db-filename is not None:
|
||||
db = os.path.join(cachedir, f"{args.db-filename}.{DB_EXT}")
|
||||
else:
|
||||
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
||||
|
||||
if args.verbose:
|
||||
|
19
bin/delpkg
19
bin/delpkg
@ -53,6 +53,16 @@ def del_pkgfile(pkg):
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--cachedir",
|
||||
help="alternative directory to use for moving package"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--db-filename",
|
||||
help="alternative filename for database without extension"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sign",
|
||||
@ -81,9 +91,14 @@ if __name__ == "__main__":
|
||||
else:
|
||||
opts = args.opts
|
||||
|
||||
if args.cachedir is not None:
|
||||
cachedir = args.cachedir
|
||||
else:
|
||||
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
||||
# this assumes that the db file for the repo
|
||||
# has the same name as that repo
|
||||
|
||||
if args.db-filename is not None:
|
||||
db = os.path.join(cachedir, f"{args.db-filename}.{DB_EXT}")
|
||||
else:
|
||||
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
||||
|
||||
if args.verbose:
|
||||
|
@ -5,6 +5,8 @@ local arguments
|
||||
|
||||
arguments=(
|
||||
{-h,--help}'[show this help message and exit]'
|
||||
{-c,--cachedir}'[alternative directory to use for moving package]'
|
||||
{-d,--db-filename}'[alternative filename for database without extension]'
|
||||
{-s,--sign}'[sign repository file]'
|
||||
{-v,--verbose}'[increase script verbosity]'
|
||||
'*:filename:_files'
|
||||
|
@ -6,6 +6,8 @@ local arguments
|
||||
|
||||
arguments=(
|
||||
{-h,--help}'[show this help message and exit]'
|
||||
{-c,--cachedir}'[alternative directory to use for deleting package]'
|
||||
{-d,--db-filename}'[alternative filename for database without extension]'
|
||||
{-s,--sign}'[sign repository file]'
|
||||
{-v,--verbose}'[increase script verbosity]'
|
||||
'*:filename:_files'
|
||||
|
Loading…
x
Reference in New Issue
Block a user