Skip to content

Commit

Permalink
ci: safer repack
Browse files Browse the repository at this point in the history
  • Loading branch information
duzda committed Dec 2, 2024
1 parent b50c6d4 commit 502051c
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions pacman-repack.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
#!/usr/bin/bash

# This script fixes permissions for .pacman, this should be
# done elsewhere, either in electron builder or forge maker,
# done elsewhere, either in electron builder or forge maker,
# although this script is ugly, it's a fast fix.

if [ $# -ne 1 ];
then echo "Please supply Deezer version"
set -o errexit
set -o nounset

if [[ $# -ne 1 ]]; then
echo "Please supply Deezer version"
exit 1
fi

VERSION=$1

cd "./out/make"

mkdir "deezer-enhanced-${VERSION}"

# Unpack tar.xf to folder
tar -xf "deezer-enhanced-${VERSION}.pacman" --directory "deezer-enhanced-${VERSION}"
(
cd "./out/make" || exit 1
mkdir "deezer-enhanced-${VERSION}"

# Remove old package
rm "deezer-enhanced-${VERSION}.pacman"
# Unpack tar.xf to folder
tar --extract --file "deezer-enhanced-${VERSION}.pacman" --directory "deezer-enhanced-${VERSION}"

# Apply fix
chmod 755 "deezer-enhanced-${VERSION}/opt/deezer-enhanced"
# Remove old package
rm "deezer-enhanced-${VERSION}.pacman"

# Package as a new package
cd "deezer-enhanced-${VERSION}"
tar -Jcvf "../deezer-enhanced-${VERSION}.pacman" "usr" "opt" ".PKGINFO" ".MTREE" ".INSTALL"
cd ".."
# Apply fix
chmod 755 "deezer-enhanced-${VERSION}/opt/deezer-enhanced"

cd "../.."
# Package as a new package
(
cd "deezer-enhanced-${VERSION}" || exit 1
tar --xz --create --file "../deezer-enhanced-${VERSION}.pacman" "usr" "opt" ".PKGINFO" ".MTREE" ".INSTALL"
)
)

0 comments on commit 502051c

Please sign in to comment.