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>
|
# Maintainer: Eric Torres <erictorres4@protonmail.com>
|
||||||
pkgname=packaging-scripts
|
pkgname=packaging-scripts
|
||||||
pkgver=1.0.3
|
pkgver=1.1
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="A set of helper scripts for handling Arch Linux packages"
|
pkgdesc="A set of helper scripts for handling Arch Linux packages"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
|
19
bin/addpkg
19
bin/addpkg
@ -58,6 +58,16 @@ def add_pkgfile(pkgfile, cachedir):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
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(
|
parser.add_argument(
|
||||||
"-s",
|
"-s",
|
||||||
"--sign",
|
"--sign",
|
||||||
@ -86,9 +96,14 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
opts = args.opts
|
opts = args.opts
|
||||||
|
|
||||||
|
if args.cachedir is not None:
|
||||||
|
cachedir = args.cachedir
|
||||||
|
else:
|
||||||
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
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}")
|
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
||||||
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
|
19
bin/delpkg
19
bin/delpkg
@ -53,6 +53,16 @@ def del_pkgfile(pkg):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
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(
|
parser.add_argument(
|
||||||
"-s",
|
"-s",
|
||||||
"--sign",
|
"--sign",
|
||||||
@ -81,9 +91,14 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
opts = args.opts
|
opts = args.opts
|
||||||
|
|
||||||
|
if args.cachedir is not None:
|
||||||
|
cachedir = args.cachedir
|
||||||
|
else:
|
||||||
cachedir = os.path.join("/var", "cache", "pacman", repo)
|
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}")
|
db = os.path.join(cachedir, f"{repo}.{DB_EXT}")
|
||||||
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
|
@ -5,6 +5,8 @@ local arguments
|
|||||||
|
|
||||||
arguments=(
|
arguments=(
|
||||||
{-h,--help}'[show this help message and exit]'
|
{-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]'
|
{-s,--sign}'[sign repository file]'
|
||||||
{-v,--verbose}'[increase script verbosity]'
|
{-v,--verbose}'[increase script verbosity]'
|
||||||
'*:filename:_files'
|
'*:filename:_files'
|
||||||
|
@ -6,6 +6,8 @@ local arguments
|
|||||||
|
|
||||||
arguments=(
|
arguments=(
|
||||||
{-h,--help}'[show this help message and exit]'
|
{-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]'
|
{-s,--sign}'[sign repository file]'
|
||||||
{-v,--verbose}'[increase script verbosity]'
|
{-v,--verbose}'[increase script verbosity]'
|
||||||
'*:filename:_files'
|
'*:filename:_files'
|
||||||
|
2
setup.py
2
setup.py
@ -5,7 +5,7 @@ with open("README.rst", "r") as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="packaging_scripts",
|
name="packaging_scripts",
|
||||||
version="1.0.3",
|
version="1.1",
|
||||||
author="Eric Russel Torres",
|
author="Eric Russel Torres",
|
||||||
author_email="erictorres4@protonmail.com",
|
author_email="erictorres4@protonmail.com",
|
||||||
description="A set of helpers for automating borg interaction",
|
description="A set of helpers for automating borg interaction",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user