Add files via upload

This commit is contained in:
helixarch 2020-04-25 21:54:51 +03:00 committed by GitHub
parent 93382a0e8a
commit 78d28f5abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

138
debtap
View File

@ -1,6 +1,6 @@
#!/usr/bin/bash #!/usr/bin/bash
# Copyright 2014-2018 George Savvidis # Copyright 2014-2020 George Savvidis
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
Version=3.2.2 Version=3.3
# Defining colors and bold letters # Defining colors and bold letters
lightgreen='\e[1;32m' lightgreen='\e[1;32m'
@ -28,31 +28,31 @@ normal=`tput sgr0`
# Options, help, database update and error messages # Options, help, database update and error messages
for i in "$@"; do for i in "$@"; do
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)h([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?help$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)h([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--help$ ]]; then
help=set help=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)u([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?update$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)u([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--update$ ]]; then
update=set update=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)q([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?quiet$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)q([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--quiet$ ]]; then
quiet=set quiet=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)Q([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?Quiet$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)Q([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--Quiet$ ]]; then
Quiet=set Quiet=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)s([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?pseudo$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)s([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--pseudo$ ]]; then
pseudo=set pseudo=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)w([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?wipeout$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)w([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--wipeout$ ]]; then
wipeout=set wipeout=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)p([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?pkgbuild$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)p([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--pkgbuild$ ]]; then
pkgbuild=set pkgbuild=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)P([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?Pkgbuild$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)P([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--Pkgbuild$ ]]; then
Pkgbuild=set Pkgbuild=set
fi fi
if [[ "$i" =~ ^-(-)?([huqQswpPv]*)v([huqQswpPv]*)$ ]] || [[ "$i" =~ ^-(-)?version$ ]]; then if [[ "$i" =~ ^-([huqQswpPv]*)v([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--version$ ]]; then
version=set version=set
fi fi
done done
@ -60,7 +60,7 @@ if [[ $pseudo == set ]] && [[ ! -e /var/lib/pacman/sync/multilib.db ]] && [[ ! -
echo -e "${red}Error: You are either running non-x86_64 Arch Linux, or you haven't enabled multilib repository. If you are running x86_64 Arch Linux, you must enable a multilib repository and then synchronize pacman database${NC}"; exit 1 echo -e "${red}Error: You are either running non-x86_64 Arch Linux, or you haven't enabled multilib repository. If you are running x86_64 Arch Linux, you must enable a multilib repository and then synchronize pacman database${NC}"; exit 1
fi fi
if [[ $help == set ]]; then if [[ $help == set ]]; then
echo -e "Syntax: debtap [options] package_filename\n\nOptions:\n\n -h --h -help --help Print this help message\n -u --u -update --update Update debtap database\n -q --q -quiet --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Q -Quiet --Quiet Bypass all questions (not recommended)\n -s --s -pseudo --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --w -wipeout --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --p -pkgbuild --pkgbuild Additionally generate a PKGBUILD file\n -P --P -Pkgbuild --Pkgbuild Generate a PKGBUILD file only\n -v --v -version --version Print version"; exit 0 echo -e "Syntax: debtap [options] package_filename\n\nOptions:\n\n -h --help Print this help message\n -u --update Update debtap database\n -q --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Quiet Bypass all questions (not recommended)\n -s --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --pkgbuild Additionally generate a PKGBUILD file\n -P --Pkgbuild Generate a PKGBUILD file only\n -v --version Print version"; exit 0
elif [[ $version == set ]]; then elif [[ $version == set ]]; then
echo -e "$Version"; exit 0 echo -e "$Version"; exit 0
elif [[ $update == set ]]; then elif [[ $update == set ]]; then
@ -122,7 +122,7 @@ elif [[ $update == set ]]; then
fi fi
fi fi
elif [[ "${@: -1}" == "debtap" ]] || [[ "${@: -1}" =~ /debtap$ ]] || [[ "${@: -1}" =~ ^-(-)?([qQswpP]+)$ ]] || [[ "${@: -1}" =~ ^-(-)?([quiet|Quiet|pseudo|wipeout|pkgbuild|Pkgbuild]){1,}$ ]]; then elif [[ "${@: -1}" == "debtap" ]] || [[ "${@: -1}" =~ /debtap$ ]] || [[ "${@: -1}" =~ ^-(-)?([qQswpP]+)$ ]] || [[ "${@: -1}" =~ ^-(-)?([quiet|Quiet|pseudo|wipeout|pkgbuild|Pkgbuild]){1,}$ ]]; then
echo -e "${red}Error: You haven't specified a deb package${NC}\nSyntax: debtap [options] package_filename\n\nOptions:\n\n -h --h -help --help Print this help message\n -u --u -update --update Update debtap database\n -q --q -quiet --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Q -Quiet --Quiet Bypass all questions (not recommended)\n -s --s -pseudo --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --w -wipeout --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --p -pkgbuild --pkgbuild Additionally generate a PKGBUILD file\n -P --P -Pkgbuild --Pkgbuild Generate a PKGBUILD file only\n -v --v -version --version Print version"; exit 1 echo -e "${red}Error: You haven't specified a deb package${NC}\nSyntax: debtap [options] package_filename\n\nOptions:\n\n -h --help Print this help message\n -u --update Update debtap database\n -q --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Quiet Bypass all questions (not recommended)\n -s --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --pkgbuild Additionally generate a PKGBUILD file\n -P --Pkgbuild Generate a PKGBUILD file only\n -v --version Print version"; exit 1
elif [[ "${@: -1}" =~ ^(-)+(.)*$ ]] || [[ $(ls "${@: -1}" &> /dev/null; echo $?) != 0 ]]; then elif [[ "${@: -1}" =~ ^(-)+(.)*$ ]] || [[ $(ls "${@: -1}" &> /dev/null; echo $?) != 0 ]]; then
echo -e "${red}Error: No such file or directory or invalid option${NC}"; exit 1 echo -e "${red}Error: No such file or directory or invalid option${NC}"; exit 1
elif [[ $(file -b "${@: -1}" | grep -q "Debian binary package"; echo $?) != 0 ]]; then elif [[ $(file -b "${@: -1}" | grep -q "Debian binary package"; echo $?) != 0 ]]; then
@ -199,95 +199,70 @@ if [[ $pkgbuild == set ]] || [[ $Pkgbuild == set ]]; then
if [[ -e usr/games ]]; then if [[ -e usr/games ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/games/* usr/bin; rm -rf usr/games' >> pkgbuildinstallations1 echo 'mkdir usr/bin 2> /dev/null; mv usr/games/* usr/bin; rm -rf usr/games' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\\/usr\\/games\\//Exec=\\/usr\\/bin\\//g' \"$line\"\ndone" >> pkgbuildinstallations1
echo "sed -i s'/^Exec=\\/usr\\/games\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
fi fi
fi fi
if [[ -e bin ]]; then if [[ -e bin ]]; then
echo 'mkdir -p usr/bin 2> /dev/null; mv bin/* usr/bin; rm -rf bin' >> pkgbuildinstallations1 echo 'mkdir -p usr/bin 2> /dev/null; mv bin/* usr/bin; rm -rf bin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\\/bin\\//Exec=\\/usr\\/bin\\//g' \"$line\"\ndone" >> pkgbuildinstallations1
echo "sed -i s'/^Exec=\\/bin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
fi fi
fi fi
if [[ -e sbin ]]; then if [[ -e sbin ]]; then
echo 'mkdir -p usr/bin 2> /dev/null; mv sbin/* usr/bin; rm -rf sbin' >> pkgbuildinstallations1 echo 'mkdir -p usr/bin 2> /dev/null; mv sbin/* usr/bin; rm -rf sbin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$line\"\ndone" >> pkgbuildinstallations1
echo "sed -i s'/^Exec=\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
fi fi
fi fi
if [[ -e usr/sbin ]]; then if [[ -e usr/sbin ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/sbin/* usr/bin; rm -rf usr/sbin' >> pkgbuildinstallations1 echo 'mkdir usr/bin 2> /dev/null; mv usr/sbin/* usr/bin; rm -rf usr/sbin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\\/usr\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$line\"\ndone" >> pkgbuildinstallations1
echo "sed -i s'/^Exec=\\/usr\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
fi fi
fi fi
if [[ -e usr/local/games ]]; then if [[ -e usr/local/games ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/local/games/* usr/bin; rm -rf usr/local/games' >> pkgbuildinstallations1 echo 'mkdir usr/bin 2> /dev/null; mv usr/local/games/* usr/bin; rm -rf usr/local/games' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\\/usr\\/local\\/games\\//Exec=\\/usr\\/bin\\//g' \"$line\"\ndone" >> pkgbuildinstallations1
echo "sed -i s'/^Exec=\\/usr\\/local\\/games\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
fi fi
fi fi
if [[ -e usr/local/bin ]]; then if [[ -e usr/local/bin ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/local/bin/* usr/bin; rm -rf usr/local/bin' >> pkgbuildinstallations1 echo 'mkdir usr/bin 2> /dev/null; mv usr/local/bin/* usr/bin; rm -rf usr/local/bin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\\/usr\\/local\\/bin\\//Exec=\\/usr\\/bin\\//g' \"$line\"\ndone" >> pkgbuildinstallations1
echo "sed -i s'/^Exec=\\/usr\\/local\\/bin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
fi fi
fi fi
if [[ -e usr/local/sbin ]]; then if [[ -e usr/local/sbin ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/local/sbin/* usr/bin; rm -rf usr/local/sbin' >> pkgbuildinstallations1 echo 'mkdir usr/bin 2> /dev/null; mv usr/local/sbin/* usr/bin; rm -rf usr/local/sbin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\\/usr\\/local\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$line\"\ndone" >> pkgbuildinstallations1
echo "sed -i s'/^Exec=\\/usr\\/local\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
fi fi
fi fi
if [[ -e lib32 ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib32/* usr/lib; rm -rf lib32' >> pkgbuildinstallations32
fi
if [[ -e usr/lib32 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/lib32/* usr/lib; rm -rf usr/lib32' >> pkgbuildinstallations32
fi
if [[ -e usr/local/lib ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib/* usr/lib; rm -rf usr/local/lib' >> pkgbuildinstallations32
fi
if [[ -e usr/local/lib32 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib32/* usr/lib; rm -rf usr/local/lib32' >> pkgbuildinstallations32
fi
if [[ $pseudo != set ]]; then if [[ $pseudo != set ]]; then
if [[ -e lib ]]; then if [[ -e lib ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib/* usr/lib; rm -rf lib' >> pkgbuildinstallations1 echo 'mkdir -p usr/lib 2> /dev/null; mv lib/* usr/lib; rm -rf lib' >> pkgbuildinstallations1
fi fi
if [[ -e lib32 ]]; then if [[ -e lib32 ]]; then
echo 'mkdir -p usr/lib32 2> /dev/null; mv lib32/* usr/lib32; rm -rf lib32' >> pkgbuildinstallations64 if [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib32/* usr/lib; rm -rf lib32' >> pkgbuildinstallations32
else
echo 'mkdir -p usr/lib32 2> /dev/null; mv lib32/* usr/lib32; rm -rf lib32' >> pkgbuildinstallations64
fi
fi fi
if [[ -e lib64 ]]; then if [[ -e lib64 ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib64/* usr/lib; rm -rf lib64' >> pkgbuildinstallations64 echo 'mkdir -p usr/lib 2> /dev/null; mv lib64/* usr/lib; rm -rf lib64' >> pkgbuildinstallations64
fi fi
if [[ -e usr/lib32 ]]; then if [[ -e usr/lib32 ]] && [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/lib32/* usr/lib32; rm -rf usr/lib32' >> pkgbuildinstallations64 echo 'mkdir usr/lib 2> /dev/null; mv usr/lib32/* usr/lib; rm -rf usr/lib32' >> pkgbuildinstallations32
fi fi
if [[ -e usr/lib64 ]]; then if [[ -e usr/lib64 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/lib64/* usr/lib; rm -rf usr/lib64' >> pkgbuildinstallations64 echo 'mkdir usr/lib 2> /dev/null; mv usr/lib64/* usr/lib; rm -rf usr/lib64' >> pkgbuildinstallations64
fi fi
if [[ -e usr/local/lib ]]; then if [[ -e usr/local/lib32 ]] && [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib/* usr/lib; rm -rf usr/local/lib' >> pkgbuildinstallations64 echo 'mkdir usr/local/lib 2> /dev/null; mv usr/local/lib32/* usr/local/lib; rm -rf usr/local/lib32' >> pkgbuildinstallations32
fi
if [[ -e usr/local/lib32 ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32' >> pkgbuildinstallations64
fi fi
if [[ -e usr/local/lib64 ]]; then if [[ -e usr/local/lib64 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib64/* usr/lib; rm -rf usr/local/lib64' >> pkgbuildinstallations64 echo 'mkdir usr/local/lib 2> /dev/null; mv usr/local/lib64/* usr/local/lib; rm -rf usr/local/lib64' >> pkgbuildinstallations64
fi fi
else else
if [[ -e lib ]]; then if [[ -e lib ]]; then
@ -301,10 +276,7 @@ if [[ $pkgbuild == set ]] || [[ $Pkgbuild == set ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/lib/* usr/lib32; rm -rf usr/lib' >> pkgbuildinstallations64 echo 'mkdir usr/lib32 2> /dev/null; mv usr/lib/* usr/lib32; rm -rf usr/lib' >> pkgbuildinstallations64
fi fi
if [[ -e usr/local/lib ]]; then if [[ -e usr/local/lib ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/local/lib/* usr/lib32; rm -rf usr/local/lib' >> pkgbuildinstallations64 echo 'mkdir usr/local/lib32 2> /dev/null; mv usr/local/lib/* usr/local/lib32; rm -rf usr/local/lib' >> pkgbuildinstallations64
fi
if [[ -e usr/local/lib32 ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32' >> pkgbuildinstallations64
fi fi
fi fi
fi fi
@ -331,8 +303,8 @@ if [[ -e usr/local/sbin ]]; then
mkdir usr/bin 2> /dev/null; mv usr/local/sbin/* usr/bin; rm -rf usr/local/sbin mkdir usr/bin 2> /dev/null; mv usr/local/sbin/* usr/bin; rm -rf usr/local/sbin
fi fi
if [[ -e usr/share/applications ]]; then if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do ls usr/share/applications/*.desktop | while read line; do
sed -i -e s'/^Exec=\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/games\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/games\//Exec=\/usr\/bin\//g' "$i" 2> /dev/null sed -i -e s'/^Exec=\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/games\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/games\//Exec=\/usr\/bin\//g' "$line" 2> /dev/null
done done
fi fi
if [[ $pseudo != set ]]; then if [[ $pseudo != set ]]; then
@ -355,18 +327,11 @@ if [[ $pseudo != set ]]; then
if [[ -e usr/lib64 ]]; then if [[ -e usr/lib64 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/lib64/* usr/lib; rm -rf usr/lib64 mkdir usr/lib 2> /dev/null; mv usr/lib64/* usr/lib; rm -rf usr/lib64
fi fi
if [[ -e usr/local/lib ]]; then if [[ -e usr/local/lib32 ]] && [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/local/lib/* usr/lib; rm -rf usr/local/lib mkdir usr/local/lib 2> /dev/null; mv usr/local/lib32/* usr/local/lib; rm -rf usr/local/lib32
fi
if [[ -e usr/local/lib32 ]]; then
if [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/local/lib32/* usr/lib; rm -rf usr/local/lib32
else
mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32
fi
fi fi
if [[ -e usr/local/lib64 ]]; then if [[ -e usr/local/lib64 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/local/lib64/* usr/lib; rm -rf usr/local/lib64 mkdir usr/local/lib 2> /dev/null; mv usr/local/lib64/* usr/local/lib; rm -rf usr/local/lib64
fi fi
else else
if [[ -e lib ]]; then if [[ -e lib ]]; then
@ -379,21 +344,18 @@ else
mkdir usr/lib32 2> /dev/null; mv usr/lib/* usr/lib32; rm -rf usr/lib mkdir usr/lib32 2> /dev/null; mv usr/lib/* usr/lib32; rm -rf usr/lib
fi fi
if [[ -e usr/local/lib ]]; then if [[ -e usr/local/lib ]]; then
mkdir usr/lib32 2> /dev/null; mv usr/local/lib/* usr/lib32; rm -rf usr/local/lib mkdir usr/local/lib32 2> /dev/null; mv usr/local/lib/* usr/local/lib32; rm -rf usr/local/lib
fi
if [[ -e usr/local/lib32 ]]; then
mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32
fi fi
fi fi
if [[ $pkgbuild == set ]] || [[ $Pkgbuild == set ]]; then if [[ $pkgbuild == set ]] || [[ $Pkgbuild == set ]]; then
if [[ -e usr/local ]] && [[ $(ls -A usr/local 2> /dev/null) ]]; then if [[ -e usr/local ]] && [[ ! $(ls -A usr/local 2> /dev/null) ]]; then
echo 'mv usr/local/* usr; rm -rf usr/local' >> pkgbuildinstallations2 echo 'rm -rf usr/local' >> pkgbuildinstallations2
fi fi
fi fi
if [[ -e usr/local ]]; then if [[ -e usr/local ]] && [[ ! $(ls -A usr/local 2> /dev/null) ]]; then
mv usr/local/* usr; rm -rf usr/local rm -rf usr/local
fi fi
# Generating .PKGINFO file # Generating .PKGINFO file
@ -3011,7 +2973,7 @@ if [[ -e preinst ]]; then
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*install.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' preinst sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*install.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' preinst
fi fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' preinst | while read -r line; do grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' preinst | while read -r line; do
echo -e "\t$line" >> tempfile1 printf '\t%s\n' "$line" >> tempfile1
done done
fi fi
echo "}" >> tempfile1 echo "}" >> tempfile1
@ -3034,7 +2996,7 @@ if [[ -e postinst ]]; then
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*configure.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' postinst sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*configure.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' postinst
fi fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternative\|--slave\|db_\|remove_source\|update_manager\|lintian' postinst | while read -r line; do grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternative\|--slave\|db_\|remove_source\|update_manager\|lintian' postinst | while read -r line; do
echo -e "\t$line" >> tempfile1 printf '\t%s\n' "$line" >> tempfile1
done done
fi fi
if [[ $(grep '^depend' .PKGINFO | grep -q 'qt\|gtk'; echo $?) == 0 ]]; then if [[ $(grep '^depend' .PKGINFO | grep -q 'qt\|gtk'; echo $?) == 0 ]]; then
@ -3045,13 +3007,13 @@ if [[ $(echo $(($(grep "[[:blank:]]" -o tempfile1 | wc -l) + 16))) != $(echo $((
cat tempfile1 >> tempfile2 cat tempfile1 >> tempfile2
fi fi
if [[ $(grep -q '^pre_install() {$' tempfile2; echo $?) == 0 ]]; then if [[ $(grep -q '^pre_install() {$' tempfile2 2> /dev/null; echo $?) == 0 ]]; then
echo -e "\npre_upgrade() {" >> tempfile2 echo -e "\npre_upgrade() {" >> tempfile2
echo -e "\tpre_install" >> tempfile2 echo -e "\tpre_install" >> tempfile2
echo "}" >> tempfile2 echo "}" >> tempfile2
fi fi
if [[ $(grep -q '^post_install() {$' tempfile2; echo $?) == 0 ]]; then if [[ $(grep -q '^post_install() {$' tempfile2 2> /dev/null; echo $?) == 0 ]]; then
echo -e "\npost_upgrade() {" >> tempfile2 echo -e "\npost_upgrade() {" >> tempfile2
echo -e "\tpost_install" >> tempfile2 echo -e "\tpost_install" >> tempfile2
echo "}" >> tempfile2 echo "}" >> tempfile2
@ -3067,7 +3029,7 @@ if [[ -e prerm ]]; then
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*remove.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' prerm sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*remove.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' prerm
fi fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' prerm | while read -r line; do grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' prerm | while read -r line; do
echo -e "\t$line" >> tempfile1 printf '\t%s\n' "$line" >> tempfile1
done done
fi fi
echo "}" >> tempfile1 echo "}" >> tempfile1
@ -3090,7 +3052,7 @@ if [[ -e postrm ]]; then
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1,/g' -e s'/.*remove.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*purge.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' postrm sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1,/g' -e s'/.*remove.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*purge.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' postrm
fi fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' postrm | while read -r line; do grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' postrm | while read -r line; do
echo -e "\t$line" >> tempfile1 printf '\t%s\n' "$line" >> tempfile1
done done
fi fi
if [[ $(grep '^depend' .PKGINFO | grep -q 'qt\|gtk'; echo $?) == 0 ]]; then if [[ $(grep '^depend' .PKGINFO | grep -q 'qt\|gtk'; echo $?) == 0 ]]; then
@ -3193,9 +3155,9 @@ if [[ $Pkgbuild != set ]]; then
echo -e "\n${lightgreen}==>${NC} ${bold}Creating final package...${normal}" echo -e "\n${lightgreen}==>${NC} ${bold}Creating final package...${normal}"
fakeroot << EOF fakeroot << EOF
tar --force-local -pcf `grep '^pkgname =' .PKGINFO | gawk '{print $3}'`-`grep '^pkgver =' .PKGINFO | gawk '{print $3}'`-`grep '^arch =' .PKGINFO | gawk '{print $3}'`.pkg.tar --exclude='pkgbuildinstallations*' * .PKGINFO .INSTALL .MTREE 2> /dev/null tar --force-local -pcf `grep '^pkgname =' .PKGINFO | gawk '{print $3}'`-`grep '^pkgver =' .PKGINFO | gawk '{print $3}'`-`grep '^arch =' .PKGINFO | gawk '{print $3}'`.pkg.tar --exclude='pkgbuildinstallations*' * .PKGINFO .INSTALL .MTREE 2> /dev/null
xz --threads=0 -z -9 *.tar zstd -q -T0 --ultra -20 *.tar
EOF EOF
mv *.xz "$(dirname "$package_with_full_path")" mv *.zst "$(dirname "$package_with_full_path")"
fi fi
# Announcement of successful creation of package # Announcement of successful creation of package
@ -3224,7 +3186,7 @@ else
fi fi
if [[ $(grep -q '^pkgname = lib32-' .PKGINFO; echo $?) != 0 ]] && [[ $(grep '^pkgname =' .PKGINFO | grep -q -- '-multilib$'; echo $?) != 0 ]] && [[ $(ls -A usr/bin) ]]; then if [[ $(grep -q '^pkgname = lib32-' .PKGINFO; echo $?) != 0 ]] && [[ $(grep '^pkgname =' .PKGINFO | grep -q -- '-multilib$'; echo $?) != 0 ]] && [[ $(ls -A usr/bin) ]]; then
echo "$(grep '^pkgname =' .PKGINFO | sed s'/ //g')-bin" >> PKGBUILD echo "$(grep '^pkgname =' .PKGINFO | sed s'/ //g')-bin" >> PKGBUILD
else # else
echo "$(grep '^pkgname =' .PKGINFO | sed s'/ //g')" >> PKGBUILD echo "$(grep '^pkgname =' .PKGINFO | sed s'/ //g')" >> PKGBUILD
fi fi
echo "$(grep '^pkgver =' .PKGINFO | sed -e s'/ //g' -e s'/-/ /g' | gawk '{print $1}')" >> PKGBUILD echo "$(grep '^pkgver =' .PKGINFO | sed -e s'/ //g' -e s'/-/ /g' | gawk '{print $1}')" >> PKGBUILD