forked from kiss-community/kiss
kiss: simplify pkg_etcsums
- Removes subshell usage. - Removes cd usage.
This commit is contained in:
parent
95e3fc8f8e
commit
d107c43098
12
kiss
12
kiss
@ -580,23 +580,19 @@ pkg_manifest() (
|
|||||||
sort -r | sed '/^\.\/$/d;ss.ss' > "$PWD/$pkg_db/$1/manifest"
|
sort -r | sed '/^\.\/$/d;ss.ss' > "$PWD/$pkg_db/$1/manifest"
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg_etcsums() (
|
pkg_etcsums() {
|
||||||
# Generate checksums for each configuration file in the package's /etc/
|
# Generate checksums for each configuration file in the package's /etc/
|
||||||
# directory for use in "smart" handling of these files.
|
# directory for use in "smart" handling of these files.
|
||||||
log "$1" "Generating etcsums"
|
log "$1" "Generating etcsums"
|
||||||
|
|
||||||
# This function runs as a sub-shell to avoid having to 'cd' back to the
|
! [ -d "$pkg_dir/$1/etc" ] ||
|
||||||
# prior directory before being able to continue.
|
|
||||||
[ -d "$pkg_dir/$1/etc" ] || return 0
|
|
||||||
|
|
||||||
cd "$pkg_dir/$1"
|
|
||||||
|
|
||||||
# This can't be a simple 'find -exec' as 'sh256' is a shell function
|
# This can't be a simple 'find -exec' as 'sh256' is a shell function
|
||||||
# and not a real command of any kind. This is the shell equivalent.
|
# and not a real command of any kind. This is the shell equivalent.
|
||||||
find etc ! -type d | sort | while read -r line; do
|
find "$pkg_dir/$1/etc" ! -type d | sort | while read -r line; do
|
||||||
sh256 "$line"
|
sh256 "$line"
|
||||||
done > "$pkg_dir/$1/$pkg_db/$1/etcsums"
|
done > "$pkg_dir/$1/$pkg_db/$1/etcsums"
|
||||||
)
|
}
|
||||||
|
|
||||||
pkg_tar() (
|
pkg_tar() (
|
||||||
# Create a tarball from the built package's files. This tarball also
|
# Create a tarball from the built package's files. This tarball also
|
||||||
|
Loading…
Reference in New Issue
Block a user