afe3ab588a6b2992efe5a9b22ed038545ba3cdbfLennart Poettering#!/bin/bash
c343be283b7152554bac0c02493a4e1759c163f7Kay Sievers
b3ae710c251d0ce5cf2cef63208e325497b5e323Zbigniew Jędrzejewski-SzmekARCH=`uname -p`
b3ae710c251d0ce5cf2cef63208e325497b5e323Zbigniew Jędrzejewski-Szmekif [ $ARCH != "sparc" ]; then
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers ARCH=x86
f957632b960a0a42999b38ded7089fa602b41745Kay Sieversfi
f957632b960a0a42999b38ded7089fa602b41745Kay SieversALL_PRODUCTS="jds=JDS Common Packages
f957632b960a0a42999b38ded7089fa602b41745Kay Sieversjds-src=Sources for JDS Common Packages
afe3ab588a6b2992efe5a9b22ed038545ba3cdbfLennart Poetteringgnome=GNOME 2.17 Desktop
d19e85f0d474ed1882561b458d528cbae49f640eZbigniew Jędrzejewski-Szmekgnome-src=GNOME 2.17 Source
d19e85f0d474ed1882561b458d528cbae49f640eZbigniew Jędrzejewski-Szmekmozilla=Mozilla 1.7 Web Browser
d19e85f0d474ed1882561b458d528cbae49f640eZbigniew Jędrzejewski-Szmekmozilla-src=Mozilla Source
d19e85f0d474ed1882561b458d528cbae49f640eZbigniew Jędrzejewski-Szmekfirefox=Firefox Web Browser
d19e85f0d474ed1882561b458d528cbae49f640eZbigniew Jędrzejewski-Szmekfirefox-src=Firefox Source
3f85ef0f05ffc51e19f86fb83a1c51e8e3cd6817Harald Hoyerthunderbird=Thunderbird Email and News Client
afe3ab588a6b2992efe5a9b22ed038545ba3cdbfLennart Poetteringthunderbird-src=Thunderbird Source
afe3ab588a6b2992efe5a9b22ed038545ba3cdbfLennart Poetteringidn
afea8d3853d0f76b3845729ff00e75d281f43a1bZbigniew Jędrzejewski-Szmekidn-src
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poetteringevolution=Evolution Email and Calendar
f85857df75cfedbc0d10b8ca2400188dc8f4c22eLennart Poetteringevolution-src=Evolution Source
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poetteringglow=Integrated Collaboration Environment
bafb15bab99887d1b6b8a35136531bac6c3876a6Lennart Poetteringjai=Java Advanced Imaging
81429136905a6204875174b60a179333b7f3c9e4Kay Sieversjai-iio=Java Advanced Imaging
e7b4d43ec3d5eb0099a3978f98a46f3c15443b23Lennart Poetteringjava=Java Runtime Environment
58f55364fa00a6a4706df2c4a01c6967f432e531Lennart Poetteringjava-src
58f55364fa00a6a4706df2c4a01c6967f432e531Lennart Poetteringjavaapps=Java Applications
83a1ff25e5228b0a5b2cc942fd4f964d10bb73b0Zbigniew Jędrzejewski-Szmekjavaapps-src=Java Applications Sources
83a1ff25e5228b0a5b2cc942fd4f964d10bb73b0Zbigniew Jędrzejewski-Szmekjava3d
83a1ff25e5228b0a5b2cc942fd4f964d10bb73b0Zbigniew Jędrzejewski-Szmekjcs
83a1ff25e5228b0a5b2cc942fd4f964d10bb73b0Zbigniew Jędrzejewski-Szmekjdk=Java Development Kit
83a1ff25e5228b0a5b2cc942fd4f964d10bb73b0Zbigniew Jędrzejewski-Szmekjdic=Java Desktop Integration Components
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringjdnc=Java Desktop Network Components
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringjinput=Java Controller API
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringjoal=Java bindings for OpenAL API
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringjogl=Java bindings for OpenGL API
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringl10n=Globalization Tools
fbe1a1a94f19112d7e5d60c40d87487ad24e2ce4Lennart Poetteringl10n-src=Globalization Tools Sources
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringl10nmessages=Localized Messages
7c75c5ca68970d2d47f211f068883e9b8c3ff5e7Lennart Poetteringiiim=Input Method Switcher
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringiiim-src=Input Method Switcher Sources
7c75c5ca68970d2d47f211f068883e9b8c3ff5e7Lennart Poetteringmuscle
7c75c5ca68970d2d47f211f068883e9b8c3ff5e7Lennart Poetteringplugins=Third Party Browser Plugins
7c75c5ca68970d2d47f211f068883e9b8c3ff5e7Lennart Poetteringplugins-src
679829e4aa1461a2db7537aae4c68c6780362c06Lennart Poetteringscs-client
35c594e044bea03baf5b9b6c429b9ac9bb5aa0b5Lennart Poetteringstaroffice=StarOffice office suite
40d6f6a35e7c66ccb8ea060b4539aa2565b4ebf9David Herrmannstarsuite=StarSuite office suite
40d6f6a35e7c66ccb8ea060b4539aa2565b4ebf9David Herrmannso-sdk=StarOffice Software Development Kit
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringupdater
6ce02c2a3a2aa888c3e074ae235d94808a165f9aLennart Poetteringnetbeans
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poetteringjavahelp
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poetteringxserver=X.org server
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poetteringnodist=Extra packages for JDS developers
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poetteringnodist-src=Extra sources for JDS developers
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poetteringapoc-daemon=APOC Daemon
a47e6701bfc45519a4e038daa52e9236e932f59aLennart Poetteringapoc-daemon-src=APOC Daemon Sources
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poetteringapoc-sol-$ARCH=APOC Configuration Manager
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poetteringapoc-sol-$ARCH-src=APOC Configuration Manager Sources"
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poettering
a47e6701bfc45519a4e038daa52e9236e932f59aLennart PoetteringALL_PATCHDIRS="patches-xserver=X server patches
a47e6701bfc45519a4e038daa52e9236e932f59aLennart Poetteringpatches-mozilla=Patches required for the Mozilla Web browser
a47e6701bfc45519a4e038daa52e9236e932f59aLennart Poetteringpatches-gnome=Patches required for the GNOME Desktop"
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poettering
a47e6701bfc45519a4e038daa52e9236e932f59aLennart PoetteringPKGADD=/usr/sbin/pkgadd
07289967bc8fc32fc2cc65e8946da70e2853d290Lennart PoetteringPATCHADD=/usr/sbin/patchadd
b80c66ba9836456de5260e4a1b696ba25561f613Lennart PoetteringPKGRM=/usr/sbin/pkgrm
92ff080be100aff15f292e2631921131c610afe7Lennart PoetteringPKGINFO=/usr/bin/pkginfo
b80c66ba9836456de5260e4a1b696ba25561f613Lennart PoetteringADMIN=/tmp/.pkg.$$.admin
bd69054b0987b40a0df87d40772893f6f8a078daLennart PoetteringADMIN_CREATED=no
bd69054b0987b40a0df87d40772893f6f8a078daLennart Poettering
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringMYNAME="$0"
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringMYDIR=`dirname $0`
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringMYDIR=`( cd $MYDIR; pwd )`
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringMYNAME=$(basename $0)
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringMYARGS="$*"
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringLOGFILE=/var/sadm/install/logs/jds-install.log.$$
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringINFOFILE=$MYDIR/.pkginfo
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart PoetteringSYSTEM=`uname -s`
de146bb2aac13361ade3050d37696499ac4ca9aeLennart PoetteringARCH=`uname -p`
de146bb2aac13361ade3050d37696499ac4ca9aeLennart PoetteringRELEASE=`uname -r`
358ba19e5e18304258f053e30e6120a3b6adf322Lennart PoetteringKERNELID=`uname -v`
358ba19e5e18304258f053e30e6120a3b6adf322Lennart Poettering
91f4347ef7bde17418b365ed3a97a752fe65bd50Lennart Poettering# ask "question" variable_name "default answer"
358ba19e5e18304258f053e30e6120a3b6adf322Lennart Poetteringask () {
de146bb2aac13361ade3050d37696499ac4ca9aeLennart Poettering echo -n "$1"
de146bb2aac13361ade3050d37696499ac4ca9aeLennart Poettering if [ ! -z $3 ]; then
5b728e6ba17c39e0787ad81b96a5582f4390f091Lennart Poettering echo -n " [$3]: "
5b728e6ba17c39e0787ad81b96a5582f4390f091Lennart Poettering else
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart Poettering echo -n ": "
c3a0d00d6dd6f5997d673e133ef6f9f856550b0aLennart Poettering fi
82e6c50c473f4be8df77c7a510577f1975eedddbLennart Poettering
82e6c50c473f4be8df77c7a510577f1975eedddbLennart Poettering read -e val
d2f81fb00cc3c49e21b31000ba7d37b81a260257Lennart Poettering if [ "x$val" = x ]; then
d2f81fb00cc3c49e21b31000ba7d37b81a260257Lennart Poettering eval "$2=\"$3\""
98cd2651988619bf606f0b27825440c4638a7e0bLennart Poettering else
b7307642391c8ebb9724c99e6b33239e2c0ff944Lennart Poettering eval "$2=\"$val\""
b7307642391c8ebb9724c99e6b33239e2c0ff944Lennart Poettering fi
2a441c8afe7c81f74cc2ceccdf9a71301cd39d4dLennart Poettering}
2a441c8afe7c81f74cc2ceccdf9a71301cd39d4dLennart Poettering
2a441c8afe7c81f74cc2ceccdf9a71301cd39d4dLennart Poettering# ask_yes_no "question" variable_name "default answer"
2a441c8afe7c81f74cc2ceccdf9a71301cd39d4dLennart Poetteringask_yes_no () {
2a441c8afe7c81f74cc2ceccdf9a71301cd39d4dLennart Poettering yes_no_repeat=yes
40ff4a4abd76d71408e598ed02d7860b8465fa9aLennart Poettering while [ $yes_no_repeat = yes ]; do
40ff4a4abd76d71408e598ed02d7860b8465fa9aLennart Poettering yes_no_repeat=no
40ff4a4abd76d71408e598ed02d7860b8465fa9aLennart Poettering ask "${@}"
40ff4a4abd76d71408e598ed02d7860b8465fa9aLennart Poettering eval "the_ans=\"\$$2\""
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering echo "$the_ans" | grep -i "^`l10n_print yes`$" > /dev/null
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering if [ $? = 0 ]; then
f131770b1465fbf423881f16ba85523a05f846feVeres Lajos eval "$2=yes"
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering return
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering fi
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering echo "$the_ans" | grep -i "^`l10n_print no`$" > /dev/null
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering if [ $? = 0 ]; then
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering eval "$2=no"
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering return
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering fi
0a86c1a9d8066267b878dfeddc5e0087dda6a37bLennart Poettering l10n_print "Please answer yes or no"
41114e81b562bcee52be1ef94c684ace2362ca54Lennart Poettering yes_no_repeat=yes
41114e81b562bcee52be1ef94c684ace2362ca54Lennart Poettering done
e3286870fdf20c3c93e944b24fd9af53620f7dbaLennart Poettering}
e3286870fdf20c3c93e944b24fd9af53620f7dbaLennart Poettering
e3286870fdf20c3c93e944b24fd9af53620f7dbaLennart Poetteringget_req () {
e3286870fdf20c3c93e944b24fd9af53620f7dbaLennart Poettering test -r $INFOFILE && \
e3286870fdf20c3c93e944b24fd9af53620f7dbaLennart Poettering grep -i "^$1[ ]*=[ ]*" $INFOFILE | cut -f2 -d= | tr -d ' '
e3286870fdf20c3c93e944b24fd9af53620f7dbaLennart Poettering}
e3286870fdf20c3c93e944b24fd9af53620f7dbaLennart Poettering
a195cbad3796dfda3d1016e4819c612c859e3c7bLennart PoetteringREQ_SYSTEM=`get_req system`
a195cbad3796dfda3d1016e4819c612c859e3c7bLennart PoetteringREQ_ARCH=`get_req arch`
8514b67754c5ff7fa628929b3d27131010c21842Lennart PoetteringREQ_RELEASE=`get_req release`
8514b67754c5ff7fa628929b3d27131010c21842Lennart PoetteringREQ_KERNELID=`get_req kernelid`
6c78f43c7b0e54e695af49917fda79b584f46830Lennart Poettering
6c78f43c7b0e54e695af49917fda79b584f46830Lennart Poetteringversion_lower () {
7b0fce617c48eda32b2d4e04b5f0e4376e8c0106Lennart Poettering declare -a version1
7b0fce617c48eda32b2d4e04b5f0e4376e8c0106Lennart Poettering declare -a version2
7b0fce617c48eda32b2d4e04b5f0e4376e8c0106Lennart Poettering
7b0fce617c48eda32b2d4e04b5f0e4376e8c0106Lennart Poettering IFS=' '
7b0fce617c48eda32b2d4e04b5f0e4376e8c0106Lennart Poettering for n in `echo $1 | sed -e 's/Generic/999999/' | tr -cs "[0-9]" "[ *]"`; do
b568ef14a75dffb7182e0acbdec743b31df2a597Lennart Poettering version1=(${version1[*]} $n)
c2d5b3c94d0c082ef29597fb230f8b88b124bab8Lennart Poettering done
264b8070715d2d19344c4991ace21147d998f56dLennart Poettering for n in `echo $2 | sed -e 's/Generic/999999/' | tr -cs "[0-9]" "[ *]"`; do
264b8070715d2d19344c4991ace21147d998f56dLennart Poettering version2=(${version2[*]} $n)
4ecd22142543aac55ddac1da3b7d6882c009d637Lennart Poettering done
4ecd22142543aac55ddac1da3b7d6882c009d637Lennart Poettering
7e27f3121e5a10629302b5221eb21345f832724aLennart Poettering typeset -i n=0
7e27f3121e5a10629302b5221eb21345f832724aLennart Poettering while /bin/true; do
f81e67f79fa856aa2ecffad4d014772ce981745cLennart Poettering if [ -n "${version1[$n]}" ]; then
f81e67f79fa856aa2ecffad4d014772ce981745cLennart Poettering if [ -n "${version2[$n]}" ]; then
d48b7bd271b1e70924c8485d2f95c2f5a1ae77cbLennart Poettering if [ ${version1[$n]} -lt ${version2[$n]} ]; then
d48b7bd271b1e70924c8485d2f95c2f5a1ae77cbLennart Poettering return 0
25e14499c4c5b02229d05a5bc26c3693ade5f987Lennart Poettering else
25e14499c4c5b02229d05a5bc26c3693ade5f987Lennart Poettering if [ ${version1[$n]} -gt ${version2[$n]} ]; then
758c4d7a391c0e024737053c815bf3924653b8c5Lennart Poettering return 1
758c4d7a391c0e024737053c815bf3924653b8c5Lennart Poettering fi
821cc13ddae40fb7608458b44aaa7a3fd33d56d9Lennart Poettering fi
821cc13ddae40fb7608458b44aaa7a3fd33d56d9Lennart Poettering else
8483d73ff158ee0d51ccbba09a470cc6ae9b071aLennart Poettering return 1
8483d73ff158ee0d51ccbba09a470cc6ae9b071aLennart Poettering fi
8483d73ff158ee0d51ccbba09a470cc6ae9b071aLennart Poettering else
8483d73ff158ee0d51ccbba09a470cc6ae9b071aLennart Poettering if [ -n "${version2[$n]}" ]; then
8483d73ff158ee0d51ccbba09a470cc6ae9b071aLennart Poettering return 0
8483d73ff158ee0d51ccbba09a470cc6ae9b071aLennart Poettering fi
8483d73ff158ee0d51ccbba09a470cc6ae9b071aLennart Poettering return 1
25e773eeb4f853804e1bf0dbd9a184f23e9b2a97Kay Sievers fi
b857e042d621ffb98a652f33850b431fafbece43Lennart Poettering typeset n=$n+1
6dab5bb18151c80fc39bd51f03dcff40b920de3eLennart Poettering done
6dab5bb18151c80fc39bd51f03dcff40b920de3eLennart Poettering}
384a4be2b00cb95ce215dd343cc9aa77adc9b1ecLennart Poettering
384a4be2b00cb95ce215dd343cc9aa77adc9b1ecLennart Poetteringusage () {
706d97503df83d141d241b645d2c920d691b3d62Lennart Poettering echo "%s [options]" "$0"
706d97503df83d141d241b645d2c920d691b3d62Lennart Poettering l10n_print "Install the Java Desktop System, GNOME 2.17, Solaris Edition"
3bcde97e8502c48b53f7420e2433ca68e601662dLennart Poettering l10n_print " -h, --help display this help"
3bcde97e8502c48b53f7420e2433ca68e601662dLennart Poettering l10n_print " --quiet, -q less verbose operation."
533bb267f13e2f7b4d7b78de30e821dc81c82335Lennart Poettering l10n_print " --force, -f ignore any errors and continue."
533bb267f13e2f7b4d7b78de30e821dc81c82335Lennart Poettering l10n_print " --ignore, -i ignore file conflicts and continue."
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering l10n_print " -n non-interactive installation."
533bb267f13e2f7b4d7b78de30e821dc81c82335Lennart Poettering l10n_print " -R rootdir install into an alternative root directory."
b42de08aa4c97636e42c28c7bce08f0d7c2a719aZbigniew Jędrzejewski-Szmek l10n_print " -p prod1,prod2,..."
b42de08aa4c97636e42c28c7bce08f0d7c2a719aZbigniew Jędrzejewski-Szmek l10n_print " select products for installation"
b42de08aa4c97636e42c28c7bce08f0d7c2a719aZbigniew Jędrzejewski-Szmek l10n_print " -a install all products"
b42de08aa4c97636e42c28c7bce08f0d7c2a719aZbigniew Jędrzejewski-Szmek l10n_print " --nopatch don't install OS patches"
202aea456dfb279cd34da7bfd1880f6ac0fd849fLennart Poettering l10n_print " --accept accept the license terms"
42aeb14a4a0fa7d43da96a8ed0fb0e180a2dd5c8Lennart Poettering l10n_print " --tmpdir dir create temporary files in dir instead of /tmp"
42aeb14a4a0fa7d43da96a8ed0fb0e180a2dd5c8Lennart Poettering exit 1
42aeb14a4a0fa7d43da96a8ed0fb0e180a2dd5c8Lennart Poettering}
42aeb14a4a0fa7d43da96a8ed0fb0e180a2dd5c8Lennart Poettering
14a32924c9b46817c92ae11c1147a59dcb62012bLennart PoetteringQUIET=no
14a32924c9b46817c92ae11c1147a59dcb62012bLennart PoetteringFORCE=no
14a32924c9b46817c92ae11c1147a59dcb62012bLennart PoetteringIGNORE_CONFLICT=no
14a32924c9b46817c92ae11c1147a59dcb62012bLennart PoetteringINTERACTIVE=yes
14a32924c9b46817c92ae11c1147a59dcb62012bLennart PoetteringROOTDIR=
14a32924c9b46817c92ae11c1147a59dcb62012bLennart PoetteringPRODUCTS=
563b1bdc09efe0cf94dd3f514f30376ca854c1ceLennart PoetteringNO_PATCHES=no
563b1bdc09efe0cf94dd3f514f30376ca854c1ceLennart PoetteringBASE_TEMPDIR=/tmp
5dcf983854c2e8314dbee239180255490ec8ae1cLennart PoetteringLICENSE_ACCEPTED=yes
5dcf983854c2e8314dbee239180255490ec8ae1cLennart Poettering
5dcf983854c2e8314dbee239180255490ec8ae1cLennart Poetteringprocess_options () {
b873d33ec9583c92a0c2bc6807d010720fa31595Lennart Poettering while [ $# != 0 ]; do
d61bb44a89fde3042c7c15ea4975239f7dcb0cb0Lennart Poettering case "$1" in
ed220efd6657822332b9563ec53c5ab9f3c33220Lennart Poettering --help | -h )
ed220efd6657822332b9563ec53c5ab9f3c33220Lennart Poettering usage
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering ;;
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering --quiet | -q )
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering QUIET=yes
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering ;;
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering --force | -f )
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering FORCE=yes
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering ;;
41488fe9024a8955d19811620fd55dcc56a5b2baLennart Poettering --ignore | -i )
ca70bec9261977336c94f44d5fcf37e1c495326aLennart Poettering IGNORE_CONFLICT=yes
ca70bec9261977336c94f44d5fcf37e1c495326aLennart Poettering ;;
ca70bec9261977336c94f44d5fcf37e1c495326aLennart Poettering -R )
1dbe0a6efda7b1d35957eab7e1d56a2c69d806d9Lennart Poettering shift
1dbe0a6efda7b1d35957eab7e1d56a2c69d806d9Lennart Poettering ROOTDIR=$1
157a180e4fc827606833a6724834ba7b0246d650Tom Gundersen if [ "x$ROOTDIR" = x ]; then
157a180e4fc827606833a6724834ba7b0246d650Tom Gundersen l10n_print "Option %s requires an argument" "-R"
b873d33ec9583c92a0c2bc6807d010720fa31595Lennart Poettering usage
9d6db739ce1eaa3eace21801fd606d523b73c8f4Lennart Poettering fi
1dbe0a6efda7b1d35957eab7e1d56a2c69d806d9Lennart Poettering ;;
1dbe0a6efda7b1d35957eab7e1d56a2c69d806d9Lennart Poettering -n )
9d6db739ce1eaa3eace21801fd606d523b73c8f4Lennart Poettering INTERACTIVE=no
ff3d6560bead6879a2fed1bf99bfe8273b3723f1Zbigniew Jędrzejewski-Szmek ;;
ff3d6560bead6879a2fed1bf99bfe8273b3723f1Zbigniew Jędrzejewski-Szmek -a )
151226ab4bf276d60d51864330a99f886b923697Zbigniew Jędrzejewski-Szmek select_all_products
23c4091dc2b85d117512e89233fdeb47d1ff3d92Lennart Poettering unselect_all_srcs
23c4091dc2b85d117512e89233fdeb47d1ff3d92Lennart Poettering unselect_product nodist
9d6db739ce1eaa3eace21801fd606d523b73c8f4Lennart Poettering ;;
0f47ed0a052c0da743404f23ac3532aaabd23655Lennart Poettering --accept )
9d6db739ce1eaa3eace21801fd606d523b73c8f4Lennart Poettering LICENSE_ACCEPTED=yes
bc07548926ec5ed7b13df8d3656654f238e0b9a7Lennart Poettering ;;
bc07548926ec5ed7b13df8d3656654f238e0b9a7Lennart Poettering -p )
b6b63571ae3eca1741d54172922961af972b8f20Lennart Poettering shift
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering PRODUCTS="$1"
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering if [ "x$PRODUCTS" = x ]; then
3f77a1b19f5a8ce33566f7f6e28e94c08ea30841Kay Sievers l10n_print "Option %s requires an argument" "-R"
e2a69298819b58f008be61d314f8ab95ccaec427Lennart Poettering usage
e2a69298819b58f008be61d314f8ab95ccaec427Lennart Poettering fi
2834ffe78d7fd8be118429aa1449ac72641638c2Lennart Poettering ;;
2834ffe78d7fd8be118429aa1449ac72641638c2Lennart Poettering --tmpdir )
a940778fb1dd16479f455bab3ac6cbdbc5b06165Lennart Poettering shift
a940778fb1dd16479f455bab3ac6cbdbc5b06165Lennart Poettering BASE_TEMPDIR="$1"
a01647e53727107d82382bc5c9d98c894e8f386cLennart Poettering if [ "x$BASE_TEMPDIR" = x ]; then
3c779fa59d1825d7db2a9516669d34ded7916913Lennart Poettering l10n_print "Option %s requires an argument" "--tmpdir"
a940778fb1dd16479f455bab3ac6cbdbc5b06165Lennart Poettering usage
a01647e53727107d82382bc5c9d98c894e8f386cLennart Poettering fi
3de03738fc970496d2d3da668c72767a48ccc41bLennart Poettering ;;
3de03738fc970496d2d3da668c72767a48ccc41bLennart Poettering --nopatch )
2b1c3767515672dfd0f5e0a9c9d7ac3a16a6a361Lennart Poettering NO_PATCHES=yes
2b1c3767515672dfd0f5e0a9c9d7ac3a16a6a361Lennart Poettering ;;
37efac5ddb21fd91ed420c070ed07f375e78b3b9Lennart Poettering * )
37efac5ddb21fd91ed420c070ed07f375e78b3b9Lennart Poettering l10n_print "Error: %s: invalid argument" "$1"
7348b3adb324614132cf376f478e883bd7de28f1Lennart Poettering usage
7348b3adb324614132cf376f478e883bd7de28f1Lennart Poettering ;;
e107ed185ef08945102834234a05ec51bb438685Lennart Poettering esac
e107ed185ef08945102834234a05ec51bb438685Lennart Poettering shift
81429136905a6204875174b60a179333b7f3c9e4Kay Sievers done
81429136905a6204875174b60a179333b7f3c9e4Kay Sievers}
e107ed185ef08945102834234a05ec51bb438685Lennart Poettering
f598ac3e28b729dd0b1d0a881df3e16465687a2bLennart Poetteringlogrun () {
11fb37f16ed99c1603c9d770b60ce4953b96a58dLennart Poettering status_file=/tmp/.command_status.$$
01083ad094664e5c685060f4fb35a05ea2f212edLennart Poettering rm -f $status_file
01083ad094664e5c685060f4fb35a05ea2f212edLennart Poettering echo "running $*" >> $LOGFILE
edb2935c5c5b95c42b8679086f60da5eafad74cbLennart Poettering echo "*** command output follows ***" >> $LOGFILE
edb2935c5c5b95c42b8679086f60da5eafad74cbLennart Poettering if [ "x$QUIET" = xno ]; then
769918ecd30c0f7ee6e87b9aa6226d956bd2f530Lennart Poettering ( "${@}" 2>&1 ; echo $? > $status_file ) | tee -a $LOGFILE
769918ecd30c0f7ee6e87b9aa6226d956bd2f530Lennart Poettering else
769918ecd30c0f7ee6e87b9aa6226d956bd2f530Lennart Poettering ( "${@}" 2>&1 ; echo $? > $status_file ) >> $LOGFILE
769918ecd30c0f7ee6e87b9aa6226d956bd2f530Lennart Poettering fi
6a3f892a23db71544d0439355f96c44350dafa8fLennart Poettering echo "*** command output ends ***" >> $LOGFILE
2a781fc9bd33982c81e5ff75974a442a33d4f167Lennart Poettering status=`cat $status_file`
2a781fc9bd33982c81e5ff75974a442a33d4f167Lennart Poettering rm -f $status_file
6a3f892a23db71544d0439355f96c44350dafa8fLennart Poettering return $status
6a3f892a23db71544d0439355f96c44350dafa8fLennart Poettering}
650264033f2f98f6319513958d94d59078654af8Lennart Poettering
650264033f2f98f6319513958d94d59078654af8Lennart Poetteringbackup () {
650264033f2f98f6319513958d94d59078654af8Lennart Poettering if [ -e "$1" ]; then
f8901862b2b030921b3d5aba4157044ceab16451Lennart Poettering backup "$1~"
eda8f06755bd98c4639293c26b856c225f0d1fe1Lennart Poettering l10n_print "Saving file %s as %s~" "$1" "$1"
eda8f06755bd98c4639293c26b856c225f0d1fe1Lennart Poettering mv "$1" "$1~" || msg_fatal "Failed to back up file %s" "$1"
d4fdc205a4610965cee46408dbd046c922e7620cLennart Poettering fi
d4fdc205a4610965cee46408dbd046c922e7620cLennart Poettering}
d4fdc205a4610965cee46408dbd046c922e7620cLennart Poettering
af1082b04a3d45a9b1d796b4271f44e87e307026Lennart Poetteringclean_up () {
af1082b04a3d45a9b1d796b4271f44e87e307026Lennart Poettering if [ "x$ADMIN_CREATED" = xyes ]; then
af1082b04a3d45a9b1d796b4271f44e87e307026Lennart Poettering rm -f $ADMIN
af1082b04a3d45a9b1d796b4271f44e87e307026Lennart Poettering fi
488ad3b32a7e2b5b1380abf4a15e5f65fa65f3feLennart Poettering cd /
488ad3b32a7e2b5b1380abf4a15e5f65fa65f3feLennart Poettering rm -rf $TEMPDIR
488ad3b32a7e2b5b1380abf4a15e5f65fa65f3feLennart Poettering}
488ad3b32a7e2b5b1380abf4a15e5f65fa65f3feLennart Poettering
488ad3b32a7e2b5b1380abf4a15e5f65fa65f3feLennart Poetteringclean_up_and_abort () {
488ad3b32a7e2b5b1380abf4a15e5f65fa65f3feLennart Poettering clean_up
47c94a96df29080f8b3a97e7362df4e9c6ba3265Lennart Poettering l10n_print "Interrupted."
47c94a96df29080f8b3a97e7362df4e9c6ba3265Lennart Poettering exit 1
09ecd746c9d6581664873674c2188f8c93ed7780Lennart Poettering}
09ecd746c9d6581664873674c2188f8c93ed7780Lennart Poettering
09ecd746c9d6581664873674c2188f8c93ed7780Lennart PoetteringTEXTDOMAIN=install-jds
09ecd746c9d6581664873674c2188f8c93ed7780Lennart Poetteringl10n_print () {
09ecd746c9d6581664873674c2188f8c93ed7780Lennart Poettering l10n_msg=`TEXTDOMAINDIR="$MYDIR"/.install gettext -d "$TEXTDOMAIN" "$1"`
09ecd746c9d6581664873674c2188f8c93ed7780Lennart Poettering shift
09ecd746c9d6581664873674c2188f8c93ed7780Lennart Poettering printf "$l10n_msg\n" "${@}"
ef417cfd2211ae017a38b9796c6db29130133e63Zbigniew Jędrzejewski-Szmek}
ef417cfd2211ae017a38b9796c6db29130133e63Zbigniew Jędrzejewski-Szmek
3333d748facc15f49935b6b793490ba0824976e6Zbigniew Jędrzejewski-Szmekmsg_fatal () {
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering msg_log "${@}"
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering l10n_print "${@}" 1>&2
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering clean_up
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering exit 1
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering}
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poetteringmsg_error () {
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering msg_log "${@}"
0bee65f0622c4faa8ac8ae771cc0c8a936dfa284Lennart Poettering l10n_print "${@}" 1>&2
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering if [ $FORCE = no ]; then
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering if [ "x$INTERACTIVE" = xyes ]; then
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering ask_yes_no "`l10n_print 'Would you like to continue?'`" ans \
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering `l10n_print "no"`
ebcf1f97de4f6b1580ae55eb56b1a3939fe6b602Lennart Poettering if [ "x$ans" = xno ]; then
47c94a96df29080f8b3a97e7362df4e9c6ba3265Lennart Poettering clean_up
47c94a96df29080f8b3a97e7362df4e9c6ba3265Lennart Poettering exit 1
718db96199eb307751264e4163555662c9a389faLennart Poettering fi
718db96199eb307751264e4163555662c9a389faLennart Poettering WARNINGS=yes
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering else
718db96199eb307751264e4163555662c9a389faLennart Poettering clean_up
718db96199eb307751264e4163555662c9a389faLennart Poettering exit 1
718db96199eb307751264e4163555662c9a389faLennart Poettering fi
966204e010ed432a1d7a0481d41a326d8ec7b0c8Lennart Poettering else
966204e010ed432a1d7a0481d41a326d8ec7b0c8Lennart Poettering WARNINGS=yes
94676f3e9352cbf1f72e0a512ee0d2ed83ff676dLennart Poettering fi
6fd4d0209827e5c3e52fa8c7144852f550f8f95cLennart Poettering}
416446221d905b6815175dc4d525d27f8ae43d1bLennart Poettering
416446221d905b6815175dc4d525d27f8ae43d1bLennart Poetteringmsg_log () {
7f79cd7109a60810140a045cc725291fc5515264Lennart Poettering test -f $LOGFILE || return
0aafd43d235982510d1c40564079f7bcec0c7c19Lennart Poettering log_arg1="$1"
19aadacf92ad86967ffb678e37b2ff9e83cb9480Jan Engelhardt shift
19aadacf92ad86967ffb678e37b2ff9e83cb9480Jan Engelhardt printf "$log_arg1\n" "${@}" >> $LOGFILE
df5f6971e6e15b4632884916c71daa076c8bae96Lennart Poettering}
df5f6971e6e15b4632884916c71daa076c8bae96Lennart Poettering
fcba531ed4c6e6f8f21d8ca4e3a56e3162b1c578Lennart PoetteringWARNINGS=no
fcba531ed4c6e6f8f21d8ca4e3a56e3162b1c578Lennart Poetteringmsg_warning () {
6aaa8c2f783cd1b3ac27c5ce40625d032e7e3d71Zbigniew Jędrzejewski-Szmek l10n_print "${@}"
c3bb87dbab8b79bb9253407cb5b7f3e6fe8db395Lennart Poettering WARNINGS=yes
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt}
18d4e7c26e7806ac363d19989df7144d5058ce41Lennart Poettering
bdeeb6b543a2a2d0a494f17b85f1498859cdfc2fLennart Poettering# check_disk_space directory minsize(kB)
bdeeb6b543a2a2d0a494f17b85f1498859cdfc2fLennart Poetteringcheck_disk_space () {
bdeeb6b543a2a2d0a494f17b85f1498859cdfc2fLennart Poettering dir_to_check="$ROOTDIR$1"
bdeeb6b543a2a2d0a494f17b85f1498859cdfc2fLennart Poettering while [ ! -d $dir_to_check ]; do
4e09014daf8f98584b3f15e64e93bed232e70a6bLennart Poettering dir_to_check="`dirname $dir_to_check`"
4e09014daf8f98584b3f15e64e93bed232e70a6bLennart Poettering done
4e09014daf8f98584b3f15e64e93bed232e70a6bLennart Poettering freespace=`df -k "$dir_to_check" | awk '!/Filesystem/ {print $4}'`
6bb648a16ae4a682ad4784412af706d2e6a3e4daTom Gundersen if [ $freespace -le $2 ]; then
fa607802f332e06f4044c3eb38dbea41076c803dLennart Poettering return 1
d0928791499734e202460d5c027b5d3e0d28e7abLennart Poettering fi
4a02e68602be9f6f3caac0f6195672490f715fe1Lennart Poettering
7212c6083a5577eabc96c35c9db4c19c113cae93Lennart Poettering return 0
1f140dd8b048c5f5599a886b8c4d20f3f1065774David Herrmann}
57f2a947270faf65e1876797b930e3f6d60ebd06Lennart Poettering
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt# so_disk_space_check prodname
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poetteringso_disk_space_check () {
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering # Need large tmp area (>=1GB) for StarOffice/StarSuite installation.
dc17bcef197a0d5ee798cce59c40e4f5e85c24f6Lennart Poettering check_disk_space $TEMPDIR 1048576 || \
80caea6cc72ebd311a311b1527cc6b87201c13bfLennart Poettering msg_error "Your %s directory has less than 1GB free.\nYou need to specify an alternative temp dir with the --tmpdir switch." "$BASE_TEMPDIR"
ab9716c2489f9141ed13ec22dbb216b3e6fbd6b5Lennart Poettering}
df98a87ba389bdfc0359beedf47557411f3af434Lennart Poettering
df98a87ba389bdfc0359beedf47557411f3af434Lennart Poetteringinit () {
df98a87ba389bdfc0359beedf47557411f3af434Lennart Poettering USER_IS_ROOT=0
df98a87ba389bdfc0359beedf47557411f3af434Lennart Poettering /usr/bin/id | /usr/bin/grep '^uid=0(' > /dev/null 2>&1
2ecfc64e59b5e4e96bed6f68bd36b612ef77a146Lennart Poettering
6a8b5fa4635ed858788fb10099ec9b62b3359a0aLennart Poettering if [ $? != 0 ]; then
69727e6dc69ae5d9b5ae3681723778a3faa354e9Lennart Poettering msg_fatal "Only root can install this product."
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering fi
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering if [ $FORCE = no ]; then
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering trap clean_up_and_abort HUP INT TERM
b568ef14a75dffb7182e0acbdec743b31df2a597Lennart Poettering else
0ad68f8743f3baaa7cd8ac7a2275459ae0f7b96aLennart Poettering trap clean_up_and_abort HUP INT TERM ERR
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering fi
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering
12179984a38fe74581333fbcdc11c822d81f505fLennart Poettering trap clean_up QUIT EXIT
0536ce5d0ceaf87f3e81faaff41d69ffeed2186fZbigniew Jędrzejewski-Szmek}
eb01ba5de14859d7a94835ab9299de40132d549aLennart Poettering
154ff088d371bee5651eaa2bc9bde8a34c185656Lennart Poetteringwrite_admin () {
154ff088d371bee5651eaa2bc9bde8a34c185656Lennart Poettering backup "$ADMIN"
154ff088d371bee5651eaa2bc9bde8a34c185656Lennart Poettering ADMIN_CREATED=yes
154ff088d371bee5651eaa2bc9bde8a34c185656Lennart Poettering cat > $ADMIN << EOF
69af45035913e7119cffd94c542bd3039600e45dZbigniew Jędrzejewski-Szmekmail=
e8a7a315391a6a07897122725cd707f4e9ce63d7Lennart Poetteringinstance=unique
461bd8e47cafacfcd38389e7558330bfb6e902adLennart Poetteringrunlevel=nocheck
461bd8e47cafacfcd38389e7558330bfb6e902adLennart Poetteringsetuid=nocheck
461bd8e47cafacfcd38389e7558330bfb6e902adLennart Poetteringaction=nocheck
ab8e074ce25b9947314c69e17afe1bd2527ee26dLennart Poetteringpartial=quit
ab8e074ce25b9947314c69e17afe1bd2527ee26dLennart Poetteringidepend=nocheck
ab8e074ce25b9947314c69e17afe1bd2527ee26dLennart Poetteringrdepend=nocheck
ab8e074ce25b9947314c69e17afe1bd2527ee26dLennart Poetteringspace=quit
b454b11220e87add6d0f011695c7912b009c853dLennart PoetteringEOF
b454b11220e87add6d0f011695c7912b009c853dLennart Poettering
4ff49cb63075aba646b578f2516b37a8dfd5a65bLennart Poettering if [ $IGNORE_CONFLICT = no ]; then
4ff49cb63075aba646b578f2516b37a8dfd5a65bLennart Poettering cat >> $ADMIN << EOF_2
fff87a35d9e26c0d4ea41273a963c0eb20e18da4Zbigniew Jędrzejewski-Szmekconflict=quit
fff87a35d9e26c0d4ea41273a963c0eb20e18da4Zbigniew Jędrzejewski-SzmekEOF_2
fff87a35d9e26c0d4ea41273a963c0eb20e18da4Zbigniew Jędrzejewski-Szmek else
b8b4d3dddc7611dce3bf28004b0375d661120c62Lennart Poettering cat >> $ADMIN << EOF_3
b5c03638d48c07aa0eaf13b5f54000c7133e1883Lennart Poetteringconflict=nocheck
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan EngelhardtEOF_3
b5c03638d48c07aa0eaf13b5f54000c7133e1883Lennart Poettering fi
b5c03638d48c07aa0eaf13b5f54000c7133e1883Lennart Poettering}
b5c03638d48c07aa0eaf13b5f54000c7133e1883Lennart Poettering
eece8c6fb5f4d354dcef6fd369e876c4f3a3f163Lennart Poetteringdeclare -a MOUNT_POINTS
eece8c6fb5f4d354dcef6fd369e876c4f3a3f163Lennart Poetteringdeclare -a MP_SUMS
eece8c6fb5f4d354dcef6fd369e876c4f3a3f163Lennart Poetteringdisk_usage_init () {
356ce9915ab1a4a1e6dc26954df34936a69e7c12Lennart Poettering mps=`df -kl | grep '^/' | awk '{print $6}' | sort -r`
356ce9915ab1a4a1e6dc26954df34936a69e7c12Lennart Poettering IFS="
09f727eebd87661f263d3c2c1e0de7b7771acd40Lennart Poettering"
09f727eebd87661f263d3c2c1e0de7b7771acd40Lennart Poettering typeset -i i=0
09f727eebd87661f263d3c2c1e0de7b7771acd40Lennart Poettering for mp in $mps; do
c144692179098c1861f2aeafc67689a74439cf4cLennart Poettering MOUNT_POINTS[$i]="$mp"
c144692179098c1861f2aeafc67689a74439cf4cLennart Poettering MP_SUMS[$i]=0
c144692179098c1861f2aeafc67689a74439cf4cLennart Poettering typeset i=$i+1
c144692179098c1861f2aeafc67689a74439cf4cLennart Poettering done
795607b22308f5b92073b012e43be1892fdd97c0Lennart Poettering MOUNT_POINT_COUNT=$i
0be8342c04bbf129b4a21e5073eacccbbce4e896Lennart Poettering}
0be8342c04bbf129b4a21e5073eacccbbce4e896Lennart Poettering
0be8342c04bbf129b4a21e5073eacccbbce4e896Lennart Poettering# disk_usage_add <dir> <size>
0be8342c04bbf129b4a21e5073eacccbbce4e896Lennart Poetteringdisk_usage_add () {
0be8342c04bbf129b4a21e5073eacccbbce4e896Lennart Poettering typeset -i i=0
e5ec62c56963d997edaffa904af5dc45dac23988Lennart Poettering while [ $i -lt $MOUNT_POINT_COUNT ]; do
54c31a79f72ff57ac8eba089acacc4ab482b745dLennart Poettering mpname=${MOUNT_POINTS[$i]}
826872b61e4857dfffe63ba84e2b005623baecd6Lennart Poettering case $1 in
826872b61e4857dfffe63ba84e2b005623baecd6Lennart Poettering ${mpname}* )
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt mpsize=${MP_SUMS[$i]}
826872b61e4857dfffe63ba84e2b005623baecd6Lennart Poettering mpsize=`expr $mpsize + $2`
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering MP_SUMS[$i]=$mpsize
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering break
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering ;;
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering esac
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering typeset i=$i+1
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering done
356ce9915ab1a4a1e6dc26954df34936a69e7c12Lennart Poettering}
490b7e47093d491a2bdb1084fe92b796f4e07eefLennart Poettering
81d112a8f0522a09fcfe317f420363a2b728137cLennart Poetteringdisk_usage_check () {
490b7e47093d491a2bdb1084fe92b796f4e07eefLennart Poettering typeset -i i=0
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering while [ $i -lt $MOUNT_POINT_COUNT ]; do
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering mpname=${MOUNT_POINTS[$i]}
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering mpsize=${MP_SUMS[$i]}
466784c8710e5cb0e0b86a16506d992d7ec5b619Kay Sievers mpsize=`expr $mpsize + $mpsize`
e41814846c19a48f4490169d82e359e005c4db45Lennart Poettering if [ $mpsize -gt 0 ]; then
c0fe5db522b52f27e030655ce2c03e05cbbc1558Kay Sievers check_disk_space $mpname $mpsize || \
e9fd44b728ff1fc0d1f24fccb87a767f6865df27Lennart Poettering msg_error "Your %s filesystem has less than %s kB free\nYou will not be able to install JDS." "$ROOTDIR$mpname" "$mpsize"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering fi
e9fd44b728ff1fc0d1f24fccb87a767f6865df27Lennart Poettering typeset i=$i+1
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering done
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering}
3040728b6691ea2e9df3a2060e2d49a792bbaedaLennart Poettering
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering#install_pkgs <dir>
8ed206517c2be381324ac5832bf34cc14024270eLennart Poetteringinstall_product () {
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering ORDERFILE=$MYDIR/$1/.pkgorder
e6c6e7afffa80ad74efdb1ddfa815294624f1608Lennart Poettering if [ -r $ORDERFILE ]; then
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering export IFS=' '
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering ALL_PKGS=$(echo $(cat $ORDERFILE | sed -e 's/$/.tar.gz/'))
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering else
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering ALL_PKGS=$(cd $MYDIR/$1; find . -name '*.tar.gz' -print -o -name '*.tgz' -print)
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering fi
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering
e5ec62c56963d997edaffa904af5dc45dac23988Lennart Poettering if [ -z "$ALL_PKGS" ]; then
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering msg_error "No packages found."
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering return
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering fi
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering msg_log "Starting installation of %s at %s" "$1" "`LANG=C LC_ALL=C date`"
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering IFS='
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering'
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering # Remove old Mozilla 1.x packages.
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering if [ $1 == 'firefox' -o $1 == 'thunderbird' ]; then
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering moz_pkgs="SUNWmozspell
279f036675536d55c901562b49f9df146af1a0e3Lennart PoetteringSUNWmozpsm
279f036675536d55c901562b49f9df146af1a0e3Lennart PoetteringSUNWmoznss-devel
279f036675536d55c901562b49f9df146af1a0e3Lennart PoetteringSUNWmoznss
279f036675536d55c901562b49f9df146af1a0e3Lennart PoetteringSUNWmoznspr-devel
279f036675536d55c901562b49f9df146af1a0e3Lennart PoetteringSUNWmozmail
279f036675536d55c901562b49f9df146af1a0e3Lennart PoetteringSUNWmozjs-debugger
279f036675536d55c901562b49f9df146af1a0e3Lennart PoetteringSUNWmozilla-devel
b568ef14a75dffb7182e0acbdec743b31df2a597Lennart PoetteringSUNWmozgm
e673ad0415d89c322e5b1a121e411f1b1d8075c0Lennart PoetteringSUNWmozdom-inspector
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart PoetteringSUNWmozchat
e673ad0415d89c322e5b1a121e411f1b1d8075c0Lennart PoetteringSUNWmozilla
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart PoetteringSUNWmoznspr
e673ad0415d89c322e5b1a121e411f1b1d8075c0Lennart PoetteringSUNWmoznav
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart PoetteringSUNWthunderbird-devel"
57f2a947270faf65e1876797b930e3f6d60ebd06Lennart Poettering for moz_pkg in $moz_pkgs; do
c06bf414042cd1bf94e0af63e9e2a0c291bfc546Kay Sievers is_installed "$moz_pkg" && remove_pkg "$moz_pkg"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering done
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering fi
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt # Remove evolution-socs-connect packages as they are incompatible with
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering # evolution-jescs (connector for Java Enterprise System Calendar Server)
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering if [ $1 == 'evolution' ]; then
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering evo_pkgs="SUNWevolution-socs-connect
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart PoetteringSUNWevolution-socs-connect-share"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering for evo_pkg in $evo_pkgs; do
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering is_installed "$evo_pkg" && remove_pkg "$evo_pkg"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering done
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering fi
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering
f47ec8ebb3858553dec870e1c596e39525f46360Lennart Poettering logrun mkdir -p $TEMPDIR || \
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering msg_fatal "ERROR: Failed to create temporary directory %s" "$TEMPDIR"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering cd $TEMPDIR
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering for pkg in $ALL_PKGS; do
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering if [ ! -r $MYDIR/$1/$pkg ]; then
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering msg_error "ERROR: cannot read file %s" "$pkg"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering continue
f47ec8ebb3858553dec870e1c596e39525f46360Lennart Poettering fi
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering logrun sh -c "gunzip -c $MYDIR/$1/$pkg | /bin/tar xf -"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering if [ $? != 0 ]; then
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering msg_error "ERROR: Failed to unpack %s" "$pkg"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering continue
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering fi
601d9d6fb394a780765e80581daab850623e9698Josh Triplett pkg0=$(basename $pkg)
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering pkg0=$(echo "$pkg0" | sed -e 's/\.tar.gz$//' -e 's/\.tgz$//')
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering if [ ! -d $pkg0 ]; then
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering msg_error "ERROR: Package %s not found in %s" "$pkg0" "$pkg"
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering continue
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering fi
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering if [ "x$QUIET" = xno ]; then
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering l10n_print "Installing package %s" "$pkg0"
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering fi
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering msg_log "Installing package $pkg0"
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt if [ "x$ROOTDIR" != "x" ]; then
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering logrun $PKGADD -R "$ROOTDIR" -a $ADMIN -n -d $TEMPDIR $pkg0 || \
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering msg_error "ERROR: Failed to install package %s" "$pkg0"
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering else
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering logrun $PKGADD -a $ADMIN -n -d $TEMPDIR $pkg0 || \
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering msg_error "ERROR: Failed to install package %s" "$pkg0"
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering fi
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering logrun rm -rf $TEMPDIR/$pkg0
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering done
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering}
279f036675536d55c901562b49f9df146af1a0e3Lennart Poettering
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poetteringremove_pkg () {
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering if [ "x$QUIET" = xno ]; then
8b8f259170e35b93e6c6d1757cb8b835bbdaa40cZbigniew Jędrzejewski-Szmek l10n_print "Uninstalling %s" "$1"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering fi
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering msg_log "Uninstalling %s" "$1"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering if [ "x$ROOTDIR" != x ]; then
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering logrun $PKGRM -R "$ROOTDIR" -a $ADMIN -n "$1"'.*' || \
eb124a97fb72d076014253b1acde69d428f15ecfLennart Poettering msg_error "ERROR: Failed to remove package %s" "$1"
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering else
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering logrun $PKGRM -a $ADMIN -n "$1"'.*' || \
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering msg_error "ERROR: Failed to remove package %s" "$1"
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering fi
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering}
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poetteringis_installed () {
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering $PKGINFO -q "$1.*"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering}
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poetteringremove_always () {
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering pkgs_to_remove="`cat $MYDIR/$1/.remove-always`"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering IFS="
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering for glob in "$pkgs_to_remove"; do
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering pkgs=$(cd $MYDIR/$1; echo $glob)
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt for pkg in $pkgs; do
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering pkg=`basename $pkg`
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering pkg=`basename $pkg .tar.gz`
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering pkg=`basename $pkg .tgz`
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering is_installed "$pkg" && remove_pkg "$pkg"
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering done
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering done
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering}
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poetteringremove_if_older () {
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering pkgs_to_remove="`cat $MYDIR/$1/.remove-if-older`"
8b04b925e587ff56568c62ff5ad3f2ea2b34ca7aLennart Poettering
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering IFS="
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering for glob in $pkgs_to_remove; do
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering pkgs=$(cd $MYDIR/$1; echo "$glob")
eb124a97fb72d076014253b1acde69d428f15ecfLennart Poettering for pkg in $pkgs; do
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering pkg=`basename $pkg .tar.gz`
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt pkg=`basename $pkg .tgz`
90e071d1d59be05fcba66561439c3ca67c80ee20Lennart Poettering remove_pkg $pkg
d2e83c23f5f0cdd3b6ec05c5c40209708721e704Kay Sievers done
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering done
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering}
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poettering
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poetteringmain_menu () {
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poettering while /bin/true; do
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt clear
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poettering echo ",--------------------------------------------------------------------------"
603cd8fe07cb03e8b11722d1a732e569e5a46347Lennart Poettering echo "| 1) " `l10n_print "Default Installation"`
a7a3f28be404875eff20443a0fa8088bcc4c18dfLennart Poettering echo "| 2) " `l10n_print "Custom Installation"`
a7a3f28be404875eff20443a0fa8088bcc4c18dfLennart Poettering echo "|"
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering echo "| X) " `l10n_print "Exit"`
08f9588885c5d65694b324846b0ed19211d2c178Lennart Poettering echo "|"
9ee58bddeb6eb044753167e0047fe836479ca5dbKay Sievers ask '`---> '"`l10n_print 'Please select:'`" "menu_sel" "1"
9ee58bddeb6eb044753167e0047fe836479ca5dbKay Sievers case $menu_sel in
dcfc4b2e5c1af6375488c00bdc6fb8122f86c4d7Lennart Poettering 1)
71ef24d09573874c0f7bc323c07c3aec2a458707Lennart Poettering if [ "x$PRODUCTS" = x ]; then
71ef24d09573874c0f7bc323c07c3aec2a458707Lennart Poettering select_all_products
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt unselect_all_srcs
1b89884ba31cbe98f159ce2c7d6fac5f6a57698fLennart Poettering unselect_product nodist
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering fi
9cb74bcb23dde8488459ca233bf9caee642b8402Zbigniew Jędrzejewski-Szmek do_install || return $?
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering break
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering ;;
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering 2)
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering custom_menu || return $?
b44be3ecf6326c27aa2c6c6d1fe34e22e22592a0Lennart Poettering ;;
5f1dac6bf605871615b35891a3966fa474db5b20Lennart Poettering x|X)
f801968466fed39d50d410b30ac828c26722cc95Lennart Poettering return 2
424a19f8a2061c6b058283228734010b2fa24db4Lennart Poettering ;;
41f9172f427bdbb8221c64029f78364b8dd4e527Lennart Poettering *)
424a19f8a2061c6b058283228734010b2fa24db4Lennart Poettering l10n_print "Invalid selection"
424a19f8a2061c6b058283228734010b2fa24db4Lennart Poettering sleep 1
424a19f8a2061c6b058283228734010b2fa24db4Lennart Poettering esac
a1cccad1fe88ddd6943e18af97cf7f466296970fLennart Poettering done
8556879e0d14925ce897875c6c264368e2d048c2Lennart Poettering return 0
4a30847b9d71e0381948d68279c8f775b9de7850Lennart Poettering}
4a30847b9d71e0381948d68279c8f775b9de7850Lennart Poettering
5e8b28838e493b59628322b69580097ef7dd9384Lennart Poetteringcustom_menu () {
5e8b28838e493b59628322b69580097ef7dd9384Lennart Poettering while /bin/true; do
38a60d7112d33ffd596b23e8df53d75a7c09e71bLennart Poettering clear
38a60d7112d33ffd596b23e8df53d75a7c09e71bLennart Poettering echo ",--------------------------------------------------------------------------"
68f160039eb78fe122cfe0d4c49695ae91f6f0d1Lennart Poettering echo "| 1) " `l10n_print "Install All Products"`
0790b9fed42eefc4e22dbbe2337cba9713b7848cLennart Poettering echo "| 2) " `l10n_print "Select Products to Install"`
68f160039eb78fe122cfe0d4c49695ae91f6f0d1Lennart Poettering if [ ! -z "$PATCHDIRS" ]; then
68f160039eb78fe122cfe0d4c49695ae91f6f0d1Lennart Poettering echo "| 3) " `l10n_print "Select Patches to Install"`
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt fi
68f160039eb78fe122cfe0d4c49695ae91f6f0d1Lennart Poettering echo "|"
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt echo "| I) " `l10n_print "Start Installation"`
68f160039eb78fe122cfe0d4c49695ae91f6f0d1Lennart Poettering echo "| X) " `l10n_print "Exit"`
0790b9fed42eefc4e22dbbe2337cba9713b7848cLennart Poettering echo "|"
fd4d89b2c0b31da01d134301e30916931ae3c7d9Lennart Poettering ask '`---> '"`l10n_print 'Please select:'`" "menu_sel" "I"
fd4d89b2c0b31da01d134301e30916931ae3c7d9Lennart Poettering case $menu_sel in
47ae7201b1df43bd3da83a19e38483b0e5694c99Lennart Poettering 1)
47ae7201b1df43bd3da83a19e38483b0e5694c99Lennart Poettering select_all_products
88a6c5894c9d3f85d63b87b040c130366b4006ceKay Sievers unselect_all_srcs
8351ceaea9480d9c2979aa2ff0f4982cfdfef58dLennart Poettering unselect_product nodist
9946996cda11a18b44d82344676e5a0e96339408Lennart Poettering select_all_patches
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt do_install || return $?
9946996cda11a18b44d82344676e5a0e96339408Lennart Poettering return 1
3471bedc005fab03f40b99bf6599645330adcd9eLennart Poettering ;;
3471bedc005fab03f40b99bf6599645330adcd9eLennart Poettering 2)
59cea26a349cfa8db906b520dac72563dd773ff2Lennart Poettering select_product_menu || return $?
35eb6b124ebdf82bd77aad6e44962a9a039c4d33Lennart Poettering ;;
5b40d33761376354116a8cddb9b9fbdb6c4727d6Lennart Poettering 3)
5b40d33761376354116a8cddb9b9fbdb6c4727d6Lennart Poettering if [ ! -z "$PATCHDIRS" ]; then
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers select_patchdir_menu || return $?
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers else
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers l10n_print "Invalid selection"
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers sleep 1
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers fi
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers ;;
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers i|I)
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers do_install || return $?
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers return 1
d3a3f22267a7dac426b07a7ed0baa1632f5daf04Kay Sievers ;;
465349c06d994dd2cc6b6fc4109ac0b9952d500aLennart Poettering x|X)
e01a15b71e18bf2008aec7e75041ffa42eb80b80Kay Sievers return 2
a888b352eb53b07daa24fa859ceeb254336b293dLennart Poettering ;;
abd55b16547d0bb0ed1c31e72e16838f0f59f48bKay Sievers *)
abd55b16547d0bb0ed1c31e72e16838f0f59f48bKay Sievers l10n_print "Invalid selection"
abd55b16547d0bb0ed1c31e72e16838f0f59f48bKay Sievers sleep 1
abd55b16547d0bb0ed1c31e72e16838f0f59f48bKay Sievers esac
e8d842a0d0b39f298e1e7f70d29759e50b2b16d4Tom Gundersen done
b8217b7bd5fd171916a095b150fad4c3a37f5a41Kay Sievers return 0
169c4f65131fbc7bcb51e7d5487a715cdcd0e0ebLennart Poettering}
169c4f65131fbc7bcb51e7d5487a715cdcd0e0ebLennart Poettering
fb0864e7b9c6d26269ccea6ec5c0fd921c029781Lennart Poetteringso_menu () {
fb0864e7b9c6d26269ccea6ec5c0fd921c029781Lennart Poettering while /bin/true; do
7f110ff9b8828b477e87de7b28c708cf69a3d008Lennart Poettering clear
7f110ff9b8828b477e87de7b28c708cf69a3d008Lennart Poettering echo ",--------------------------------------------------------------------------"
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering echo "| 1) StarOffice"
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering echo "| 2) StarSuite"
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering echo "|"
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering echo "| X) " `l10n_print "Exit"`
87a8baa35d6d65ac3b58ae8e26e338e67f8ae8edLennart Poettering echo "|"
87a8baa35d6d65ac3b58ae8e26e338e67f8ae8edLennart Poettering ask '`---> '"`l10n_print 'Please select:'`" "menu_sel" "1"
87a8baa35d6d65ac3b58ae8e26e338e67f8ae8edLennart Poettering case $menu_sel in
87a8baa35d6d65ac3b58ae8e26e338e67f8ae8edLennart Poettering 1)
70a44afee385c4afadaab9a002b3f9dd44aedf4aJan Engelhardt unselect_product starsuite
65c0cf7108ae3537a357c74b4586a783baba82f9Lennart Poettering return 0
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers ;;
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers 2)
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers unselect_product staroffice
ad740100d108282d0244d5739d4dcc86fe4c5fdeLennart Poettering return 0
ad740100d108282d0244d5739d4dcc86fe4c5fdeLennart Poettering ;;
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering x|X)
f38afcd0c7f558ca5bf0854b42f8c6954f8ad7f3Lennart Poettering return 2
7d441ddb5ca090b5a97f58ac4b4d97b3e84fa81eLennart Poettering ;;
d28315e4aff91560ed4c2fc9f876ec8bfc559f2dJan Engelhardt *)
14e639ae7a1dbf156273ce697d30fbc6c6594209Lennart Poettering l10n_print "Invalid selection"
7f8aa67131cfc03ddcbd31c0420754864fc122f0Lennart Poettering sleep 1
ff01d048b4c1455241c894cf7982662c9d28fd34Lennart Poettering esac
d3c7d7dd77b2b72315164b672462825cef6c0f9aKay Sievers done
72b9ed828bd22f3ddd74b6853c183eebf006d6d8Lennart Poettering return 0
1d6702e8d3877c0bebf3ac817dc45ff72f5ecfa9Lennart Poettering}
1d6702e8d3877c0bebf3ac817dc45ff72f5ecfa9Lennart Poettering
1d6702e8d3877c0bebf3ac817dc45ff72f5ecfa9Lennart Poetteringselect_patchdir_menu () {
71092d70af35567dd154d3de2ce04ce62e157a7cLennart Poettering IFS=,
71092d70af35567dd154d3de2ce04ce62e157a7cLennart Poettering while /bin/true; do
1258097cd3cdbc5dd3d264850119e553a29c5068Lennart Poettering clear
1258097cd3cdbc5dd3d264850119e553a29c5068Lennart Poettering echo ",--------------------------------------------------------------------------"
1258097cd3cdbc5dd3d264850119e553a29c5068Lennart Poettering typeset -i N=1
a4c279f87451186b8beb1b8cc21c7cad561ecf4bLennart Poettering
a4c279f87451186b8beb1b8cc21c7cad561ecf4bLennart Poettering for pdir in $PATCHDIRS; do
55cdcbacf70f05a40a155af24f6d2da6b478cba6Lennart Poettering pname=`echo "$ALL_PATCHDIRS" | grep "^$pdir=" | cut -f2- -d= | cut -c-60`
8d0e38a2b966799af884e78a54fd6a2dffa44788Lennart Poettering n=`echo " $N" | sed -e 's/^.*\(..\)$/\1/'`
f28f1daf754a9a07de90e6fc4ada581bf5de677dLennart Poettering pn=$(echo $pdir | cut -f2 -d-)
f28f1daf754a9a07de90e6fc4ada581bf5de677dLennart Poettering eval "plist=\"\$ALL_${pn}_PATCHES\""
f28f1daf754a9a07de90e6fc4ada581bf5de677dLennart Poettering eval "patch_${N}_list=\"$plist\""
f28f1daf754a9a07de90e6fc4ada581bf5de677dLennart Poettering patches_are_selected "$plist"
88a07670cfa974a605c7c7b520b8a3135fce37f9Lennart Poettering res=$?
88a07670cfa974a605c7c7b520b8a3135fce37f9Lennart Poettering if [ $res = 0 ]; then
88a07670cfa974a605c7c7b520b8a3135fce37f9Lennart Poettering echo "| $n) [x] $pname"
71092d70af35567dd154d3de2ce04ce62e157a7cLennart Poettering eval "patch_${N}_selected=1"
916abb21d0a6653e0187b91591e492026886b0a4Lennart Poettering elif [ $res = 1 ]; then
9534ce54858c67363b841cdbdc315140437bfdb4Lennart Poettering echo "| $n) [:] $pname"
9534ce54858c67363b841cdbdc315140437bfdb4Lennart Poettering eval "patch_${N}_selected=0"
68c7d001f4117f0c3d0a4582e32cbb03ae5fac57Lennart Poettering else
796b06c21b62d13c9021e2fbd9c58a5c6edb2764Kay Sievers echo "| $n) [ ] $pname"
68c7d001f4117f0c3d0a4582e32cbb03ae5fac57Lennart Poettering eval "patch_${N}_selected=0"
68c7d001f4117f0c3d0a4582e32cbb03ae5fac57Lennart Poettering fi
7a2a0b907b5cc60f5d9a871997d7d6e7f62bf4d8Lennart Poettering typeset N=$N+1
253ee27a0c7a410d27d490bb79ea97caed6a2b68Lennart Poettering done
5d0fcd7c8d29340ac9425c309e8ac436a9af699cLennart Poettering echo "|"
8bbabc447b1d913bd21faf97c7b17d20d315d2b4Lennart Poettering echo "| A) " `l10n_print "Select All"`
f530371f1f85a070d7d0fb5112146a43533ae00bLennart Poettering echo "| U) " `l10n_print "Unselect All"`
e707c49485b8f4f2ec040d3da232d39153e650b9Lennart Poettering echo "|"
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering echo "| S) " `l10n_print "Select individual patches"`
a73d88fa024b5668ed7dde681e99547d41e6a864Lennart Poettering echo "| I) " `l10n_print "Start Installation"`
a74a8793b04de9886b4f6987b9cb86fa02c73520Lennart Poettering echo "| R) " `l10n_print "Return to previous menu"`
3040728b6691ea2e9df3a2060e2d49a792bbaedaLennart Poettering echo "| X) " `l10n_print "Exit"`
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering echo "|"
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering ask '`---> '"`l10n_print 'Enter item to select/unselect:'`" "menu_sel" "R"
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering case $menu_sel in
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering i|I)
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering do_install || return $?
73090dc815390f4fca4e3ed8a7e1d3806605daaaLennart Poettering return 1
44143309dd0b37d61d7d842ca58f01a65646ec71Kay Sievers ;;
3d57c6ab801f4437f12948e29589e3d00c3ad9dbLennart Poettering x|X)
260abb780a135e4cae8c10715c7e85675efc345aLennart Poettering return 2
2791a8f8dc8764a9247cdba3562bd4c04010f144Lennart Poettering ;;
a8f11321c209830a35edd0357e8def5d4437d854Lennart Poettering r|R)
a8f11321c209830a35edd0357e8def5d4437d854Lennart Poettering return 0
21bdae12e11ae20460715475d8a0c991f15464acLennart Poettering ;;
21bdae12e11ae20460715475d8a0c991f15464acLennart Poettering a|A)
Error!

 

There was an error!

null

java.lang.NullPointerException