Commit Graph

1459 Commits

Author SHA1 Message Date
Dylan Araps 515ae5b549
kiss: fix bug with source download and variables 2021-07-15 09:34:21 +03:00
Dylan Araps 46993dfa26
kiss: 5.5.0 2021-07-15 07:44:43 +03:00
Dylan Araps 534ab0d96d
kiss: simplify check 2021-07-15 07:41:59 +03:00
Dylan Araps c0cc18b6ee
kiss: Give tarball to post-package hook. See #234 2021-07-15 07:30:09 +03:00
Dylan Araps ec3952b014
misc: typo 2021-07-15 07:23:06 +03:00
Dylan Araps e7f691d992
kiss: update hook docs 2021-07-15 07:20:31 +03:00
Dylan Araps 7f537f7d31
kiss: document hooks. See #234
Information can be retrieved with something like this.

grep -o '\(type\|arg[0-9]\|PWD\): .*' kiss
2021-07-14 23:59:22 +03:00
Dylan Araps 7213bfc88c
kiss: export more variables. See #235 2021-07-14 23:46:43 +03:00
Dylan Araps 679d145434
kiss: only split version once per package 2021-07-14 23:39:44 +03:00
Dylan Araps aa0c62fe4a
kiss: remove unneeded argument given to update hooks
- PWD in hooks is same value anyway.

See #234
2021-07-14 21:40:40 +03:00
Dylan Araps a024ef4663
kiss: simplify run_hook. Remove hardcoded argument count 2021-07-14 21:20:13 +03:00
Dylan Araps cd242f6d23
kiss: add pre/post-update hooks. See #234 2021-07-14 21:13:53 +03:00
Dylan Araps 4ebbfc094f
kiss: make KISS_HOOK generic again, also skip empty tokens. Closes #229 2021-07-14 20:25:33 +03:00
Dylan Araps 509d911236
misc: typo 2021-07-14 20:13:30 +03:00
Dylan Araps cee9184832
misc: typo 2021-07-14 20:06:41 +03:00
Dylan Araps 1520854f89
kiss: fix comment 2021-07-14 19:57:00 +03:00
Dylan Araps 7d256b203c
kiss: support a system-wide hook directory with easy use.
Hooks installed to /var/db/kiss/hooks can be accessed via their
basename. Usage is as follows.

$ ls -1 /var/db/kiss/hooks
no-docs
shell-on-exit

$ export KISS_HOOK=no-docs:shell-on-exit:/home/dylan/bin/kiss_hook

See #229
2021-07-14 18:47:01 +03:00
Dylan Araps 7fc6929516
kiss: KISS_HOOK support multiple files
See #229
2021-07-14 18:40:37 +03:00
Dylan Araps d296b90b75
kiss: support variables in sources files.
This adds support for replacement of simple markers with
corresponding values. To handle cases where a replacement
is not 1:1, various transformations are made available.

- VERSION : The full version string (first field in version file).
- MAJOR   : First component separated by '.'.
- MINOR   : Second component separated by '.'.
- PATCH   : Third component separated by '.'.
- IDENT   : All remaining components separated by '.+-'.
- PKG     : The name of the current package.

NOTE: This may be reverted. Depends on how good the benefits
are. Will do an evaluation of the repositories.
2021-07-14 17:08:58 +03:00
Dylan Araps 6543f3c769
kiss: fix linter 2021-07-14 14:13:27 +03:00
Dylan Araps d765dbd043
kiss: do not source KISS_HOOK
This file can now be written in any language. The only requirement
now is that it be executable. The variable originally exported in
the environment are passed as command-line arguments to KISS_HOOK.

We can now expand on the information we want to explicitly pass on
to hooks via arguments or the environment. Let me know what
information you would like exposed.
2021-07-14 13:41:22 +03:00
Dylan Araps 38722107c6
kiss: remove unneeded shellcheck directive 2021-07-14 13:13:18 +03:00
Dylan Araps a1377fd282
kiss: fix environment change, old code was.. 2021-07-14 13:11:26 +03:00
Dylan Araps 61b5972ebb
kiss: give build scripts some environment variables
- Defines DESTDIR so you no longer need to export it yourself.
- Defines CC and CXX so all builds will now work with other
  compilers if gcc/g++ are the default when unset.
