[MacPorts] howto/AdvancedDailyAdm modified
MacPorts Wiki
noreply at macports.org
Sat May 22 16:01:36 UTC 2021
Page "howto/AdvancedDailyAdm" was changed by BjarneDMat
Diff URL: <https://trac.macports.org/wiki/howto/AdvancedDailyAdm?action=diff&version=7>
Revision 7
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: howto/AdvancedDailyAdm
=========================================================================
--- howto/AdvancedDailyAdm (version: 6)
+++ howto/AdvancedDailyAdm (version: 7)
@@ -18,7 +18,7 @@
=== Script 0: '''Default Values''' ===
{{{
declare prefix='/opt/local'
-declare version=$( curl --url 'https://raw.githubusercontent.com/macports/macports-base/master/config/RELEASE_URL' )
+declare version=$( curl -fs --url 'https://raw.githubusercontent.com/macports/macports-base/master/config/RELEASE_URL' )
version=${version##*/v}
}}}
@@ -54,14 +54,38 @@
usage() {
cat <<EOT
-purpose : to automate the whole install process
+
+purpose : to automate the whole MacPorts install & update process
\${1} : action [ update (default) , install , setpaths , checkpaths , select , fixCLT ]
\${2} : macports base version ( default ${version} ) only for install
+
+!!! the script has to be run with root privileges !!!
+
EOT
}
declare action=${1:-"update"}
[ ! -z ${2} ] && declare version=${2}
+
+case ${action} in
+('-h'|'--help')
+usage
+exit
+esac
+
+if [[ ${EUID} -ne 0 ]]
+then
+cat <<EOT
+
++------------------------------------------------+
+| this script has to be run with root privileges I
++------------------------------------------------+
+please try again with "sudo ${0}"
+
+EOT
+usage
+exit
+fi
case ${action} in
@@ -131,17 +155,13 @@
if [ ! -e MacPorts-${version}.tar.gz ]
then
- #https://github.com/macports/macports-base/releases/download/v2.7.0/MacPorts-2.7.0.tar.gz
curl -L -O --url "https://github.com/macports/macports-base/releases/download/v${version}/MacPorts-${version}.tar.gz"
fi
rm -rf ./MacPorts-${version}
-tar -zxf MacPorts-${version}.tar.gz 2>/dev/null \
-|| { echo "error expanding MacPorts-${version}.tar.gz" ; exit }
+tar -zxf MacPorts-${version}.tar.gz 2>/dev/null
cd MacPorts-${version}
-#patch -p0 </Volumes/Bjarne/WebServer/MacPorts/newPorts/pathces/mp-base-no-progress-if-stdout-no-tty.patch
-#./configure LDFLAGS=-L/Developer/SDKs/MacOSX10.6.sdk/usr/X11/lib --prefix=${prefix}
CC=/usr/bin/cc ./configure \
--prefix=/opt/local \
--with-install-user=root \
@@ -149,8 +169,7 @@
--with-directory-mode=0755 \
--enable-readline \
&& make SELFUPDATING=1 \
-&& make install SELFUPDATING=1 \
-|| { echo "error compiling MacPorts-${version}" ; exit }
+&& make install SELFUPDATING=1
# update MacPorts itself
${prefix}/bin/port -dN selfupdate
@@ -176,7 +195,7 @@
=== Script 2: '''Updating''' ===
{{{
-#!/macports/bin/bash
+#!/usr/bin/env bash
#
# usage:
@@ -189,7 +208,7 @@
echo '| macportsupdate |'
echo '+----------------+'
-declare installPath=${1:-'/macports'}
+declare installPath=${1:-'/opt/local'}
declare rsyncMacportsOrg='/var/macports/sources/rsync.macports.org/release/ports'
echo "selfupdating & syncing all repositories"
@@ -235,9 +254,9 @@
=== Script 3: '''Copying a Port''' ===
{{{
-#!/macports/bin/bash
-
-declare prefix=${2:-"/macports"}
+#!/usr/bin/env bash
+
+source ./portDefaults
( cd $( dirname ${0} )
@@ -255,10 +274,10 @@
=== Script 4: '''Creating a Patch for a Port''' ===
{{{
-#!/macports/bin/bash
-
-declare prefix=${1:-"/macports"}
-declare rsyncMacportsOrg="/var/macports/sources/rsync.macports.org/release/ports"
+#!/usr/bin/env bash
+
+source ./portDefaults
+source ./defaultPaths
( cd $( dirname ${0} )
-------8<------8<------8<------8<------8<------8<------8<------8<--------
--
Page URL: <https://trac.macports.org/wiki/howto/AdvancedDailyAdm>
MacPorts <https://www.macports.org/>
Ports system for macOS
This is an automated message. Someone added your email address to be
notified of changes on 'howto/AdvancedDailyAdm' page.
If it was not you, please report to admin at macports.org.
More information about the macports-changes
mailing list