From d44c509b37028af671f792b037e8283176186f5c Mon Sep 17 00:00:00 2001 From: Camille Scholtz Date: Sun, 30 Aug 2020 22:28:01 +0200 Subject: [PATCH] Add CRUX style usage using the current directory as the name of the package to be operated on --- contrib/kiss-depends | 8 +++++++- contrib/kiss-export | 8 +++++++- contrib/kiss-maintainer | 8 +++++--- contrib/kiss-manifest | 8 +++++++- contrib/kiss-revdepends | 7 +++---- contrib/kiss-size | 8 +++++++- 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/contrib/kiss-depends b/contrib/kiss-depends index 1ea4b54..0dd0136 100755 --- a/contrib/kiss-depends +++ b/contrib/kiss-depends @@ -1,9 +1,15 @@ #!/bin/sh -ef # Display a package's dependencies +# CRUX style usage using the current directory as the name of the package to be +# operated on. +[ "$1" ] || { + set -- "${PWD##*/}" +} + # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -[ "$1" ] && kiss l "${1:-null}" >/dev/null || { +kiss l "${1:-null}" >/dev/null || { printf 'usage: kiss-depends [pkg]\n' exit 1 } diff --git a/contrib/kiss-export b/contrib/kiss-export index ddd174e..0162780 100755 --- a/contrib/kiss-export +++ b/contrib/kiss-export @@ -1,9 +1,15 @@ #!/bin/sh -ef # Turn an installed package into a KISS tarball +# CRUX style usage using the current directory as the name of the package to be +# operated on. +[ "$1" ] || { + set -- "${PWD##*/}" +} + # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -[ "$1" ] && kiss l "${1:-null}" >/dev/null || { +kiss l "${1:-null}" >/dev/null || { printf 'usage: kiss-export [pkg]\n' exit 1 } diff --git a/contrib/kiss-maintainer b/contrib/kiss-maintainer index 3e2c3d2..4635f05 100755 --- a/contrib/kiss-maintainer +++ b/contrib/kiss-maintainer @@ -1,12 +1,14 @@ #!/bin/sh -ef # Find the maintainer of a package +# CRUX style usage using the current directory as the name of the package to be +# operated on. [ "$1" ] || { - printf 'usage: kiss-maintainer [pkg]\n' - exit 1 + export KISS_PATH=${PWD%/*}:$KISS_PATH + set -- "${PWD##*/}" } -kiss s "$1" | while read -r repo; do cd "$repo" +kiss s "$@" | sort -u | while read -r repo; do cd "$repo" m=$(git log -1 version 2>/dev/null) ||: m=${m##*Author: } m=${m%%>*} diff --git a/contrib/kiss-manifest b/contrib/kiss-manifest index 272ce54..0652ade 100755 --- a/contrib/kiss-manifest +++ b/contrib/kiss-manifest @@ -1,9 +1,15 @@ #!/bin/sh -ef # Display all files owned by a package +# CRUX style usage using the current directory as the name of the package to be +# operated on. +[ "$1" ] || { + set -- "${PWD##*/}" +} + # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -[ "$1" ] && kiss l "${1:-null}" >/dev/null || { +kiss l "${1:-null}" >/dev/null || { printf 'usage: kiss-manifest [pkg]\n' exit 1 } diff --git a/contrib/kiss-revdepends b/contrib/kiss-revdepends index 8fdcd31..33bb9e5 100755 --- a/contrib/kiss-revdepends +++ b/contrib/kiss-revdepends @@ -1,11 +1,10 @@ #!/bin/sh -e # Display packages which depend on package -# Ignore shellcheck as we want the warning's behavior. -# shellcheck disable=2015 +# CRUX style usage using the current directory as the name of the package to be +# operated on. [ "$1" ] || { - printf 'usage: kiss-revdepends [pkg]\n' - exit 1 + set -- "${PWD##*/}" } # 'cd' to the database directory as a simple way of diff --git a/contrib/kiss-size b/contrib/kiss-size index 7cb2bd2..7f4b34b 100755 --- a/contrib/kiss-size +++ b/contrib/kiss-size @@ -15,9 +15,15 @@ get_size() { printf '%s\t%s\n' "$hum" "$2" } +# CRUX style usage using the current directory as the name of the package to be +# operated on. +[ "$1" ] || { + set -- "${PWD##*/}" +} + # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -[ "$1" ] && kiss l "${1:-null}" >/dev/null || { +kiss l "${1:-null}" >/dev/null || { printf 'usage: kiss-size [pkg]\n' exit 1 }