- Defines KISS_ROOT with the sanitized version used by the package
  manager. It can now be safely joined with other paths.
  ("$KISS_ROOT/path/to/file")
2021-07-14 13:05:21 +03:00
Dylan Araps b5308cd471
kiss: fix linter 2021-07-14 11:46:43 +03:00
Dylan Araps 463ac854d7
kiss: ensure exit on first error during install 2021-07-14 11:42:25 +03:00
Dylan Araps 7e2a79a7fa
kiss: ensure move only occurs when copy fails 2021-07-14 11:33:51 +03:00
Dylan Araps e671914090
misc: whitespace 2021-07-14 11:32:57 +03:00
Dylan Araps 51a101f96e
kiss: move tests to if block 2021-07-14 11:12:36 +03:00
Dylan Araps b5fba97ec8
kiss: fix errors with circular symbolic links.
Fixes #232
2021-07-14 10:33:45 +03:00
Dylan Araps 3ab8b4bb2c
kiss: simplify pkg_install_files 2021-07-14 10:22:28 +03:00
Dylan Araps 759e4fb868
pkg_find: use case 2021-07-14 10:04:18 +03:00
Dylan Araps c2e5a03af8
kiss: ensure return on error 2021-07-14 07:28:01 +03:00
Dylan Araps 103ac9fc69
kiss: fix syntax error 2021-07-13 23:48:03 +03:00
Dylan Araps 9fe129bef7
misc: nit 2021-07-13 23:16:21 +03:00
Dylan Araps 44c39789f7
kiss: simplify pkg_install_files further 2021-07-13 23:01:24 +03:00
Dylan Araps 7481a9dca0
kiss: simplify pkg_install_files
Permissions are already preserved.
2021-07-13 22:52:42 +03:00
Dylan Araps a5be67afa7
kiss: installation fixes
- No longer keep going on error.
- Fixed updates crashings software/systems.

Closes #226
2021-07-13 20:44:32 +03:00
Dylan Araps f8078d884a
kiss: Inform the user of any repository orphans.
During updates the package manager will now tell you if a package
has been dropped from repositories - ie, the only place the package
exists is in /var/db/kiss/installed.
2021-07-13 10:29:21 +03:00
Dylan Araps c2fbc4193f
misc: rename updates -> update 2021-07-12 12:44:27 +03:00
Dylan Araps 96030c4917
kiss: default to openssl for sha256sums
This brings a nice little performance increase.

The time required to checksum Firefox's sources
is more than halved on my machine.
2021-07-12 11:44:30 +03:00
Dylan Araps acc1a22475
kiss: fix installation errors. Closes #228 2021-07-12 10:53:15 +03:00
Dylan Araps ef2aff7ce9
kiss: fix tbz sources. Closes #227 2021-07-12 03:57:48 +03:00
Dylan Araps d3adf7d773
kiss: fix installation of files causing processes to die.
This modifies pkg_install_files() to do atomic mv on each of the
files. This prevents processes from crashing when the underlying
shared library changes (but the inode stays the same).

