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: Use a separate Start Menu folder for WoW64 installs
Date: Sat, 21 Mar 2020 17:18:27 +0000 (GMT)	[thread overview]
Message-ID: <20200321171827.B2BF6385E830@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6c8392d651f4bbd9f7f8603e466ce4f91ca506c5

commit 6c8392d651f4bbd9f7f8603e466ce4f91ca506c5
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Thu Mar 19 13:54:10 2020 +0000

    Cygwin: Use a separate Start Menu folder for WoW64 installs
    
    This aligns the shortcuts to documentation with the setup changes in
    https://sourceware.org/pipermail/cygwin-apps/2020-March/039873.html
    
    v2:
    Create/remove the Start Menu directory as needed/possible
    Correctly use that directory when making shortcuts

Diff:
---
 winsup/doc/etc.postinstall.cygwin-doc.sh | 12 ++++++------
 winsup/doc/etc.preremove.cygwin-doc.sh   |  5 ++++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/winsup/doc/etc.postinstall.cygwin-doc.sh b/winsup/doc/etc.postinstall.cygwin-doc.sh
index de7d9e0c3..97f88a16d 100755
--- a/winsup/doc/etc.postinstall.cygwin-doc.sh
+++ b/winsup/doc/etc.postinstall.cygwin-doc.sh
@@ -37,10 +37,11 @@ do
 done
 
 # Cygwin Start Menu directory
-smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
+case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
+smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
 
-# check Cygwin Start Menu directory exists
-[ -d "$smpc_dir/" ] || exit 0
+# ensure Cygwin Start Menu directory exists
+/usr/bin/mkdir -p "$smpc_dir"
 
 # check Cygwin Start Menu directory writable
 if [ ! -w "$smpc_dir/" ]
@@ -52,7 +53,7 @@ fi
 # create User Guide and API PDF and HTML shortcuts
 while read target name desc
 do
-	[ -r "$target" ] && $mks $CYGWINFORALL -P -n "Cygwin/$name" -d "$desc" -- $target
+	[ -r "$target" ] && $mks $CYGWINFORALL -P -n "Cygwin${wow64}/$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
@@ -63,9 +64,8 @@ EOF
 # create Home Page and FAQ URL link shortcuts
 while read target name desc
 do
-	$mks $CYGWINFORALL -P -n "Cygwin/$name" -d "$desc" -a $target -- $launch
+	$mks $CYGWINFORALL -P -n "Cygwin${wow64}/$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
 EOF
-
diff --git a/winsup/doc/etc.preremove.cygwin-doc.sh b/winsup/doc/etc.preremove.cygwin-doc.sh
index 5e47eb579..b098e6dac 100755
--- a/winsup/doc/etc.preremove.cygwin-doc.sh
+++ b/winsup/doc/etc.preremove.cygwin-doc.sh
@@ -26,7 +26,8 @@ do
 done
 
 # Cygwin Start Menu directory
-smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
+case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
+smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
 
 # check Cygwin Start Menu directory still exists
 [ -d "$smpc_dir/" ] || exit 0
@@ -52,3 +53,5 @@ $site/index.html	Home\ Page	Cygwin\ Home\ Page\ Link
 $site/faq.html		FAQ	Cygwin\ Frequently\ Asked\ Questions\ Link
 EOF
 
+# remove Cygwin Start Menu directory if empty
+/usr/bin/rmdir --ignore-fail-on-non-empty "${smpc_dir}"


                 reply	other threads:[~2020-03-21 17:18 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=20200321171827.B2BF6385E830@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: link
Be 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).