public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Jon Turney <jturney@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: doc: Update postinstall/preremove scripts Date: Tue, 14 Mar 2023 14:14:50 +0000 (GMT) [thread overview] Message-ID: <20230314141450.AD9083858C83@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c553a95243906a103a5250121833e5bc9e28f760 commit c553a95243906a103a5250121833e5bc9e28f760 Author: Jon Turney <jon.turney@dronecode.org.uk> Date: Thu Mar 2 21:33:32 2023 +0000 Cygwin: doc: Update postinstall/preremove scripts setup >=2.925 indicates to postinstall and preremove scripts the Start Menu suffix to use via the CYGWIN_START_MENU_SUFFIX env var. It also indicates, via the CYGWIN_SETUP_OPTIONS env var, if the option to disable Start Menu shortcut creation is supplied. Update the Cygwin documentation postinstall and preremove scripts to take these env vars into consideration. Diff: --- winsup/doc/etc.postinstall.cygwin-doc.sh | 21 ++++++++++++++++----- winsup/doc/etc.preremove.cygwin-doc.sh | 8 ++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/winsup/doc/etc.postinstall.cygwin-doc.sh b/winsup/doc/etc.postinstall.cygwin-doc.sh index 97f88a16d..b9115ef92 100755 --- a/winsup/doc/etc.postinstall.cygwin-doc.sh +++ b/winsup/doc/etc.postinstall.cygwin-doc.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # /etc/postinstall/cygwin-doc.sh - cygwin-doc postinstall script. # installs Cygwin Start Menu shortcuts for Cygwin User Guide and API PDF and # HTML if in doc dir, and links to Cygwin web site home page and FAQ @@ -36,9 +36,20 @@ do fi done +# setup was run with options not to create startmenu items +case ${CYGWIN_SETUP_OPTIONS} in + *no-startmenu*) + exit 0 + ;; +esac + # Cygwin Start Menu directory -case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac -smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}" +if [ ! -v CYGWIN_START_MENU_SUFFIX ] +then + case $(uname -s) in *-WOW*) CYGWIN_START_MENU_SUFFIX=" (32-bit)" ;; esac +fi + +smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${CYGWIN_START_MENU_SUFFIX}" # ensure Cygwin Start Menu directory exists /usr/bin/mkdir -p "$smpc_dir" @@ -53,7 +64,7 @@ fi # create User Guide and API PDF and HTML shortcuts while read target name desc do - [ -r "$target" ] && $mks $CYGWINFORALL -P -n "Cygwin${wow64}/$name" -d "$desc" -- $target + [ -r "$target" ] && $mks $CYGWINFORALL -P -n "Cygwin${CYGWIN_START_MENU_SUFFIX}/$name" -d "$desc" -- $target done <<EOF $doc/cygwin-ug-net.pdf User\ Guide\ \(PDF\) Cygwin\ User\ Guide\ PDF $html/cygwin-ug-net/index.html User\ Guide\ \(HTML\) Cygwin\ User\ Guide\ HTML @@ -64,7 +75,7 @@ EOF # create Home Page and FAQ URL link shortcuts while read target name desc do - $mks $CYGWINFORALL -P -n "Cygwin${wow64}/$name" -d "$desc" -a $target -- $launch + $mks $CYGWINFORALL -P -n "Cygwin${CYGWIN_START_MENU_SUFFIX}/$name" -d "$desc" -a $target -- $launch done <<EOF $site/index.html Home\ Page Cygwin\ Home\ Page\ Link $site/faq.html FAQ Cygwin\ Frequently\ Asked\ Questions\ Link diff --git a/winsup/doc/etc.preremove.cygwin-doc.sh b/winsup/doc/etc.preremove.cygwin-doc.sh index b098e6dac..cac29ee21 100755 --- a/winsup/doc/etc.preremove.cygwin-doc.sh +++ b/winsup/doc/etc.preremove.cygwin-doc.sh @@ -26,8 +26,12 @@ do done # Cygwin Start Menu directory -case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac -smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}" +if [ ! -v CYGWIN_START_MENU_SUFFIX ] +then + case $(uname -s) in *-WOW*) CYGWIN_START_MENU_SUFFIX=" (32-bit)" ;; esac +fi + +smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${CYGWIN_START_MENU_SUFFIX}" # check Cygwin Start Menu directory still exists [ -d "$smpc_dir/" ] || exit 0
reply other threads:[~2023-03-14 14:14 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230314141450.AD9083858C83@sourceware.org \ --to=jturney@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).