Closes #226
2021-07-12 01:05:24 +03:00
Dylan Araps 4149fc0530
kiss: 5.4.11 2021-07-11 15:40:35 +03:00
Dylan Araps ea59543996
kiss: Fix dependency detector issue with glibc. See #225 2021-07-11 15:33:59 +03:00
Dylan Araps 918a75f43d
kiss: Fix dependency detector issues with glibc. Closes #225 2021-07-11 15:23:57 +03:00
Dylan Araps 60ad9cfafc
kiss: Fix dependency detector issue with glibc 2021-07-11 15:05:27 +03:00
Dylan Araps 66c6bfcfae
kiss: move mkdir/cd to mkcd, fix bug with sources and mkdir 2021-07-11 11:26:28 +03:00
Dylan Araps 8c2591f6b4
kiss: fix bug with source printing 2021-07-11 11:14:01 +03:00
Dylan Araps 69fc1e15ec
kiss: fix bug when log file cannot be written 2021-07-11 00:35:50 +03:00
Dylan Araps 5fab95f7c6
kiss: silence read error 2021-07-11 00:27:32 +03:00
Dylan Araps 0de9322eb2
kiss 5.4.10 2021-07-08 17:46:43 +03:00
Dylan Araps c2216a3388
kiss: skip already seen directories during tar hack
Fixed bug where fcft/fcft becomes fcft.
Also improves performance.
2021-07-08 15:12:43 +03:00
Dylan Araps 6db1ac3bd0
kiss; 5.4.9 2021-07-08 14:08:21 +03:00
Dylan Araps abeaf4a7a7
kiss: initial steps to fixing kiss r arg handling 2021-07-08 13:54:37 +03:00
Dylan Araps 91b39a0f97
kiss: remove reverse ordering for kiss r (needs to be replaced) 2021-07-08 13:04:28 +03:00
Dylan Araps 3e08cf1ff2
kiss: set KISS_COMPRESS once 2021-07-08 11:15:31 +03:00
Dylan Araps 40fd458c8f
kiss: use KISS_COMPRESS when getting tarballs from cache 2021-07-08 11:10:45 +03:00
Dylan Araps 7d22d91611
kiss: don't show it twice 2021-07-07 23:10:07 +03:00
Dylan Araps 429b8011e0
kiss: show tarball name 2021-07-07 23:07:47 +03:00
Dylan Araps 1a0943a84f
kiss: 5.4.8 2021-07-07 12:44:18 +03:00
Dylan Araps cd27776fd8
kiss: nit 2021-07-07 11:45:21 +03:00
Dylan Araps a2cb46d126
kiss: remove unneeded pkg_find 2021-07-07 11:16:25 +03:00
Dylan Araps 855bda4497
kiss: only sort manifest once during install 2021-07-07 10:34:05 +03:00
Dylan Araps 001ce0396f
kiss: improve install performance slightly 2021-07-07 10:30:43 +03:00
Dylan Araps 9d34420bee
kiss: check for directory first 2021-07-07 10:17:19 +03:00
Dylan Araps 9becb3b9a1
kiss: use case 2021-07-07 10:11:23 +03:00
Dylan Araps d6db894cbc
kiss: expose build queue to hooks
_build_cur holds current package number.
_build_tot holds the total number of packages.

