Add CRUX style usage using the current directory as the name of the package to be operated on

This commit is contained in:
Camille Scholtz 2020-08-30 22:28:01 +02:00
parent 00671aaa7e
commit d44c509b37
6 changed files with 36 additions and 11 deletions

View File

@ -1,9 +1,15 @@
#!/bin/sh -ef #!/bin/sh -ef
# Display a package's dependencies # 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. # Ignore shellcheck as we want the warning's behavior.
# shellcheck disable=2015 # shellcheck disable=2015
[ "$1" ] && kiss l "${1:-null}" >/dev/null || { kiss l "${1:-null}" >/dev/null || {
printf 'usage: kiss-depends [pkg]\n' printf 'usage: kiss-depends [pkg]\n'
exit 1 exit 1
} }

View File

@ -1,9 +1,15 @@
#!/bin/sh -ef #!/bin/sh -ef
# Turn an installed package into a KISS tarball # 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. # Ignore shellcheck as we want the warning's behavior.
# shellcheck disable=2015 # shellcheck disable=2015
[ "$1" ] && kiss l "${1:-null}" >/dev/null || { kiss l "${1:-null}" >/dev/null || {
printf 'usage: kiss-export [pkg]\n' printf 'usage: kiss-export [pkg]\n'
exit 1 exit 1
} }

View File

@ -1,12 +1,14 @@
#!/bin/sh -ef #!/bin/sh -ef
# Find the maintainer of a package # Find the maintainer of a package
# CRUX style usage using the current directory as the name of the package to be
# operated on.
[ "$1" ] || { [ "$1" ] || {
printf 'usage: kiss-maintainer [pkg]\n' export KISS_PATH=${PWD%/*}:$KISS_PATH
exit 1 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=$(git log -1 version 2>/dev/null) ||:
m=${m##*Author: } m=${m##*Author: }
m=${m%%>*} m=${m%%>*}

View File

@ -1,9 +1,15 @@
#!/bin/sh -ef #!/bin/sh -ef
# Display all files owned by a package # 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. # Ignore shellcheck as we want the warning's behavior.
# shellcheck disable=2015 # shellcheck disable=2015
[ "$1" ] && kiss l "${1:-null}" >/dev/null || { kiss l "${1:-null}" >/dev/null || {
printf 'usage: kiss-manifest [pkg]\n' printf 'usage: kiss-manifest [pkg]\n'
exit 1 exit 1
} }

View File

@ -1,11 +1,10 @@
#!/bin/sh -e #!/bin/sh -e
# Display packages which depend on package # Display packages which depend on package
# Ignore shellcheck as we want the warning's behavior. # CRUX style usage using the current directory as the name of the package to be
# shellcheck disable=2015 # operated on.
[ "$1" ] || { [ "$1" ] || {
printf 'usage: kiss-revdepends [pkg]\n' set -- "${PWD##*/}"
exit 1
} }
# 'cd' to the database directory as a simple way of # 'cd' to the database directory as a simple way of

View File

@ -15,9 +15,15 @@ get_size() {
printf '%s\t%s\n' "$hum" "$2" 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. # Ignore shellcheck as we want the warning's behavior.
# shellcheck disable=2015 # shellcheck disable=2015
[ "$1" ] && kiss l "${1:-null}" >/dev/null || { kiss l "${1:-null}" >/dev/null || {
printf 'usage: kiss-size [pkg]\n' printf 'usage: kiss-size [pkg]\n'
exit 1 exit 1
} }