From c0ba0242e2add8d63776d5cfdd2ab89320f1073d Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Fri, 17 May 2024 19:42:13 +0200 Subject: [PATCH 1/2] drop repos2aur from contrib The script was imported into devtools in https://gitlab.archlinux.org/archlinux/devtools/-/merge_requests/166 Signed-off-by: Christian Heusel --- Makefile | 1 - aur/repos2aur | 42 ------------------------------------------ 2 files changed, 43 deletions(-) delete mode 100755 aur/repos2aur 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 From 1a76404f9cb7399efad341f21a9a9a44845b433c Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Fri, 17 May 2024 20:26:27 +0200 Subject: [PATCH 2/2] fix various issues with the review script 1. fix query url 2. fix bailing when no packger was found 3. fix argument processing So far one would get an errror like the following one: $ review ls: cannot access './*/PKGBUILD': No such file or directory Signed-off-by: Christian Heusel --- aur/review | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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