aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-15 07:23:26 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-15 07:23:26 +0000
commit047ff13b39649f99b54f36bffb551d7d2b5ef95e (patch)
tree69c80096aa63611ef901709234b17a65ebff5f35
parent1605560fd48d56609a903b6bcba9dffe18864879 (diff)
downloadcpt-047ff13b39649f99b54f36bffb551d7d2b5ef95e.tar.gz
kiss: Allow comments in depends file.
FossilOrigin-Name: c1be37648a7af45e88104c26ec941a3a1eec3b7968726785fc116519fb8ff4ad
-rw-r--r--README.md5
-rwxr-xr-xkiss21
2 files changed, 24 insertions, 2 deletions
diff --git a/README.md b/README.md
index ea0f8a4..0c845ce 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ Tiny package manager for KISS Linux.
* [How does each operator work?](#how-does-each-operator-work)
* [`kiss build pkg`](#kiss-build-pkg)
* [`kiss checksum pkg`](#kiss-checksum-pkg)
+ * [`kiss depends pkg`](#kiss-depends-pkg)
* [`kiss install pkg`](#kiss-install-pkg)
* [`kiss remove pkg`](#kiss-remove-pkg)
* [`kiss search pkg`](#kiss-search-pkg)
@@ -93,6 +94,10 @@ NOTE: `build` without an argument will rebuild the entire system.
Kiss's `checksum` operator generates the initial checksums for a package from every source in the `sources` file.
+### `kiss depends pkg`
+
+Kiss's `depends` operator prints the package's dependencies.
+
### `kiss install pkg`
Kiss's `install` operator takes the built `.tar.gz` file and installs it in the system. This is as simple as removing the old version of the package (*if it exists*) and unpacking the archive at `/`.
diff --git a/kiss b/kiss
index f0f6120..4789fa6 100755
--- a/kiss
+++ b/kiss
@@ -231,6 +231,7 @@ pkg_depends() {
# packages. Keep doing this.
[ -f "$repo_dir/depends" ] &&
while read -r dep _; do
+ [ "${dep##\#*}" ] || continue
pkg_depends "$dep" ||:
done < "$repo_dir/depends"
@@ -691,7 +692,8 @@ pkg_install() {
# installing the package.
[ -f "$tar_dir/var/db/kiss/$pkg_name/depends" ] &&
while read -r dep dep_type; do
- [ "$dep_type" ] || pkg_list "$dep" >/dev/null ||
+ [ "${dep##\#*}" ] || continue
+ [ "$dep_type" ] || pkg_list "$dep" >/dev/null ||
required_install="$required_install'$dep', "
done < "$tar_dir/var/db/kiss/$pkg_name/depends"
@@ -896,6 +898,21 @@ args() {
pkg_checksums checksums "$@"
;;
+ # List dependencies for a package.
+ d*)
+ shift
+ [ "$1" ] || die "'kiss depends' requires an argument."
+
+ for pkg; do
+ repo_dir=$(pkg_search "$pkg")
+
+ [ -f "$repo_dir/depends" ] && {
+ log "[$pkg]: Has the following dependencies:"
+ cat "$repo_dir/depends"
+ }
+ done
+ ;;
+
# Install packages.
i*)
shift
@@ -933,7 +950,7 @@ args() {
# Print version and exit.
v*)
- log "$kiss 0.3.0"
+ log "$kiss 0.3.1"
;;
# Catch all invalid arguments as well as