mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 00:20:05 -07:00
kiss: add options to remove junk files
This commit is contained in:
parent
daa1b364f7
commit
6e4c8f11ff
56
kiss
56
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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user