diff --git a/Makefile b/Makefile index ec7f8f1..395024f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ TAG = $(shell git describe --abbrev=0 --tags) BASH_SCRIPTS = \ admin/checkservices \ aur/review \ - aur/repos2aur \ package/parse-submodules \ package/pkgsearch \ package/rebuild-todo diff --git a/aur/repos2aur b/aur/repos2aur deleted file mode 100755 index ece49e9..0000000 --- a/aur/repos2aur +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# SPDX-License-Identifier: GPL-2.0 - -if (( $# == 0 )); then - echo "error: No arguments passed." - echo "pkgbase is a required argument" - exit 1 -fi - -PKGBASE=$1 - -if [[ ! -d "$PKGBASE" ]]; then - echo "error: directory $1 does not exists" - exit 1 -fi - -TMPDIR=$(mktemp -d) - -function cleanup { - rm -rf "$TMPDIR" -} - -trap cleanup EXIT - -REPONAME=$(basename "$PKGBASE") - -# The AUR does not support a main default branch, so we have to git init with a -# master branch explictly https://bugs.archlinux.org/task/72163 -git init -b master $TMPDIR -cp $PKGBASE/* $TMPDIR - -pushd $TMPDIR -git remote add origin "ssh://aur@aur.archlinux.org/$REPONAME.git" -makepkg --printsrcinfo > .SRCINFO -git add .SRCINFO -git add * - -git commit -m 'import from community' -git push origin master - -popd diff --git a/aur/review b/aur/review index 6e80873..8655090 100755 --- a/aur/review +++ b/aur/review @@ -8,7 +8,13 @@ # Default: fetches all packages and reviews them. fetch(){ - pkgs=$(curl -s "https://aur.archlinux.org/rpc/?v=5&type=search&search_by=maintainer&arg=$1" | jq -r '.results[].PackageBase' | sort -u) + pkgs=$(curl -s "https://aur.archlinux.org/rpc/?v=5&type=search&by=maintainer&arg=$1" | jq -r '.results[].PackageBase' | sort -u) + + if [[ -z ${pkgs} ]]; then + printf "no packages found for %s\n" "$1" + exit 1 + fi + for pkg in $pkgs; do printf "===> Downloading %s...\n" "$pkg" curl -s "https://aur.archlinux.org/cgit/aur.git/snapshot/$pkg.tar.gz" | tar xzm @@ -25,8 +31,10 @@ review(){ done } -case "$@" in - fetch) shift; fetch "$@" ;; - review) shift; review "$@" ;; - *) shift; fetch "$@"; review "$@" ;; -esac +while (( $# )); do + case "$1" in + fetch) shift; fetch "$@" ; exit 0;; + review) shift; review "$@" ; exit 0;; + *) fetch "$@" && review "$@" ;; + esac +done