hooks/do-extract: fix for extract distfiles to single file

We missed the case that distfiles was extracted to a single file.
Instead of changing the second leg, we can simply remove the third leg
because renaming the empty $extractdir to $wrksrc is the same of create
new empty $wrksrc
This commit is contained in:
Đoàn Trần Công Danh 2023-02-27 11:41:57 +07:00
parent 092023e548
commit e64f6c2c46
1 changed files with 1 additions and 4 deletions

View File

@ -205,11 +205,8 @@ hook() {
# rename the subdirectory (top-level of distfiles) to $wrksrc
mv "$innerdir" "$wrksrc" &&
rmdir "$extractdir"
elif [ "$num_dirs" -gt 1 ] || [ -n "$create_wrksrc" ]; then
# rename the tmpdir to wrksrc
mv "$extractdir" "$wrksrc"
else
mkdir -p "$wrksrc"
mv "$extractdir" "$wrksrc"
fi ||
msg_error "$pkgver: failed to move sources to $wrksrc\n"
}