#!/bin/sh # /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 # # CYGWINFORALL=-A if install for All Users # installs local shortcuts for All Users or Current User in # {ProgramData,~/Appdata/Roaming}/Microsoft/Windows/Start Menu/Programs/Cygwin/ # exits quietly if directory does not exist as presumably no shortcuts desired doc=/usr/share/doc/cygwin-doc + doc=/usr/share/doc/cygwin-doc site=https://cygwin.com + site=https://cygwin.com cygp=/usr/bin/cygpath + cygp=/usr/bin/cygpath mks=/usr/bin/mkshortcut + mks=/usr/bin/mkshortcut launch=/usr/bin/cygstart + launch=/usr/bin/cygstart html=$doc/html + html=/usr/share/doc/cygwin-doc/html # check source directories created for d in $doc $html do if [ ! -d "$d/" ] then echo "Can't find directory '$d'" exit 2 fi done + for d in $doc $html + '[' '!' -d /usr/share/doc/cygwin-doc/ ']' + for d in $doc $html + '[' '!' -d /usr/share/doc/cygwin-doc/html/ ']' # check for programs for p in $cygp $mks $launch do if [ ! -x "$p" ] then echo "Can't find program '$p'" exit 2 fi done + for p in $cygp $mks $launch + '[' '!' -x /usr/bin/cygpath ']' + for p in $cygp $mks $launch + '[' '!' -x /usr/bin/mkshortcut ']' + for p in $cygp $mks $launch + '[' '!' -x /usr/bin/cygstart ']' # Cygwin Start Menu directory case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac + case $(uname -s) in ++ uname -s + wow64=' (32-bit)' smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}" ++ /usr/bin/cygpath -P -U -- + smpc_dir='/proc/cygdrive/c/Users/Marco/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Cygwin (32-bit)' # ensure Cygwin Start Menu directory exists /usr/bin/mkdir -p "$smpc_dir" + /usr/bin/mkdir -p '/proc/cygdrive/c/Users/Marco/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Cygwin (32-bit)' # check Cygwin Start Menu directory writable if [ ! -w "$smpc_dir/" ] then echo "Can't write to directory '$smpc_dir'" exit 1 fi + '[' '!' -w '/proc/cygdrive/c/Users/Marco/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Cygwin (32-bit)/' ']' # 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 done <