mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-07-02 14:02:26 +00:00
Merge pull request #61 from kisslinux/junk
kiss: add options to remove junk files
This commit is contained in:
commit
b85fd15319
30
kiss
30
kiss
|
@ -304,6 +304,35 @@ pkg_fixdeps() {
|
||||||
rm -f depends-copy
|
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 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"
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
rm_default=usr/share/doc:usr/share/gtk-doc:usr/share/info:usr/share/polkit-1
|
||||||
|
rm_default=$rm_default:usr/share/gettext:usr/share/locale
|
||||||
|
rm_default=$rm_default:etc/bash_completion.d:usr/share/zsh
|
||||||
|
|
||||||
|
# Split the environment variable on ':' and turn it into an argument
|
||||||
|
# list. This works exactly like '$KISS_PATH'.
|
||||||
|
#
|
||||||
|
# shellcheck disable=2046,2086
|
||||||
|
{ IFS=:; set -- ${KISS_RM-$rm_default}; 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() (
|
pkg_manifest() (
|
||||||
# Generate the package's manifest file. This is a list of each file
|
# Generate the package's manifest file. This is a list of each file
|
||||||
# and directory inside the package. The file is used when uninstalling
|
# and directory inside the package. The file is used when uninstalling
|
||||||
|
@ -467,6 +496,7 @@ pkg_build() {
|
||||||
|
|
||||||
pkg_strip "$pkg"
|
pkg_strip "$pkg"
|
||||||
pkg_fixdeps "$pkg"
|
pkg_fixdeps "$pkg"
|
||||||
|
pkg_junk "$pkg"
|
||||||
pkg_manifest "$pkg"
|
pkg_manifest "$pkg"
|
||||||
pkg_tar "$pkg"
|
pkg_tar "$pkg"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user