aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-10-07 12:07:25 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-10-07 12:07:25 +0000
commit38de2e6d04cdca4c10f6a4a76dbe8bf444488020 (patch)
treee3e74c2ae9fcf4d733512c4ff33d476cefa92105 /kiss
parent11098542bba92a29d5a10cf46b732012978d780b (diff)
downloadcpt-38de2e6d04cdca4c10f6a4a76dbe8bf444488020.tar.gz
kiss: add options to remove junk files
FossilOrigin-Name: 2f76d12705ce7d092a95330ee7822c3d3663aab6937076f465a19163dce0753f
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss56
1 files changed, 56 insertions, 0 deletions
diff --git a/kiss b/kiss
index 93ba4ed..3d8ac4e 100755
--- a/kiss
+++ b/kiss
@@ -304,6 +304,61 @@ 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 to enable choice.
+ #
+ # This funcion runs as a sub-shell to avoid having to 'cd' back to the
+ # prior directory before being able to continue.
+ cd "$pkg_dir/$1"
+
+ # Man pages (kept by default).
+ [ "${KISS_KEEP_MAN:-1}" = 1 ] || {
+ log "$1" "Removing man pages"
+
+ rm -rf usr/share/man
+ }
+
+ # Info files (deleted by default).
+ [ "${KISS_KEEP_INFO:-0}" = 1 ] || {
+ log "$1" "Removing info files"
+
+ rm -rf usr/share/info
+ }
+
+ # Intl files (deleted by default).
+ [ "${KISS_KEEP_INTL:-0}" = 1 ] || {
+ log "$1" "Removing intl files"
+
+ rm -rf usr/share/gettext
+ rm -rf usr/share/locale
+ }
+
+ # Documentation (deleted by default).
+ [ "${KISS_KEEP_DOC:-0}" = 1 ] || {
+ log "$1" "Removing documentation"
+
+ rm -rf usr/share/doc
+ rm -rf usr/share/gtk-doc
+ }
+
+ # Shell completions (deleted by default).
+ [ "${KISS_KEEP_SHCOMP:-0}" = 1 ] || {
+ log "$1" "Removing shell completions"
+
+ rm -rf etc/bash_completion.d
+ rm -rf usr/share/zsh
+ }
+
+ # Misc junk (deleted by default).
+ [ "${KISS_KEEP_JUNK:-0}" = 1 ] || {
+ log "$1" "Removing junk"
+
+ rm -rf usr/share/polkit-1
+ }
+)
+
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
@@ -467,6 +522,7 @@ pkg_build() {
pkg_strip "$pkg"
pkg_fixdeps "$pkg"
+ pkg_junk "$pkg"
pkg_manifest "$pkg"
pkg_tar "$pkg"