Changes between Version 6 and Version 7 of howto/AdvancedDailyAdm


Ignore:
Timestamp:
May 22, 2021, 4:01:36 PM (4 years ago)
Author:
BjarneDMat
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/AdvancedDailyAdm

    v6 v7  
    1919{{{
    2020declare prefix='/opt/local'
    21 declare version=$( curl --url 'https://raw.githubusercontent.com/macports/macports-base/master/config/RELEASE_URL' )
     21declare version=$( curl -fs --url 'https://raw.githubusercontent.com/macports/macports-base/master/config/RELEASE_URL' )
    2222version=${version##*/v}
    2323}}}
     
    5555usage() {
    5656cat <<EOT
    57 purpose : to automate the whole install process
     57
     58purpose : to automate the whole MacPorts install & update process
    5859\${1} : action                 [ update (default) , install , setpaths , checkpaths , select , fixCLT ]
    5960\${2} : macports base version  ( default ${version} ) only for install
     61
     62!!! the script has to be run with root privileges !!!
     63
    6064EOT
    6165}
     
    6367declare action=${1:-"update"}
    6468[ ! -z ${2} ] && declare version=${2}
     69
     70case ${action} in
     71('-h'|'--help')
     72usage
     73exit
     74esac
     75
     76if [[ ${EUID} -ne 0 ]]
     77then
     78cat <<EOT
     79
     80+------------------------------------------------+
     81| this script has to be run with root privileges I
     82+------------------------------------------------+
     83please try again with "sudo ${0}"
     84
     85EOT
     86usage
     87exit
     88fi
    6589
    6690case ${action} in
     
    132156if [ ! -e MacPorts-${version}.tar.gz ]
    133157then
    134     #https://github.com/macports/macports-base/releases/download/v2.7.0/MacPorts-2.7.0.tar.gz
    135158    curl -L -O --url "https://github.com/macports/macports-base/releases/download/v${version}/MacPorts-${version}.tar.gz"
    136159fi
    137160
    138161rm  -rf  ./MacPorts-${version}
    139 tar -zxf   MacPorts-${version}.tar.gz 2>/dev/null \
    140 || { echo "error expanding MacPorts-${version}.tar.gz" ; exit }
     162tar -zxf   MacPorts-${version}.tar.gz 2>/dev/null
    141163
    142164cd MacPorts-${version}
    143 #patch -p0 </Volumes/Bjarne/WebServer/MacPorts/newPorts/pathces/mp-base-no-progress-if-stdout-no-tty.patch
    144 #./configure LDFLAGS=-L/Developer/SDKs/MacOSX10.6.sdk/usr/X11/lib --prefix=${prefix}
    145165CC=/usr/bin/cc ./configure \
    146166     --prefix=/opt/local \
     
    150170     --enable-readline \
    151171&& make SELFUPDATING=1 \
    152 && make install SELFUPDATING=1 \
    153 || { echo "error compiling MacPorts-${version}" ; exit }
     172&& make install SELFUPDATING=1
    154173
    155174# update MacPorts itself
     
    177196
    178197{{{
    179 #!/macports/bin/bash
     198#!/usr/bin/env bash
    180199
    181200#
     
    190209echo        '+----------------+'
    191210
    192 declare installPath=${1:-'/macports'}
     211declare installPath=${1:-'/opt/local'}
    193212declare rsyncMacportsOrg='/var/macports/sources/rsync.macports.org/release/ports'
    194213
     
    236255
    237256{{{
    238 #!/macports/bin/bash
    239 
    240 declare prefix=${2:-"/macports"}
     257#!/usr/bin/env bash
     258
     259source ./portDefaults
    241260
    242261(   cd  $( dirname ${0} )
     
    256275
    257276{{{
    258 #!/macports/bin/bash
    259 
    260 declare prefix=${1:-"/macports"}
    261 declare rsyncMacportsOrg="/var/macports/sources/rsync.macports.org/release/ports"
     277#!/usr/bin/env bash
     278
     279source ./portDefaults
     280source ./defaultPaths
    262281
    263282(   cd $( dirname ${0} )