From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id AD9083858C83; Tue, 14 Mar 2023 14:14:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD9083858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678803290; bh=PtoXqetWf1VxmcrE4iK0Hsm83nRI8M+JHhWUXgEZ+Tc=; h=From:To:Subject:Date:From; b=H2fRTIz9zIjchtC7eFKzlPrFRrIpNpFXKNWsypIq2ZhKFNvUl/IQzJA0QYwoap93d boDMAswNmdRLWUlEhEmY1X1EgC4vK1bTcLfZUJ+7lwggoBdEt0qFhTdqR8Fmm/VL46 gGehZclGc5SnnPlQx+6qFBVcJNplsyOwLNnR8cxE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: doc: Update postinstall/preremove scripts X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: dfd14093e32853d832b25ca316576b2309d90560 X-Git-Newrev: c553a95243906a103a5250121833e5bc9e28f760 Message-Id: <20230314141450.AD9083858C83@sourceware.org> Date: Tue, 14 Mar 2023 14:14:50 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc553a952439= 06a103a5250121833e5bc9e28f760 commit c553a95243906a103a5250121833e5bc9e28f760 Author: Jon Turney Date: Thu Mar 2 21:33:32 2023 +0000 Cygwin: doc: Update postinstall/preremove scripts =20 setup >=3D2.925 indicates to postinstall and preremove scripts the Start Menu suffix to use via the CYGWIN_START_MENU_SUFFIX env var. =20 It also indicates, via the CYGWIN_SETUP_OPTIONS env var, if the option to disable Start Menu shortcut creation is supplied. =20 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.post= install.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 a= nd # HTML if in doc dir, and links to Cygwin web site home page and FAQ @@ -36,9 +36,20 @@ do fi done =20 +# 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=3D" (32-bit)" ;; esac -smpc_dir=3D"$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}" +if [ ! -v CYGWIN_START_MENU_SUFFIX ] +then + case $(uname -s) in *-WOW*) CYGWIN_START_MENU_SUFFIX=3D" (32-bit)" ;; es= ac +fi + +smpc_dir=3D"$($cygp $CYGWINFORALL -P -U --)/Cygwin${CYGWIN_START_MENU_SUFF= IX}" =20 # 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_S= UFFIX}/$name" -d "$desc" -- $target done <