From 4d527be52111772c86919b2aab16cdd140821dc2 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 16 Nov 2020 15:49:54 +0100 Subject: [PATCH 1/3] install.sh: Create all destination directories The explit list of destination directories to create is incomplete which becomes apperent, if installed into a empty directoy with DESTDIR=... Create any required directory implicitly. --- install.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 8632a44..35537c3 100755 --- a/install.sh +++ b/install.sh @@ -58,6 +58,8 @@ function install_if() shift 2 if need_update "$src" "$dst"; then + dir="$(dirname "$dst")" + test -d "$dir" || mkdir -p "$dir" "$@" "$src" "$dst" fi return 0 @@ -65,7 +67,6 @@ function install_if() function install_desktop_file() { - test -d ${desktopdir} || mkdir -p ${desktopdir} install_if "$1" "$2" $INSTALL_DATA update-desktop-database ${desktopdir} } @@ -94,13 +95,6 @@ function install_symlink() umask 022; -mkdir -p "$DESTDIR$usr_bindir" -mkdir -p "$DESTDIR$usr_sbindir" -mkdir -p "$DESTDIR$systemdunitdir" -mkdir -p "$DESTDIR$usrlocal_bindir" -mkdir -p "$DESTDIR$udev_rulesdir" -mkdir -p "$DESTDIR$udev_helperdir" - install_exec make-automaps/make-automaps "$DESTDIR$usr_sbindir/make-automaps" install_data misc_systemd_units/automount.service "$DESTDIR$systemdunitdir/automount.service" install_data misc_systemd_units/dhcrelay.service "$DESTDIR$systemdunitdir/dhcrelay.service" From c7c0a433a15d56403ddd1015e58daef20387431e Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 16 Nov 2020 15:58:31 +0100 Subject: [PATCH 2/3] update-desktop-database: Fix target when DESTDIR is used --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 35537c3..0533946 100755 --- a/install.sh +++ b/install.sh @@ -68,7 +68,7 @@ function install_if() function install_desktop_file() { install_if "$1" "$2" $INSTALL_DATA - update-desktop-database ${desktopdir} + update-desktop-database $DESTDIR${desktopdir} } function install_exec() From bf49c7ef7611e7c80ab474060ae2315ad67fc596 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 16 Nov 2020 16:03:01 +0100 Subject: [PATCH 3/3] install.sh: run update-desktop-database only once Don't run update-desktop-database after each installed desktop file but only once after all files are installed. --- install.sh | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index 0533946..ab86fdb 100755 --- a/install.sh +++ b/install.sh @@ -65,12 +65,6 @@ function install_if() return 0 } -function install_desktop_file() -{ - install_if "$1" "$2" $INSTALL_DATA - update-desktop-database $DESTDIR${desktopdir} -} - function install_exec() { install_if "$1" "$2" $INSTALL_PROGRAM @@ -178,12 +172,13 @@ mkdir -p "$DESTDIR$sysconfdir/issue.d/" install_symlink /node/issue.d/notrust.issue "$DESTDIR$sysconfdir/issue.d/notrust.issue" install_data checktrust/getty-checktrust.service "$DESTDIR$systemdunitdir/getty-checktrust.service" install_exec checktrust/getty-checktrust "$DESTDIR$usr_exec_prefix/libexec/getty-checktrust" -install_desktop_file desktop-files/org.inkscape.Inkscape.desktop \ - "$DESTDIR$desktopdir/org.inkscape.Inkscape.desktop" -install_desktop_file desktop-files/rstudio.desktop "$DESTDIR$desktopdir/rstudio.desktop" -install_desktop_file desktop-files/meld3.desktop "$DESTDIR$desktopdir/meld3.desktop" -install_desktop_file desktop-files/ugene.desktop "$DESTDIR$desktopdir/ugene.desktop" -install_desktop_file desktop-files/org.octave.Octave.desktop \ - "$DESTDIR$desktopdir/org.octave.Octave.desktop" -install_desktop_file desktop-files/igv.desktop "$DESTDIR$desktopdir/igv.desktop" +install_data desktop-files/org.inkscape.Inkscape.desktop "$DESTDIR$desktopdir/org.inkscape.Inkscape.desktop" +install_data desktop-files/rstudio.desktop "$DESTDIR$desktopdir/rstudio.desktop" +install_data desktop-files/meld3.desktop "$DESTDIR$desktopdir/meld3.desktop" +install_data desktop-files/ugene.desktop "$DESTDIR$desktopdir/ugene.desktop" +install_data desktop-files/org.octave.Octave.desktop "$DESTDIR$desktopdir/org.octave.Octave.desktop" +install_data desktop-files/igv.desktop "$DESTDIR$desktopdir/igv.desktop" + +update-desktop-database "$DESTDIR$desktopdir" + exit