aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-05-15 10:27:38 +0000
committermerakor <cem@ckyln.com>2020-05-15 10:27:38 +0000
commit16d89890200d7745ef0ec1999b9098bf6eb4dabc (patch)
tree2b8a5d383e10f86163277438ea49c95bc8efaec9
parentd88c7c3f97baa5abbb5e7827712c99f10b82c25b (diff)
downloadcpt-16d89890200d7745ef0ec1999b9098bf6eb4dabc.tar.gz
contrib: move some utilities to kiss-extra
FossilOrigin-Name: 5fdd54935c99b2416dfc244cf838092ba03423c21c647d74221e65c66923b5e3
-rwxr-xr-xcontrib/kiss-cargo-urlgen12
-rwxr-xr-xcontrib/kiss-cargolock-urlgen21
-rwxr-xr-xcontrib/kiss-changelog11
-rwxr-xr-xcontrib/kiss-depends-finder43
-rwxr-xr-xcontrib/kiss-exec23
-rwxr-xr-xcontrib/kiss-message21
-rwxr-xr-xcontrib/kiss-orphans20
-rwxr-xr-xcontrib/kiss-reporevdepends17
-rw-r--r--man/kiss-contrib.142
9 files changed, 0 insertions, 210 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
diff --git a/man/kiss-contrib.1 b/man/kiss-contrib.1
index 9f62ead..a77738a 100644
--- a/man/kiss-contrib.1
+++ b/man/kiss-contrib.1
@@ -5,19 +5,6 @@ kiss utilities
This manual page is not for a single program, but for multiple
utilities. Programs are explained in their own sections. They
are listed alphabetically.
-.SH KISS-CARGO-URLGEN
-.B kiss-cargo-urlgen
-[pkg+ver] [pkg+ver]
-
-Creates a list of static cargo urls which can be added to the \fBsources\fR
-file of a \fIRust\fR package. It takes arguments as the package name, plus
-sign, and the version number.
-.SH KISS-CARGOLOCK-URLGEN
-.B kiss-cargolock-urlgen
-<Cargo.lock file>
-
-Does the same as \fBkiss-cargo-urlgen\fR, but gets the package and version
-information from a \fICargo.lock\fR file.
.SH KISS-CAT
.B kiss-cat
<pkg> [file] [file]
@@ -25,11 +12,6 @@ information from a \fICargo.lock\fR file.
Concatanates a package's files inside the system database. If no file is
specified, it looks for \fBbuild\fR, \fBdepends\fR, \fBsources\fR, and
\fBversion\fR.
-.SH KISS-CHANGELOG
-.B kiss-changelog
-<pkg>
-
-Shows a git log of the specified package in an oneline format
.SH KISS-CHBUILD
.B kiss-chbuild
@@ -51,11 +33,6 @@ from host, and chroots into the given directory. Cleans up after exit.
<pkg>
Checks the dependencies of an installed package.
-.SH KISS-DEPENDSFINDER
-.B kiss-depends-finder
-<pkg>
-
-Finds the missing dependencies of packages by checking linked libraries/files.
.SH KISS-EXPORT
.B kiss-export
<pkg>
@@ -102,25 +79,11 @@ Prints the manifest file.
<pkg>
Prints the manifest file in a tree view.
-.SH KISS-MESSAGE
-.B kiss-message
-<pkg> [pkg] [pkg]
-
-Outputs the messages of the given packages. A user could run
-.IP
-kiss-message /var/db/kiss/installed/*
-.PP
-to see all the messages they have.
.SH KISS-NEW
.B kiss-new
<name> [version] [sources]
Creates a boilerplate KISS package.
-.SH KISS-ORPHANS
-.B kiss-orphans
-
-Shows orphaned packages. These packages do not have any dependent packages
-installed and can be removed.
.SH KISS-OUTDATED
.B kiss-outdated
@@ -141,11 +104,6 @@ A 'readlink -f' replacement to be used inside the package manager.
<pkg>
Prints the dependencies of the given package as they are defined in the repository.
-.SH KISS-REPOREVDEPENDS
-.B kiss-reporevdepends
-<pkg>
-
-Prints all the packages on your \fIKISS_PATH\fR that depends on package.
.SH KISS-RESET
.B kiss-reset