From 519cb79498071499567925fbef679d788b436980 Mon Sep 17 00:00:00 2001 From: etorres4 Date: Thu, 17 Mar 2022 23:21:26 -0700 Subject: [PATCH] Use pacman -Qqen instead of paclist to list files --- CHANGELOG.rst | 7 +++++++ PKGBUILD | 8 ++++---- bin/pug2 | 9 ++++----- setup.py | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 77f1595..d7f4578 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ Changelog for packaging-scripts =============================== +Version 1.5.1 +------------- + +* pug2 + + * Add repository name to filename when uploading to gist + Version 1.5 ----------- diff --git a/PKGBUILD b/PKGBUILD index 38c2736..dffcf8e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,16 +1,16 @@ # Maintainer: Eric Torres pkgname=packaging-scripts -pkgver=1.5 +pkgver=1.5.1 pkgrel=1 pkgdesc="A set of helper scripts for handling Arch Linux packages" arch=('any') license=('MIT') groups=(pacman-helpers) -depends=(pacman python pacman-contrib) +depends=(pacman python) makedepends=(git python-setuptools) optdepends=('fzf: for the fqo script' 'mlocate: for the fqo script') -checkdepends=('python-hypothesis') +checkdepends=(python-hypothesis python-pytest) backup=(etc/apparmor.d/usr.bin.{addpkg,delpkg} etc/packaging-scripts.conf) source=("${pkgname}::git+file:///home/etorres/Projects/packaging-scripts") @@ -43,7 +43,7 @@ package() { done # install pug hook - install -Dm644 'misc/pug.hook' "${pkgdir}/usr/share/libalpm/hooks" + install -Dm644 'misc/pug.hook' "${pkgdir}/usr/share/libalpm/hooks/pug.hook" # install zsh completions install -d "${pkgdir}/usr/share/zsh/site-functions" diff --git a/bin/pug2 b/bin/pug2 index ad7ee27..08f43a7 100644 --- a/bin/pug2 +++ b/bin/pug2 @@ -18,7 +18,7 @@ import packaging_scripts.pacman as pacman # ========== Constants ========== # Commands -PACLIST_CMD = "/usr/bin/paclist" +PACMAN_CMD = "/usr/bin/pacman" LOCALE = "utf-8" # Paths @@ -82,14 +82,13 @@ if __name__ == "__main__": args = parser.parse_args() filename = args.filename - repo = args.repo + repo = args.repository # Run process that lists packages - packages = subprocess.run([PACLIST_CMD, args.repo], capture_output=True).stdout + packages = subprocess.run([PACMAN_CMD, "-Qqem"], capture_output=True).stdout # Write package list to file and perform upload with tempfile.NamedTemporaryFile() as tmpfile: tmpfile.write(packages) - # Upload file through gist # We use the filename in the command, not in the tempfile so gist knows what to upload as - # subprocess.run(['gist', '-f', args.filename, tmpfile.name]) + subprocess.run(["gist", "-f", args.filename, tmpfile.name]) diff --git a/setup.py b/setup.py index 4c9062a..f3acf71 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ with open("README.rst", "r") as fh: # ========== Package Setup ========== setuptools.setup( name="packaging_scripts", - version="1.5.0", + version="1.5.1", author="Eric Russel Torres", author_email="erictorres4@protonmail.com", description="A set of helpers for automating borg interaction",