cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 40ff70943267d4faa333342c6107c7938fc46386
parent a93414e325c1babbe8dd2b14621a668c9de64f2d
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Thu, 20 Feb 2020 00:21:45 +0200

kiss: Remove KISS_RM

I never really liked how this was implemented and it's
rather limited in its use. It was cumbersome to edit
the list to make even a minor change.

Instead, I now recommend using 'KISS_HOOK'. It gives
you total control. KISS_RM can be implemented on a
per-package basis, for all packages overall or
conditionally.

You're also not limited to a simple list of removals.
You can do whatever you like pre- and post- build.

Here's an example script to get you started. There
is more information in the manual and README.

case $TYPE in
    pre-build)
        case $PKG in
           zlib) export CFLAGS="-Os -static" ;;
           curl) export CFLAGS="-O3" ;;
        esac
    ;;

    post-build)
        : "${DEST:?DEST is unset}"

        rm -rf "$DEST/usr/share/doc"
        rm -rf "$DEST/usr/share/gettext"
    ;;
esac

Diffstat:
MREADME.md | 16++++------------
Mkiss | 38--------------------------------------
Mkiss.1 | 16++++------------
3 files changed, 8 insertions(+), 62 deletions(-)

diff --git a/README.md b/README.md @@ -70,17 +70,6 @@ See: <https://k1ss.org/pages/package-system/> # add your own repositories or remove the default ones. export KISS_PATH=/var/db/kiss/repo/core:/var/db/kiss/repo/extra:/var/db/kiss/repo/xorg -# Delete junk from packages. -# -# This works exactly like '$PATH' (Colon separated). -# -# A list of paths and files to remove from built packages. -# -# Set this to a blank value to keep all of the below files -# and directories around. This can be customized to keep or -# remove whatever you like. -export KISS_RM=usr/share/doc:usr/share/gtk-doc:usr/share/info:usr/share/polkit-1:usr/share/gettext:usr/share/locale:etc/bash_completion.d:usr/share/zsh - # Force package installation or removal. # # This can be used to bypass the dependency checks on installation @@ -119,7 +108,10 @@ export KISS_AUDIT=0 # ;; # # post-build) -# # post-build code here. +# : "${DEST:?DEST is unset}" +# +# rm -rf "$DEST/usr/share/doc" +# rm -rf "$DEST/usr/share/gettext" # ;; # esac # diff --git a/kiss b/kiss @@ -441,43 +441,6 @@ pkg_fixdeps() { rm -f depends-copy } -pkg_junk() ( - # Optionally remove "junk" files from packages. This includes 'info' - # files, 'man' pages, gettext files, etc. This is configurable by the - # user. - # - # This function runs as a sub-shell to avoid having to 'cd' back to the - # prior directory before being able to continue. - cd "$pkg_dir/$1" - - # Default list of directories and their contents to be removed from - # built packages. This default assumes a prefix of '/usr' though the - # user can further configure it to search whatever paths they desire. - # - # TODO: This could be nicer as could the interface to it. Something - # which allows for the addition/subtraction from the list - # would be desirable. - rm=usr/share/doc:usr/share/gtk-doc:usr/share/info:usr/share/polkit-1 - rm=$rm:usr/share/gettext:usr/share/locale:usr/share/bash-completion - rm=$rm:etc/bash_completion.d:usr/share/applications - rm=$rm:usr/share/zsh/site-functions:usr/share/zsh/vendor-completions - - # Split the environment variable on ':' and turn it into an argument - # list. This works exactly like '$KISS_PATH'. - # - # Files which always conflict (such as usr/lib/charset.alias) and are - # uneeded should be removed regardless. - # - # shellcheck disable=2046,2086 - { IFS=:; set -- ${KISS_RM:-$rm} usr/lib/charset.alias; IFS=$old_ifs; } - - # Loop over each junk entry and delete it if it exists. - for junk; do - [ -e "./$junk" ] && rm -rf "./$junk" && - log "${PWD##*/}" "Removed $junk" - done ||: -) - pkg_manifest() ( # Generate the package's manifest file. This is a list of each file # and directory inside the package. The file is used when uninstalling @@ -651,7 +614,6 @@ pkg_build() { pkg_strip "$pkg" pkg_fixdeps "$pkg" - pkg_junk "$pkg" pkg_manifest "$pkg" pkg_etcsums "$pkg" pkg_tar "$pkg" diff --git a/kiss.1 b/kiss.1 @@ -46,17 +46,6 @@ Tiny and straightforward package manager for KISS written in POSIX sh. # add your own repositories or remove the default ones. export KISS_PATH=/var/db/kiss/repo/core:/var/db/kiss/repo/extra:/var/db/kiss/repo/xorg -# Delete junk from packages. -# -# This works exactly like '$PATH' (Colon separated). -# -# A list of paths and files to remove from built packages. -# -# Set this to a blank value to keep all of the below files -# and directories around. This can be customized to keep or -# remove whatever you like. -export KISS_RM=usr/share/doc:usr/share/gtk-doc:usr/share/info:usr/share/polkit-1:usr/share/gettext:usr/share/locale:etc/bash_completion.d:usr/share/zsh - # Force package installation or removal. # # This can be used to bypass the dependency checks on installation @@ -95,7 +84,10 @@ export KISS_AUDIT=0 # ;; # # post-build) -# # post-build code here. +# : "${DEST:?DEST is unset}" +# +# rm -rf "$DEST/usr/share/doc" +# rm -rf "$DEST/usr/share/gettext" # ;; # esac #