mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
do-extract: change cwd to $extractdir to check number of files
In order to simplify the next change, to simplify the processing steps for PHP and/or Macintosh metadata.
This commit is contained in:
parent
2ca6cb7a67
commit
c57c2b8a90
1 changed files with 5 additions and 2 deletions
|
@ -163,13 +163,14 @@ hook() {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
cd "$extractdir"
|
||||||
# find "$extractdir" -mindepth 1 -maxdepth 1 -printf '1\n' | wc -l
|
# find "$extractdir" -mindepth 1 -maxdepth 1 -printf '1\n' | wc -l
|
||||||
# However, it requires GNU's find
|
# However, it requires GNU's find
|
||||||
num_dirs=0
|
num_dirs=0
|
||||||
for f in "$extractdir"/* "$extractdir"/.*; do
|
for f in * .*; do
|
||||||
if [ -e "$f" ] || [ -L "$f" ]; then
|
if [ -e "$f" ] || [ -L "$f" ]; then
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*/. | */..) ;;
|
. | ..) ;;
|
||||||
*)
|
*)
|
||||||
innerdir="$f"
|
innerdir="$f"
|
||||||
num_dirs=$(( num_dirs + 1 ))
|
num_dirs=$(( num_dirs + 1 ))
|
||||||
|
@ -178,6 +179,8 @@ hook() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
rm -rf "$wrksrc"
|
rm -rf "$wrksrc"
|
||||||
|
innerdir="$extractdir/$innerdir"
|
||||||
|
cd "$XBPS_BUILDDIR"
|
||||||
if [ "$num_dirs" = 1 ] && [ -d "$innerdir" ] && [ -z "$create_wrksrc" ]; then
|
if [ "$num_dirs" = 1 ] && [ -d "$innerdir" ] && [ -z "$create_wrksrc" ]; then
|
||||||
# rename the subdirectory (top-level of distfiles) to $wrksrc
|
# rename the subdirectory (top-level of distfiles) to $wrksrc
|
||||||
mv "$innerdir" "$wrksrc" &&
|
mv "$innerdir" "$wrksrc" &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue