mirror of
https://github.com/Snigdha-OS/snigdhaos-pkgbuilds.git
synced 2025-09-20 19:45:00 +02:00
⚡️ perf: more improved script
This commit is contained in:
@@ -2,10 +2,22 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Define source files and the output package name
|
||||||
sourcefiles="Brave-Browser"
|
sourcefiles="Brave-Browser"
|
||||||
|
|
||||||
pkgname=$(grep "^pkgname=" PKGBUILD | awk -F"=" '{print $2}')
|
# Extract pkgname, pkgrel, and arch from the PKGBUILD
|
||||||
pkgrel=$(grep "^pkgrel=" PKGBUILD | awk -F"=" '{split($2,a," ");gsub(/"/, "", a[1]);print a[1]}')
|
pkgname=$(grep "^pkgname=" PKGBUILD | awk -F"=" '{print $2}' | xargs)
|
||||||
arch=$(grep "^arch=" PKGBUILD | awk -F"'" '{print $2}')
|
pkgrel=$(grep "^pkgrel=" PKGBUILD | awk -F"=" '{split($2,a," ");gsub(/"/, "", a[1]);print a[1]}' | xargs)
|
||||||
|
arch=$(grep "^arch=" PKGBUILD | awk -F"'" '{print $2}' | xargs)
|
||||||
|
|
||||||
tar -zcvf $pkgname.tar.gz $sourcefiles
|
# Check if the necessary source files exist before proceeding
|
||||||
|
if [ ! -d "$sourcefiles" ]; then
|
||||||
|
echo "Error: The source directory '$sourcefiles' does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create the tarball
|
||||||
|
echo "Creating tarball $pkgname-$pkgrel-$arch.tar.gz..."
|
||||||
|
tar -zcvf "$pkgname-$pkgrel-$arch.tar.gz" "$sourcefiles"
|
||||||
|
|
||||||
|
echo "Tarball $pkgname-$pkgrel-$arch.tar.gz created successfully."
|
||||||
|
Reference in New Issue
Block a user