Merge pull request #1388 from lolilolicon/patch-1

Quote $PREFIX properly for paths with spaces
This commit is contained in:
Damien Elmes 2021-09-27 18:39:25 +10:00 committed by GitHub
commit 339fd159aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 20 deletions

View File

@ -85,6 +85,7 @@ Hikaru Yoshiga <github.com/hikaru-y>
Thore Tyborski <github.com/ThoreBor>
Alexander Giorev <alex.giorev@gmail.com>
Ren Tatsumoto <tatsu@autistici.org>
lolilolicon <lolilolicon@gmail.com>
********************

View File

@ -11,20 +11,20 @@ if [ "$PREFIX" = "" ]; then
PREFIX=/usr/local
fi
rm -rf ${PREFIX}/share/anki ${PREFIX}/bin/anki
mkdir -p ${PREFIX}/share/anki
cp -av * ${PREFIX}/share/anki/
mkdir -p ${PREFIX}/bin
ln -sf ${PREFIX}/share/anki/bin/Anki ${PREFIX}/bin/anki
rm -rf "$PREFIX"/share/anki "$PREFIX"/bin/anki
mkdir -p "$PREFIX"/share/anki
cp -av * "$PREFIX"/share/anki/
mkdir -p "$PREFIX"/bin
ln -sf "$PREFIX"/share/anki/bin/Anki "$PREFIX"/bin/anki
# fix a previous packaging issue where we created this as a file
(test -f ${PREFIX}/share/applications && rm ${PREFIX}/share/applications)||true
mkdir -p ${PREFIX}/share/pixmaps
mkdir -p ${PREFIX}/share/applications
mkdir -p ${PREFIX}/share/man/man1
cd ${PREFIX}/share/anki && (\
mv anki.xpm anki.png ${PREFIX}/share/pixmaps/;\
mv anki.desktop ${PREFIX}/share/applications/;\
mv anki.1 ${PREFIX}/share/man/man1/)
(test -f "$PREFIX"/share/applications && rm "$PREFIX"/share/applications)||true
mkdir -p "$PREFIX"/share/pixmaps
mkdir -p "$PREFIX"/share/applications
mkdir -p "$PREFIX"/share/man/man1
cd "$PREFIX"/share/anki && (\
mv anki.xpm anki.png "$PREFIX"/share/pixmaps/;\
mv anki.desktop "$PREFIX"/share/applications/;\
mv anki.1 "$PREFIX"/share/man/man1/)
xdg-mime install anki.xml --novendor
xdg-mime default anki.desktop application/x-colpkg

View File

@ -6,13 +6,13 @@ if [ "$PREFIX" = "" ]; then
PREFIX=/usr/local
fi
xdg-mime uninstall ${PREFIX}/share/anki/anki.xml || true
xdg-mime uninstall "$PREFIX"/share/anki/anki.xml || true
rm -rf ${PREFIX}/share/anki
rm -rf ${PREFIX}/bin/anki
rm -rf ${PREFIX}/share/pixmaps/anki.xpm
rm -rf ${PREFIX}/share/pixmaps/anki.png
rm -rf ${PREFIX}/share/applications/anki.desktop
rm -rf ${PREFIX}/share/man/man1/anki.1
rm -rf "$PREFIX"/share/anki
rm -rf "$PREFIX"/bin/anki
rm -rf "$PREFIX"/share/pixmaps/anki.xpm
rm -rf "$PREFIX"/share/pixmaps/anki.png
rm -rf "$PREFIX"/share/applications/anki.desktop
rm -rf "$PREFIX"/share/man/man1/anki.1
echo "Uninstall complete."