pkgmeek: clean up the tmp files of a check_manifest() operation
This commit is contained in:
parent
f11ecff34b
commit
1c40c4f6fb
@ -46,7 +46,7 @@ validate_pkgfile || exit $E_PKGFILE
|
|||||||
package="${name}#${version}-${release}.pkg.tar.${PKGMK_COMPRESSION_MODE}"
|
package="${name}#${version}-${release}.pkg.tar.${PKGMK_COMPRESSION_MODE}"
|
||||||
declare -a _local_
|
declare -a _local_
|
||||||
for (( s=0; s<${#source[@]}; s++ )); do
|
for (( s=0; s<${#source[@]}; s++ )); do
|
||||||
if [[ ${source[$s]} =~ ^(http|https|ssh|git)://.*/(.+)\.git ]]; then
|
if [[ ${source[$s]} =~ ^(http|https|ssh|git)://.*/(.+)\.git$ ]]; then
|
||||||
_local_[$s]="${BASH_REMATCH[2]}"
|
_local_[$s]="${BASH_REMATCH[2]}"
|
||||||
elif [[ ${source[$s]} =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
|
elif [[ ${source[$s]} =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
|
||||||
_local_[$s]="${BASH_REMATCH[2]}"
|
_local_[$s]="${BASH_REMATCH[2]}"
|
||||||
@ -76,11 +76,11 @@ here="${_local_[$u]}"; url="${source[$u]}";
|
|||||||
# appropriate name in the current directory
|
# appropriate name in the current directory
|
||||||
[ -e "$here" ] || [ "$src_dir" = "" ] || [ ! -e "$src_dir/$here" ] || ln -sf "$src_dir/$here" ;
|
[ -e "$here" ] || [ "$src_dir" = "" ] || [ ! -e "$src_dir/$here" ] || ln -sf "$src_dir/$here" ;
|
||||||
[ -e "$here" ] || [ ! -e "$PKGMK_ROOT/$here" ] || ln -sf "$PKGMK_ROOT/$here" . ;
|
[ -e "$here" ] || [ ! -e "$PKGMK_ROOT/$here" ] || ln -sf "$PKGMK_ROOT/$here" . ;
|
||||||
[ -e "$here" ] || [[ $url =~ ^(https|ssh|git)://.*/(.+)\.git ]] || {
|
[ -e "$here" ] || [[ $url =~ ^(https|ssh|git)://.*/(.+)\.git$ ]] || {
|
||||||
if "$PKGMK_DOWNLOAD_PROG" -O "$here" "$url"; then
|
if "$PKGMK_DOWNLOAD_PROG" -O "$here" "$url"; then
|
||||||
[ "$src_dir" = "" ] || { mv "$here" "$src_dir"/ && ln -sf "$src_dir/$here" . ; };
|
[ "$src_dir" = "" ] || { mv "$here" "$src_dir"/ && ln -sf "$src_dir/$here" . ; };
|
||||||
fi; };
|
fi; };
|
||||||
[ -e "$here" ] || [[ ! $url =~ ^(https|ssh|git)://.*/(.+)\.git ]] || \
|
[ -e "$here" ] || [[ ! $url =~ ^(https|ssh|git)://.*/(.+)\.git$ ]] || \
|
||||||
( "$PKGMK_GIT_COMMAND" clone "$url" "$here" ) ;
|
( "$PKGMK_GIT_COMMAND" clone "$url" "$here" ) ;
|
||||||
# but if not, exit with an informative error message
|
# but if not, exit with an informative error message
|
||||||
[ -e "$here" ] || { error "failed to download $here. Check connection and try again.";
|
[ -e "$here" ] || { error "failed to download $here. Check connection and try again.";
|
||||||
@ -182,8 +182,8 @@ if [ "$pkg_utd" = 0 ] || [ "$PKGMK_FORCE" = "yes" ]; then
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
find pkg -type f -path '*/man/man*/*' | grep -v '.gz$' | xargs -r -I{} gzip -9 '{}'
|
find pkg -type f | grep "/man/man*/" | grep -v '.gz$' | xargs -r -I{} gzip -9 '{}'
|
||||||
find pkg -xtype l -path '*/man/man*/*' -print0 \
|
find pkg -xtype l | grep "/man/man*/" \
|
||||||
| xargs -x -r -n1 sh -c "ln -sf \"\$(readlink -n '{}')\" '{}'"
|
| xargs -x -r -n1 sh -c "ln -sf \"\$(readlink -n '{}')\" '{}'"
|
||||||
|
|
||||||
[ $UID = 0 ] || fake_uid="--uid 0 --gid 0"
|
[ $UID = 0 ] || fake_uid="--uid 0 --gid 0"
|
||||||
@ -428,6 +428,7 @@ check_manifest() {
|
|||||||
else
|
else
|
||||||
warning ".$1 not found, creating new."; mv "$FILE" "$TRUTH"
|
warning ".$1 not found, creating new."; mv "$FILE" "$TRUTH"
|
||||||
fi
|
fi
|
||||||
|
rm -f "$FILE" "${FILE%tmp}orig" "${FILE%tmp}diff"
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user