1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-25 16:40:07 -07:00

kiss: Allow comments in depends file.

This commit is contained in:
Dylan Araps 2019-07-15 10:23:26 +03:00
parent 4003e4ddf8
commit 875d2fd903
2 changed files with 24 additions and 2 deletions

View File

@ -14,6 +14,7 @@ Tiny package manager for KISS Linux.
* [How does each operator work?](#how-does-each-operator-work) * [How does each operator work?](#how-does-each-operator-work)
* [`kiss build pkg`](#kiss-build-pkg) * [`kiss build pkg`](#kiss-build-pkg)
* [`kiss checksum pkg`](#kiss-checksum-pkg) * [`kiss checksum pkg`](#kiss-checksum-pkg)
* [`kiss depends pkg`](#kiss-depends-pkg)
* [`kiss install pkg`](#kiss-install-pkg) * [`kiss install pkg`](#kiss-install-pkg)
* [`kiss remove pkg`](#kiss-remove-pkg) * [`kiss remove pkg`](#kiss-remove-pkg)
* [`kiss search pkg`](#kiss-search-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'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 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 `/`. 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 `/`.

19
kiss
View File

@ -231,6 +231,7 @@ pkg_depends() {
# packages. Keep doing this. # packages. Keep doing this.
[ -f "$repo_dir/depends" ] && [ -f "$repo_dir/depends" ] &&
while read -r dep _; do while read -r dep _; do
[ "${dep##\#*}" ] || continue
pkg_depends "$dep" ||: pkg_depends "$dep" ||:
done < "$repo_dir/depends" done < "$repo_dir/depends"
@ -691,6 +692,7 @@ pkg_install() {
# installing the package. # installing the package.
[ -f "$tar_dir/var/db/kiss/$pkg_name/depends" ] && [ -f "$tar_dir/var/db/kiss/$pkg_name/depends" ] &&
while read -r dep dep_type; do while read -r dep dep_type; do
[ "${dep##\#*}" ] || continue
[ "$dep_type" ] || pkg_list "$dep" >/dev/null || [ "$dep_type" ] || pkg_list "$dep" >/dev/null ||
required_install="$required_install'$dep', " required_install="$required_install'$dep', "
done < "$tar_dir/var/db/kiss/$pkg_name/depends" done < "$tar_dir/var/db/kiss/$pkg_name/depends"
@ -896,6 +898,21 @@ args() {
pkg_checksums checksums "$@" 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. # Install packages.
i*) i*)
shift shift
@ -933,7 +950,7 @@ args() {
# Print version and exit. # Print version and exit.
v*) v*)
log "$kiss 0.3.0" log "$kiss 0.3.1"
;; ;;
# Catch all invalid arguments as well as # Catch all invalid arguments as well as