mirror of
https://github.com/archlinux/aur.git
synced 2026-03-05 04:42:21 +01:00
Add robust error checking to PKGBUILD package() function
- Add error handling for cd command failure - Verify source directory contains expected files before copying - Add debugging output to identify cp errors - This should fix the permission denied errors during AUR builds
This commit is contained in:
parent
c0bfdd3560
commit
6e6e7e6329
1 changed files with 13 additions and 1 deletions
14
PKGBUILD
14
PKGBUILD
|
|
@ -40,7 +40,19 @@ sha256sums=(
|
|||
)
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
# Ensure we're in the correct source directory
|
||||
cd "${srcdir}/${pkgname}-${pkgver}" || {
|
||||
echo "ERROR: Failed to change to source directory: ${srcdir}/${pkgname}-${pkgver}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify we're in the right place
|
||||
if [ ! -f "PKGBUILD" ] || [ ! -d "lib" ]; then
|
||||
echo "ERROR: Source directory doesn't contain expected files"
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Contents: $(ls -la)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create installation directory
|
||||
install -dm755 "${pkgdir}/opt/${pkgname}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue