replace shortcut parameter assignments with read loops, run with sh
This commit is contained in:
parent
9938a64ca9
commit
d54ee34e23
@ -1,12 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
# /etc/postinstall/cygwin-doc.sh - cygwin-doc postinstall script.
|
# /etc/postinstall/cygwin-doc.sh - cygwin-doc postinstall script.
|
||||||
# installs Cygwin Start Menu shortcuts for Cygwin User Guide and API PDF and
|
# 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
|
# HTML if in doc dir, and links to Cygwin web site home page and FAQ
|
||||||
#
|
#
|
||||||
# Assumes you are running setup.exe 2.510.2.2 or newer, executed by /bin/bash
|
|
||||||
# and not /bin/[da]sh (if you are running an older setup.exe, this postinstall
|
|
||||||
# script can't do anything).
|
|
||||||
#
|
|
||||||
# CYGWINFORALL=-A if install for All Users
|
# CYGWINFORALL=-A if install for All Users
|
||||||
# installs local shortcuts for All Users or Current User in
|
# installs local shortcuts for All Users or Current User in
|
||||||
# {ProgramData,~/Appdata/Roaming}/Microsoft/Windows/Start Menu/Programs/Cygwin/
|
# {ProgramData,~/Appdata/Roaming}/Microsoft/Windows/Start Menu/Programs/Cygwin/
|
||||||
@ -48,43 +44,23 @@ fi
|
|||||||
# mkshortcut works only in current directory - change to Cygwin Start Menu
|
# mkshortcut works only in current directory - change to Cygwin Start Menu
|
||||||
cd "$smpc_dir" || exit 2 # quit if not found
|
cd "$smpc_dir" || exit 2 # quit if not found
|
||||||
|
|
||||||
# User Guide PDF & HTML
|
# create User Guide and API PDF and HTML shortcuts
|
||||||
p=$doc/cygwin-ug-net.pdf
|
while read target name desc
|
||||||
n="User Guide (PDF)"
|
do
|
||||||
d="PDF Cygwin User Guide"
|
[ -r $t ] && $mks -n "$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
|
||||||
|
$doc/cygwin-api.pdf API\ \(PDF\) Cygwin\ API\ Reference\ PDF
|
||||||
|
$html/cygwin-api/index.html API\ \(HTML\) Cygwin\ API\ Reference\ HTML
|
||||||
|
EOF
|
||||||
|
|
||||||
[ -r $p ] && $mks -n "$n" -d "$d" $p
|
# create Home Page and FAQ URL link shortcuts
|
||||||
|
while read target name desc
|
||||||
i=$html/cygwin-ug-net/index.html
|
do
|
||||||
n="User Guide (HTML)"
|
$mks -n "$name" -d "$desc" $target
|
||||||
d="HTML Cygwin User Guide"
|
done <<EOF
|
||||||
|
$site/index.html Home\ Page Cygwin\ Home\ Page\ Link
|
||||||
[ -r $i ] && $mks -n "$n" -d "$d" $i
|
$site/faq.html FAQ Cygwin\ Frequently\ Asked\ Questions\ Link
|
||||||
|
EOF
|
||||||
# API PDF & HTML
|
|
||||||
p=$doc/cygwin-api.pdf
|
|
||||||
n="API (PDF)"
|
|
||||||
d="PDF Cygwin API Reference"
|
|
||||||
|
|
||||||
[ -r $p ] && $mks -n "$n" -d "$d" $p
|
|
||||||
|
|
||||||
i=$html/cygwin-api/index.html
|
|
||||||
n="API (HTML)"
|
|
||||||
d="HTML Cygwin API Reference"
|
|
||||||
|
|
||||||
[ -r $i ] && $mks -n "$n" -d "$d" $i
|
|
||||||
|
|
||||||
# Home Page URL
|
|
||||||
h=$site/index.html
|
|
||||||
n="Home Page"
|
|
||||||
d="Cygwin $n"
|
|
||||||
|
|
||||||
$mks -n "$n" -d "$d" $h
|
|
||||||
|
|
||||||
# FAQ URL
|
|
||||||
h=$site/faq.html
|
|
||||||
n="FAQ"
|
|
||||||
d="Cygwin Frequently Asked Questions (with answers)"
|
|
||||||
|
|
||||||
$mks -n "$n" -d "$d" $h
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user