Closes #222
2021-07-07 10:12:33 +03:00
Dylan Araps 2008f7478e
kiss: fix bugs
- Fixed ldd mode not working.
- Fixed too strict argument validation (need to use IFS).
2021-07-06 22:45:50 +03:00
Dylan Araps 018c362a5f
kiss: add run_hook_pkg and pre-remove user hook 2021-07-06 22:23:27 +03:00
Dylan Araps 4931d9762c
misc: nit 2021-07-06 22:16:39 +03:00
Dylan Araps 7f02d9bcad
kiss: remove post-install logging
I want to redo this in a less awful way.
2021-07-06 22:16:00 +03:00
Dylan Araps 422262d629
kiss: make pre-remove errors fatal 2021-07-06 22:14:57 +03:00
Dylan Araps 825e0305bf
kiss: ensure input tarball contains @ 2021-07-06 22:10:23 +03:00
Dylan Araps 5f93bfef55
kiss: rewrite install input 2021-07-06 22:07:12 +03:00
Dylan Araps 0c51261486
kiss: fix globs 2021-07-06 22:00:43 +03:00
Dylan Araps 837148bc9b
kiss: don't lint tarballs 2021-07-06 21:55:48 +03:00
Dylan Araps 3ac3fdcbf8
kiss: use pkg_order for crux-like usage 2021-07-06 21:49:44 +03:00
Dylan Araps c716a4b996
kiss: nit 2021-07-06 21:41:30 +03:00
Dylan Araps caff0ef981
kiss: arg clean up 2021-07-06 21:35:37 +03:00
Dylan Araps 47d057a52c
kiss: move build code to separate function 2021-07-06 21:25:56 +03:00
Dylan Araps af19cd7d6d
kiss: rename pkg_build to pkg_build_all 2021-07-06 21:14:51 +03:00
Dylan Araps 08199f6977
kiss: lint all arguments early. lint all dependencies during pkg_depends 2021-07-06 21:12:19 +03:00
Dylan Araps 0c1d4cbcf5
pkg_find_version: silence stderr 2021-07-06 21:05:03 +03:00
Dylan Araps 49b2b72cd8
kiss: use pkg_order for all applicable actions 2021-07-06 20:53:54 +03:00
Dylan Araps c3fa50a921
unify argument parsing 2021-07-06 20:41:25 +03:00
Dylan Araps fe6c391b10
kiss: simplify pkg_lint 2021-07-06 20:26:47 +03:00
Dylan Araps 62e0c14f01
kiss: 5.4.7 2021-07-06 19:59:53 +03:00
Dylan Araps fe1d610054
kiss: more depends fixes 2021-07-06 19:53:49 +03:00
Dylan Araps d267e2106e
kiss: fix dependency issue with make depends 2021-07-06 19:34:44 +03:00
Dylan Araps 2d913c45a8
pkg_depends: use if 2021-07-06 19:23:02 +03:00
Dylan Araps 47e870e375
kiss: run hook after repo check 2021-07-06 18:32:36 +03:00
Dylan Araps 10e2fd2553
misc: nit 2021-07-06 18:30:43 +03:00
Dylan Araps ebb43819c0
misc: nit 2021-07-06 18:26:50 +03:00
Dylan Araps 0a874f9275
misc: fix lint 2021-07-06 13:18:28 +03:00
Dylan Araps 4607718077
kiss: 5.4.6 2021-07-06 13:16:58 +03:00
Dylan Araps 2cd3422ff6
sh256: add back checks 2021-07-06 13:16:34 +03:00
Dylan Araps 2f48bff2e7
kiss: 5.4.5 2021-07-06 12:30:53 +03:00
Dylan Araps 0d69e23048
kiss: fix checksums error. Closes #220 2021-07-06 12:30:31 +03:00
Dylan Araps d1dad7eefd
kiss: 5.4.4 2021-07-06 01:40:42 +03:00
Dylan Araps 6a1beec917
kiss: add check for blank lines / comments 2021-07-06 01:39:21 +03:00
Dylan Araps 874647f287
sh256: remove training wheels 2021-07-05 15:18:29 +03:00
Dylan Araps 94216812c3
kiss: correct redirection 2021-07-05 15:13:06 +03:00
Dylan Araps b674becc82
kiss: remove subshell usage with sh256 2021-07-05 15:10:48 +03:00
Dylan Araps 88f74d2d21
kiss: remove KISS_DL 2021-07-05 14:07:54 +03:00
Dylan Araps d0ee4c457e
kiss: 5.4.3 2021-07-05 14:05:43 +03:00
Dylan Araps df40997c4f
kiss: fix duplicated installs on update 2021-07-05 14:03:02 +03:00
Dylan Araps 94029af80a
pkg_checksums: remove unneeded pkg_find 2021-07-05 13:55:17 +03:00
Dylan Araps b8b11b80af
kiss: remove unneeded pkg_find_version 2021-07-05 13:52:54 +03:00
Dylan Araps 9fb32d0177
kiss: remove unneeded pkg_find call 2021-07-05 13:50:50 +03:00
Dylan Araps 6ef9a98ee3
kiss: fix install bug with multiple packages
If a cp fails, the file's contents is still that of the previous
package. This ensures they are truncated where applicable.
2021-07-05 13:47:45 +03:00
Dylan Araps 9c89761268
pkg_manifest: remove subshell 2021-07-05 13:26:16 +03:00
Dylan Araps cbc638ac11
kiss: pkg_fix_deps less indentation 2021-07-05 13:16:37 +03:00
Dylan Araps f9bf8816f2
kiss: add back prevention of empty depends files 2021-07-05 13:10:05 +03:00
Dylan Araps 3d431fe22c
kiss: fix_deps clean up
also fixed bug in pkg_installable
and misc clean up
2021-07-05 13:05:24 +03:00
Dylan Araps 09f48044aa
kiss: use unique variable names for loops in pkg_find 2021-07-05 12:25:06 +03:00
Dylan Araps bb9e508cc8
kiss: remove globals from pkg_find 2021-07-05 12:22:52 +03:00
Dylan Araps 1283a0b1a2
misc: nit 2021-07-05 11:44:48 +03:00
Dylan Araps e89f1d1af4
misc: nit 2021-07-05 11:42:52 +03:00
Dylan Araps b1945ba3bf
kiss: move tar code to function 2021-07-05 11:37:00 +03:00
Dylan Araps 0fac485e41
kiss: put error in func 2021-07-05 11:23:10 +03:00
Dylan Araps b2646fc0ef
misc: comments 2021-07-04 13:02:45 +00:00
Dylan Araps 4b7ad1227d
kiss: add back explicit errors 2021-07-04 12:50:50 +00:00
Dylan Araps 7e8ced253d
kiss: restore PWD 2021-07-04 12:47:03 +00:00
Dylan Araps 3d1d4ef792
kiss: remove transitional support for <pkg>#<ver>... tarball scheme.
If your cache still contains these:

