diff options
author | merakor <cem@ckyln.com> | 2020-05-15 10:27:38 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-05-15 10:27:38 +0000 |
commit | 16d89890200d7745ef0ec1999b9098bf6eb4dabc (patch) | |
tree | 2b8a5d383e10f86163277438ea49c95bc8efaec9 /contrib | |
parent | d88c7c3f97baa5abbb5e7827712c99f10b82c25b (diff) | |
download | cpt-16d89890200d7745ef0ec1999b9098bf6eb4dabc.tar.gz |
contrib: move some utilities to kiss-extra
FossilOrigin-Name: 5fdd54935c99b2416dfc244cf838092ba03423c21c647d74221e65c66923b5e3
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/kiss-cargo-urlgen | 12 | ||||
-rwxr-xr-x | contrib/kiss-cargolock-urlgen | 21 | ||||
-rwxr-xr-x | contrib/kiss-changelog | 11 | ||||
-rwxr-xr-x | contrib/kiss-depends-finder | 43 | ||||
-rwxr-xr-x | contrib/kiss-exec | 23 | ||||
-rwxr-xr-x | contrib/kiss-message | 21 | ||||
-rwxr-xr-x | contrib/kiss-orphans | 20 | ||||
-rwxr-xr-x | contrib/kiss-reporevdepends | 17 |
8 files changed, 0 insertions, 168 deletions
diff --git a/contrib/kiss-cargo-urlgen b/contrib/kiss-cargo-urlgen deleted file mode 100755 index 52a10eb..0000000 --- a/contrib/kiss-cargo-urlgen +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Create static cargo sources for Rust packages -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [crate+ver] [crate+ver]"; exit 0 ; esac - -# We convert the name-version seperator from '+' to '-' to -# avoid issues that may arise from version numbers that include -# a '-'. - -for crate in "$@"; do - printf 'https://static.crates.io/crates/%s/%s.crate vendor\n' \ - "${crate%+*}" "$(echo "$crate" | sed 's/+/-/')" -done diff --git a/contrib/kiss-cargolock-urlgen b/contrib/kiss-cargolock-urlgen deleted file mode 100755 index 7d78a6a..0000000 --- a/contrib/kiss-cargolock-urlgen +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Convert the given Cargo.lock file to sources - -case "$1" in - -) set -- /dev/stdin ;; - ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} <Cargo.lock file>" "" \ - "'-' can be used to read from stdin." ; exit 0 -esac - -# Word splitting is intentional -# shellcheck disable=2046 -set -- $(sed '/name =/b;/version =/b;d' "$1" | - sed 's/version = /#/g;s/name = //;s/"//g' | - tr '\n' ' ' | sed 's/ #/#/g') - -# We convert the name-version seperator to '#' and back to '-' -# to avoid issues that may arise from version names with a '-' -for crate in "$@" ; do - printf 'https://static.crates.io/crates/%s/%s.crate vendor\n' \ - "${crate%#*}" "$crate" | sed 's/#/-/g' -done diff --git a/contrib/kiss-changelog b/contrib/kiss-changelog deleted file mode 100755 index ed323d8..0000000 --- a/contrib/kiss-changelog +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -e -# Print the git log of the specific package - -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]"; exit 0; esac - -kiss s "$1" >/dev/null -cd "$(kiss s "$1" | sed 1q)" - -# Pipe to cat so it doesn't automatically paged -# by git. -git log --format='<%as> [%an] %s - %h' . | cat diff --git a/contrib/kiss-depends-finder b/contrib/kiss-depends-finder deleted file mode 100755 index 31320ed..0000000 --- a/contrib/kiss-depends-finder +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -e -# Find missing dependencies by parsing 'ldd' - -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} <pkg>" ; exit 0 ; esac - -kiss l "$1" >/dev/null - -db_dir=$KISS_ROOT/var/db/kiss/installed -grep=$(command -v ggrep) || grep='grep' - -printf '=> Detected dependencies:\n' - -while read -r file; do - [ -d "$KISS_ROOT/$file" ] && continue - - ldd "$KISS_ROOT/$file" 2>/dev/null | while read -r dep; do - # Skip lines containing 'ldd'. - [ "${dep##*ldd*}" ] || continue - - # Extract the file path from 'ldd' output. - dep=${dep#* => } - dep=${dep% *} - - # Traverse symlinks to get the true path to the file. - pkg=$(readlink -f "$KISS_ROOT/${dep##$KISS_ROOT}") - - # Figure out which package owns the file. - pkg=$("$grep" -lFx "${pkg##$KISS_ROOT}" "$db_dir/"*/manifest) - pkg=${pkg%/*} - pkg=${pkg##*/} - - # Skip listing these packages as dependencies. - case $pkg in - musl|gcc|"$1") ;; - *) printf '%s\n' "$pkg" ;; - esac - done -done < "$db_dir/$1/manifest" | sort -u - -printf '\n=> Package dependencies:\n' - -[ -f "$db_dir/$1/depends" ] && - cat "$db_dir/$1/depends" diff --git a/contrib/kiss-exec b/contrib/kiss-exec deleted file mode 100755 index d2b3217..0000000 --- a/contrib/kiss-exec +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Execute a command inside the alternatives system - -usage() { - printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg] [command]" - exit "$1" -} - -case "$1" in ''|--help|-h) usage 0; esac -[ "$2" ] || usage 1 - -pkg=$1 - -[ "${2##/*}" ] && command=">usr>bin>$2" || - command="$(printf '%s' "$2" | sed 's#/#>#g')" - -[ -h "${file:=/var/db/kiss/choices/$pkg$command}" ] && { - printf 'ERROR: %s\n' "$file is a symlink" - exit 1 -} - -shift 2 -exec "/var/db/kiss/choices/$pkg$command" "$@" diff --git a/contrib/kiss-message b/contrib/kiss-message deleted file mode 100755 index 8b82c86..0000000 --- a/contrib/kiss-message +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Show messages from a package in the system database - -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg] [pkg]"; exit 0; esac - -for pkg do - # Apply basename stripping so a user could run - # 'kiss-message /var/db/kiss/installed/*' to see - # all the messages on the system. - pkg=${pkg##*/} - msg="$KISS_ROOT/var/db/kiss/installed/$pkg/message" - - # Continue if no messages are available for the package. - [ -f "$msg" ] || continue - - printf '%s\n\033[1m%s\033[m\n%s\n\n' \ - "==============================" \ - "$pkg" \ - "==============================" - cat "$msg" -done diff --git a/contrib/kiss-orphans b/contrib/kiss-orphans deleted file mode 100755 index 7ffc939..0000000 --- a/contrib/kiss-orphans +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -e -# List orphaned packages - -case "$1" in ''|--help|-h) - printf '\033[1;33m-> \033[m%s\n' \ - "${0##*/}: lists packages that do not have any packages depending on them" >&2 - exit 0 -esac - -cd "$KISS_ROOT/var/db/kiss/installed/" - -for pkg in *; do - case $pkg in - baseinit|baselayout|gcc|pkgconf|e2fsprogs|musl|\ - make|busybox|bzip2|grub|kiss|git|linux-headers) - continue - esac - - grep -q "^$pkg$" ./*/depends || printf '%s\n' "$pkg" -done diff --git a/contrib/kiss-reporevdepends b/contrib/kiss-reporevdepends deleted file mode 100755 index 59262f0..0000000 --- a/contrib/kiss-reporevdepends +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Display packages on the repository which depend on package -# shellcheck disable=2086 - -case "$1" in ''|--help|-h) printf 'usage: %s <pkg>\n' "${0##*/}"; exit 0; esac - -pkg="$1" -IFS=:; set -- $KISS_PATH; unset IFS - -for repo do - # Change directory to the upper directory of the repository - # so it outputs packages in this nice looking format. - # repository/package: - cd "$repo/.." ||: - # This grep only checks for the full word - grep "^$pkg\$\|^$pkg\s" -- "${repo##*/}"/*/depends 2>/dev/null ||: -done |