Use pacman -Qqen instead of paclist to list files

This commit is contained in:
etorres4 2022-03-17 23:21:26 -07:00
parent 18763a8085
commit 519cb79498
4 changed files with 16 additions and 10 deletions

View File

@ -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
-----------

View File

@ -1,16 +1,16 @@
# Maintainer: Eric Torres <erictorres4@protonmail.com>
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"

View File

@ -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])

View File

@ -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",