run() {
  printf '%s\n' "$*"
  "$@"
}

set -- "${XDG_CACHE_HOME:-"$HOME/.cache"}/kiss/bin/"*.tar.*

for f do
    dir=${f%/*}
    pkg=${f##*/}
    pkg=${pkg%[#@]*}
    suf=${f##*[#@]}

    case $f in "$dir/$pkg#$suf")
        run mv -f "$f" "$dir/$pkg@$suf"
    esac
done
2021-07-04 11:50:23 +00:00
Dylan Araps a24ab03b2d
kiss: added KISS_DL to set download tool.
The command is split into words and executed as follows:

$KISS_DL <dest_file> <url>

Examples:

KISS_DL='curl -fLo' (default)
KISS_DL='wget -O'
KISS_DL='aria2c -o'
...
2021-07-04 11:34:29 +00:00
Dylan Araps 46a2bbdee0
kiss: add license header
It can now be distributed as a single file while keeping license
intact.
2021-07-04 11:18:10 +00:00
Dylan Araps 2d70c5aeac
kiss: rewrite source handling
- Adds function to resolve sources.
- Tarball extraction now works with local files.
- Zip extraction now works with local files.
- Fixes internal path joining issues.
2021-07-04 11:12:56 +00:00
Dylan Araps 58e90fa779
kiss: rewrite checksum verification
- fixes bug where mismatch would not occur.
- removes awk usage.
- removes pipe.
- removes subshell.
2021-07-04 11:01:49 +00:00
Dylan Araps aaed6fb8c3
misc: silence warning 2021-07-03 23:42:23 +00:00
Dylan Araps f66659e5b1
kiss: show all missing manifest files 2021-07-03 23:39:40 +00:00
Dylan Araps 8f0bf83897
kiss: move install check to functions
also some clean up
2021-07-03 23:31:04 +00:00
Dylan Araps 4396d34fcc
pkg_list: remove cd usage 2021-07-03 23:07:36 +00:00
Dylan Araps 000e8e36d3
misc: nit 2021-07-03 22:20:19 +00:00
Dylan Araps d5e79e49b6
kiss: Stricter argument validation 2021-07-03 15:46:09 +00:00
Dylan Araps 28f991039b
kiss: bump version 2021-07-03 15:25:04 +00:00
Dylan Araps 9253c6646b
misc: fix false positives 2021-07-03 15:23:51 +00:00
Dylan Araps b1faf0ce70
kiss: bump version 2021-07-03 15:14:20 +00:00
Dylan Araps 08a8ccd168
misc: cleanup args i 2021-07-03 15:12:40 +00:00
Dylan Araps 84f1eb7c98
kiss: remove unneeded subshell from pkg_depends 2021-07-03 15:08:02 +00:00
Dylan Araps 65474c56e3
kiss: revert remove unneeded subshell 2021-07-03 15:04:14 +00:00
Dylan Araps 15f73d7601
kiss: remove unneeded subshell 2021-07-03 15:00:24 +00:00
Dylan Araps 32cdd4efc1
kiss: add pkg_find_version() 2021-07-03 14:48:39 +00:00
Dylan Araps d107c43098
kiss: simplify pkg_etcsums
- Removes subshell usage.
- Removes cd usage.
2021-07-03 14:37:26 +00:00
Dylan Araps 95e3fc8f8e
misc: nit 2021-07-03 14:34:13 +00:00
Dylan Araps 402e5cf5de
misc: nit 2021-07-03 14:30:28 +00:00
Dylan Araps 10b378462d
misc: remove pointless comments 2021-07-03 14:27:44 +00:00
Dylan Araps 2e495b59e5
misc: typo 2021-07-03 10:48:14 +00:00
Dylan Araps 846bd4cfd9
misc: nit 2021-07-03 10:23:04 +00:00