From 7a3759f54b75c0e362f5c975e703548846776878 Mon Sep 17 00:00:00 2001 From: goodroot Date: Sat, 6 Sep 2025 15:36:04 -0700 Subject: [PATCH] Fix cp command with explicit file list - Remove unreliable cd command that was failing silently - Use explicit file list instead of wildcards to copy only needed files - Prevents copying from wrong directory (root /) which caused sys/devices errors - More robust and follows PKGBUILD best practices --- PKGBUILD | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 2702b2425d3b..80eca89ddde7 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -40,25 +40,20 @@ sha256sums=( ) package() { - # 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}" - # Copy all source files to /opt/hyprwhspr - cp -r . "${pkgdir}/opt/${pkgname}/" + # Copy all source files to /opt/hyprwhspr from the correct source directory + # Use explicit file list to avoid copying hidden files and ensure we only copy what we need + cp -r "${srcdir}/${pkgname}-${pkgver}/bin" \ + "${srcdir}/${pkgname}-${pkgver}/config" \ + "${srcdir}/${pkgname}-${pkgver}/lib" \ + "${srcdir}/${pkgname}-${pkgver}/scripts" \ + "${srcdir}/${pkgname}-${pkgver}/share" \ + "${srcdir}/${pkgname}-${pkgver}/requirements.txt" \ + "${srcdir}/${pkgname}-${pkgver}/README.md" \ + "${srcdir}/${pkgname}-${pkgver}/LICENSE" \ + "${pkgdir}/opt/${pkgname}/" # Make scripts executable chmod +x "${pkgdir}/opt/${pkgname}/scripts/"*.sh