summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Eberlein2021-07-29 15:13:18 +0200
committerMatthias Eberlein2021-07-29 15:13:18 +0200
commit16688a8a5f72f2a17368176ce89ccbcc43fde9fe (patch)
treee539c1a7d22869a494f4364327d311f4a2ab579d
parente3c78111d121be4fc602506805c46c1e2df44584 (diff)
downloadaur-16688a8a5f72f2a17368176ce89ccbcc43fde9fe.tar.gz
Added check to PKGBUILD to remove an existing directory with the new package version as name
-rw-r--r--PKGBUILD7
1 files changed, 6 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index c8f647b8dea1..8cc72faa71fb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -56,7 +56,10 @@ pkgver() {
if [[ ! "$actpkgverlong" == *"$pkgver" ]]; then
cd ..
mv "$pkgname-$pkgver.deb" "$pkgname-$actpkgver.deb"
- mv "$pkgname-$pkgver" "$pkgname-$actpkgver"
+ if [ -d "$pkgname-$actpkgver" ]; then
+ rm -R "$pkgname-$actpkgver"
+ fi
+ mv -T "$pkgname-$pkgver" "$pkgname-$actpkgver"
cd ..
mv "$pkgname-$pkgver.deb" "$pkgname-$actpkgver.deb"
@@ -67,6 +70,7 @@ pkgver() {
package() {
## We still start in the src dir
cd "$pkgname-$pkgver"
+ echo "pgkver: $pkgver"
# Copy the binaries and application to their destination in /pkg as root folder
cp -r -i "usr" "$pkgdir/"
@@ -79,5 +83,6 @@ package() {
rm "$pkgname-$pkgver.deb"
# install the license
+ echo "PKGDIR: $pkgdir"
sudo install -Dm644 "$pkgdir/LICENSE" "/usr/share/licenses/$pkgname/LICENSE"
}