forked from kiss-community/kiss
kiss: Remove trailing white-space
This commit is contained in:
parent
3cbcab11f3
commit
1712618765
34
kiss
34
kiss
@ -108,13 +108,13 @@ readlink() {
|
|||||||
#
|
#
|
||||||
# The specification:
|
# The specification:
|
||||||
#
|
#
|
||||||
# > If the file is a symbolic link and the -L option is not
|
# > If the file is a symbolic link and the -L option is not
|
||||||
# specified, this information shall be about the link
|
# specified, this information shall be about the link
|
||||||
# itself and the <pathname> field shall be of the form:
|
# itself and the <pathname> field shall be of the form:
|
||||||
#
|
#
|
||||||
# > "%s -> %s", <pathname of link>, <contents of link>
|
# > "%s -> %s", <pathname of link>, <contents of link>
|
||||||
|
|
||||||
# Ignore '-f' if passed to the function to maintain
|
# Ignore '-f' if passed to the function to maintain
|
||||||
# compatibility with regular 'readlink'.
|
# compatibility with regular 'readlink'.
|
||||||
[ "$1" = -f ] && shift
|
[ "$1" = -f ] && shift
|
||||||
|
|
||||||
@ -127,10 +127,10 @@ readlink() {
|
|||||||
# resolved path to the symlink file as input.
|
# resolved path to the symlink file as input.
|
||||||
lso=$(ls -ld "$PWD/${1##*/}") target=
|
lso=$(ls -ld "$PWD/${1##*/}") target=
|
||||||
|
|
||||||
# Strip everything before the nearest '->' (arrow) and
|
# Strip everything before the nearest '->' (arrow) and
|
||||||
# construct the final path. If the file isn't a symlink, just
|
# construct the final path. If the file isn't a symlink, just
|
||||||
# print it as-is.
|
# print it as-is.
|
||||||
case $lso in *' -> '*)
|
case $lso in *' -> '*)
|
||||||
target=${lso##*" -> "} target=$PWD/${target##*/}
|
target=${lso##*" -> "} target=$PWD/${target##*/}
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ pkg_lint() {
|
|||||||
[ "$2" ] || [ -f checksums ] ||
|
[ "$2" ] || [ -f checksums ] ||
|
||||||
die "$1" "Checksums are missing"
|
die "$1" "Checksums are missing"
|
||||||
|
|
||||||
case $PWD in "$KISS_ROOT/var/db/kiss/installed"*)
|
case $PWD in "$KISS_ROOT/var/db/kiss/installed"*)
|
||||||
war "$1" "no longer exists in the repositories"
|
war "$1" "no longer exists in the repositories"
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -896,12 +896,12 @@ pkg_install_files() {
|
|||||||
while read -r line; do
|
while read -r line; do
|
||||||
# Grab the octal permissions so that directory creation
|
# Grab the octal permissions so that directory creation
|
||||||
# preserves permissions.
|
# preserves permissions.
|
||||||
rwx=$(ls -ld "$2/$line") oct='' b='' o=0
|
rwx=$(ls -ld "$2/$line") oct='' b='' o=0
|
||||||
|
|
||||||
# Convert the output of 'ls' (rwxrwx---) to octal. This is simply
|
# Convert the output of 'ls' (rwxrwx---) to octal. This is simply
|
||||||
# a 1-9 loop with the second digit being the value of the field.
|
# a 1-9 loop with the second digit being the value of the field.
|
||||||
for c in 14 22 31 44 52 61 74 82 91; do rwx=${rwx#?}
|
for c in 14 22 31 44 52 61 74 82 91; do rwx=${rwx#?}
|
||||||
case $rwx in
|
case $rwx in
|
||||||
[rwx]*): $((o+=${c#?})) ;;
|
[rwx]*): $((o+=${c#?})) ;;
|
||||||
[st]*): $((o+=1)) $((b+=4 / (${c%?}/3))) ;;
|
[st]*): $((o+=1)) $((b+=4 / (${c%?}/3))) ;;
|
||||||
[ST]*): $((b+=1)) ;;
|
[ST]*): $((b+=1)) ;;
|
||||||
@ -916,7 +916,7 @@ pkg_install_files() {
|
|||||||
# The 'test' will run with '-e' for no-overwrite and '-z'
|
# The 'test' will run with '-e' for no-overwrite and '-z'
|
||||||
# for overwrite.
|
# for overwrite.
|
||||||
case $line in /etc/*) ;;
|
case $line in /etc/*) ;;
|
||||||
*/)
|
*/)
|
||||||
# Skip directories if they already exist in the file system.
|
# Skip directories if they already exist in the file system.
|
||||||
# (Think /usr/bin, /usr/lib, etc).
|
# (Think /usr/bin, /usr/lib, etc).
|
||||||
[ -d "$line" ] ||
|
[ -d "$line" ] ||
|
||||||
@ -927,7 +927,7 @@ pkg_install_files() {
|
|||||||
|
|
||||||
# Treat symlinks differently as the 'install' command
|
# Treat symlinks differently as the 'install' command
|
||||||
# will resolve them (we don't want this).
|
# will resolve them (we don't want this).
|
||||||
if [ -h "$2/$line" ]; then
|
if [ -h "$2/$line" ]; then
|
||||||
# Skip symlinks which already exist as directories.
|
# Skip symlinks which already exist as directories.
|
||||||
# (Think baselayout being updated)
|
# (Think baselayout being updated)
|
||||||
[ -d "$KISS_ROOT/$line" ] && continue
|
[ -d "$KISS_ROOT/$line" ] && continue
|
||||||
@ -1093,7 +1093,7 @@ pkg_install() {
|
|||||||
(
|
(
|
||||||
cd "$tar_dir/$pkg_name"
|
cd "$tar_dir/$pkg_name"
|
||||||
|
|
||||||
decompress "$tar_file" | "$tar" pxf -
|
decompress "$tar_file" | "$tar" pxf -
|
||||||
)
|
)
|
||||||
|
|
||||||
# Naively assume that the existence of a manifest file is all
|
# Naively assume that the existence of a manifest file is all
|
||||||
@ -1106,9 +1106,9 @@ pkg_install() {
|
|||||||
# each file and directory inside of it actually exists.
|
# each file and directory inside of it actually exists.
|
||||||
[ "$KISS_FORCE" = 1 ] || {
|
[ "$KISS_FORCE" = 1 ] || {
|
||||||
log "$pkg_name" "Checking that manifest is valid"
|
log "$pkg_name" "Checking that manifest is valid"
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
[ -h "$tar_dir/$pkg_name/$line" ] ||
|
[ -h "$tar_dir/$pkg_name/$line" ] ||
|
||||||
[ -e "$tar_dir/$pkg_name/$line" ] ||
|
[ -e "$tar_dir/$pkg_name/$line" ] ||
|
||||||
die "File $line missing from tarball but mentioned in manifest"
|
die "File $line missing from tarball but mentioned in manifest"
|
||||||
done < "$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest"
|
done < "$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user