|
|
@ -24,7 +24,7 @@ pkgbuild="$(echo "$pkgbase" | sed -e 's?.*-[^-]*-[^-]*-\([^-]*\)$?\1?')" |
|
|
|
case "$pkgarch" in |
|
|
|
i?86) pkgarch=x86_64 ;; |
|
|
|
*) |
|
|
|
echo "Unknown package architecture '$pkgarch'. Can't proceed." 1>&2 |
|
|
|
echo "Unsupported package architecture '$pkgarch'. Can't proceed." 1>&2 |
|
|
|
exit 1 |
|
|
|
;; |
|
|
|
esac |
|
|
@ -49,8 +49,9 @@ explodepkg "$pkg32" |
|
|
|
if [ "$pkg64" ]; then |
|
|
|
echo |
|
|
|
echo "Removing files:" |
|
|
|
$tool -cd "$pkg64" | tar-1.13 t | grep -v "^install/" | while read -r file; do |
|
|
|
rm -vf "./$file" 2> /dev/null || true |
|
|
|
$tool -cd "$pkg64" | tar-1.13 t | grep -v '^install/' | while read -r file; do |
|
|
|
echo "./$file" |
|
|
|
rm -f "./$file" 2> /dev/null || true |
|
|
|
done |
|
|
|
else |
|
|
|
if [ ! -f "$pkginfo" ]; then |
|
|
@ -59,23 +60,24 @@ else |
|
|
|
fi |
|
|
|
|
|
|
|
# See /sbin/removepkg |
|
|
|
if fgrep "./" "$pkginfo" 1> /dev/null 2>&1; then |
|
|
|
TRIGGER="^\.\/" |
|
|
|
if fgrep './' "$pkginfo" 1> /dev/null 2>&1; then |
|
|
|
TRIGGER='^\.\/' |
|
|
|
else |
|
|
|
TRIGGER="FILE LIST:" |
|
|
|
TRIGGER='FILE LIST:' |
|
|
|
fi |
|
|
|
|
|
|
|
echo |
|
|
|
echo "Removing files:" |
|
|
|
sed -n "/$TRIGGER/,/^$/p" "$pkginfo" | fgrep -v "FILE LIST:" | grep -v "^install/" | while read -r file; do |
|
|
|
rm -vf "./$file" 2> /dev/null || true |
|
|
|
echo 'Removing files:' |
|
|
|
sed -n "/$TRIGGER/,/^$/p" "$pkginfo" | fgrep -v 'FILE LIST:' | grep -v '^install/' | while read -r file; do |
|
|
|
echo "./$file" |
|
|
|
rm -f "./$file" 2> /dev/null || true |
|
|
|
done |
|
|
|
fi |
|
|
|
|
|
|
|
# Clean empty directories |
|
|
|
echo |
|
|
|
echo "Empty directories:" |
|
|
|
find . -mindepth 1 -type d -empty -print -delete |
|
|
|
echo 'Empty directories:' |
|
|
|
find . -type d -empty -print -delete |
|
|
|
|
|
|
|
# Remove all symlinks present in the 64bit package |
|
|
|
if [ -f install/doinst.sh ]; then |
|
|
@ -107,16 +109,24 @@ if [ -f install/doinst.sh ]; then |
|
|
|
fi |
|
|
|
|
|
|
|
# Extract all lines treating with symlinks. See /sbin/removepkg |
|
|
|
sed -n -e 's,^[ ]*( [ ]*cd[ ]* .* [ ]*; [ ]*\(rm\|ln\) [ ]*-\(rf\|sf\)[ ]* .* [ ]*)[ ]*$,&,p' -e 's,^[ ]*config .*[ ]*,&,p' install/doinst.64 > install/doinst |
|
|
|
sed -n -e 's,^[ ]*( [ ]*cd[ ]* .* [ ]*; [ ]*\(rm\|ln\) [ ]*-\(rf\|sf\)[ ]* .* [ ]*)[ ]*$,&,p' -e 's,^[ ]*config .*[ ]*$,&,p' install/doinst.64 > install/doinst |
|
|
|
rm install/doinst.64 |
|
|
|
|
|
|
|
echo |
|
|
|
echo "Removed lines in doinst.sh:" |
|
|
|
fgrep -xf install/doinst install/doinst.sh || true |
|
|
|
echo 'Removed lines in doinst.sh:' |
|
|
|
if [ -s install/doinst ]; then |
|
|
|
fgrep -xf install/doinst install/doinst.sh || true |
|
|
|
|
|
|
|
# Remove all symlinks present in the 64bit package |
|
|
|
fgrep -vxf install/doinst install/doinst.sh > install/doinst.sh.new || true |
|
|
|
mv install/doinst.sh.new install/doinst.sh |
|
|
|
|
|
|
|
# Remove all symlinks present in the 64bit package |
|
|
|
fgrep -vxf install/doinst install/doinst.sh > install/doinst.sh.new || true |
|
|
|
mv install/doinst.sh.new install/doinst.sh |
|
|
|
rm -f install/doinst install/doinst.64 |
|
|
|
# If the resulting doinst.sh is empty, remove it. |
|
|
|
if [ ! -s install/doinst.sh ]; then |
|
|
|
rm install/doinst.sh |
|
|
|
fi |
|
|
|
fi |
|
|
|
rm install/doinst |
|
|
|
fi |
|
|
|
|
|
|
|
# Rename package in slack-desc |
|
|
@ -126,7 +136,7 @@ fi |
|
|
|
|
|
|
|
if ! find . | grep -v '^.$\|^./install' > /dev/null; then |
|
|
|
echo |
|
|
|
echo "Package is empty. Not running makepkg." 1>&2 |
|
|
|
echo 'Package is empty. Not running makepkg.' 1>&2 |
|
|
|
exit 0 |
|
|
|
fi |
|
|
|
|
|
|
|