Gentoo Archives: gentoo-catalyst

From: Matt Turner <mattst88@g.o>
To: gentoo-catalyst@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-catalyst] [PATCH 28/37] targets: Move create_handbook_icon() to its use
Date: Wed, 21 Oct 2020 00:24:47
Message-Id: 20201021002344.378131-28-mattst88@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 01/37] catalyst: Use early return to unindent code by Matt Turner
1 And use <<- so we can indent the heredoc properly.
2
3 Signed-off-by: Matt Turner <mattst88@g.o>
4 ---
5 targets/support/chroot-functions.sh | 14 --------------
6 targets/support/livecdfs-update.sh | 15 +++++++++++++++
7 2 files changed, 15 insertions(+), 14 deletions(-)
8
9 diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
10 index 307a9042..22340023 100755
11 --- a/targets/support/chroot-functions.sh
12 +++ b/targets/support/chroot-functions.sh
13 @@ -303,20 +303,6 @@ show_debug() {
14 fi
15 }
16
17 -create_handbook_icon() {
18 - # This function creates a local icon to the Gentoo Handbook
19 - echo "[Desktop Entry]
20 -Encoding=UTF-8
21 -Version=1.0
22 -Type=Link
23 -URL=file:///mnt/cdrom/docs/handbook/html/index.html
24 -Terminal=false
25 -Name=Gentoo Linux Handbook
26 -GenericName=Gentoo Linux Handbook
27 -Comment=This is a link to the local copy of the Gentoo Linux Handbook.
28 -Icon=text-editor" > /usr/share/applications/gentoo-handbook.desktop
29 -}
30 -
31 readonly locales="
32 C.UTF8 UTF-8
33 "
34 diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh
35 index 557d990b..47dbb5b3 100755
36 --- a/targets/support/livecdfs-update.sh
37 +++ b/targets/support/livecdfs-update.sh
38 @@ -243,6 +243,21 @@ case ${clst_livecd_type} in
39 # Clear out lastlog
40 rm -f /var/log/lastlog && touch /var/log/lastlog
41
42 + create_handbook_icon() {
43 + cat <<-EOF > /usr/share/applications/gentoo-handbook.desktop
44 + [Desktop Entry]
45 + Encoding=UTF-8
46 + Version=1.0
47 + Type=Link
48 + URL=file:///mnt/cdrom/docs/handbook/html/index.html
49 + Terminal=false
50 + Name=Gentoo Linux Handbook
51 + GenericName=Gentoo Linux Handbook
52 + Comment=This is a link to the local copy of the Gentoo Linux Handbook.
53 + Icon=text-editor
54 + EOF
55 + }
56 +
57 # Create our Handbook icon
58 [ -e /docs/handbook/index.html ] && create_handbook_icon
59 [ -n "${clst_livecd_overlay}" ] && [ -e ${clst_livecd_overlay}/docs/handbook/index.html ] && create_handbook_icon
60 --
61 2.26.2