[98238] users/pixilla/scripts
pixilla at macports.org
pixilla at macports.org
Sun Sep 30 08:41:11 PDT 2012
Revision: 98238
http://trac.macports.org//changeset/98238
Author: pixilla at macports.org
Date: 2012-09-30 08:41:11 -0700 (Sun, 30 Sep 2012)
Log Message:
-----------
pixilla/scripts:
- Add/Update mp scripts.
Modified Paths:
--------------
users/pixilla/scripts/mp-shared-objects
users/pixilla/scripts/mp-svn-propedit
Added Paths:
-----------
users/pixilla/scripts/mp-distributable
users/pixilla/scripts/mp-grid-port-rdeps
users/pixilla/scripts/mp-make-patches
users/pixilla/scripts/mp-sqlite-registry
users/pixilla/scripts/mp-sqlite-registry.init
users/pixilla/scripts/mp-svn-st-port
users/pixilla/scripts/mp-svn-tree-setup
users/pixilla/scripts/mp-svn-up-dports
users/pixilla/scripts/mp-svn-up-trunk
users/pixilla/scripts/mp-trac-table-port
users/pixilla/scripts/mp-upgrade-base
users/pixilla/scripts/mp-upgrade-trunk
users/pixilla/scripts/mp-upgrade-trunk-all
Removed Paths:
-------------
users/pixilla/scripts/mp-trac-user-ports
Added: users/pixilla/scripts/mp-distributable
===================================================================
--- users/pixilla/scripts/mp-distributable (rev 0)
+++ users/pixilla/scripts/mp-distributable 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,9 @@
+#!/bin/bash
+# mp-distributable
+if [[ $# -eq 0 || $1 == "help" ]]
+then
+ echo "Usage example:"
+ echo "mp-distributable libz"
+ exit 1
+fi
+/opt/local/var/macports/sources/svn.macports.org/trunk/base/portmgr/jobs/port_binary_distributable.tcl -v "$@"
Property changes on: users/pixilla/scripts/mp-distributable
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-grid-port-rdeps
===================================================================
--- users/pixilla/scripts/mp-grid-port-rdeps (rev 0)
+++ users/pixilla/scripts/mp-grid-port-rdeps 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,13 @@
+#!/bin/bash
+# mp-grid-port-rdeps
+if [[ $# -eq 0 || $1 == "help" ]]
+then
+ echo "mp-grid-port-rdeps <stdin> # port -q rdeps $@"
+ echo "Usage example:"
+ echo "mp-grid-port-rdeps zlib"
+ echo "mp-grid-port-rdeps dependentof:zlib"
+ exit 1
+fi
+
+port -q rdeps $@ | sed -e '/^-/d' -e 's/ /\|\|/g' -e 's/^\|\|/ /g' -e 's/\|\|/\| /g' &&
+exit 0
Property changes on: users/pixilla/scripts/mp-grid-port-rdeps
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-make-patches
===================================================================
--- users/pixilla/scripts/mp-make-patches (rev 0)
+++ users/pixilla/scripts/mp-make-patches 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,46 @@
+#!/bin/sh
+# mp-make-patches
+if [[ $# -eq 0 || $1 == "help" ]]
+then
+ echo "Usage example:"
+ echo "cd $(port dir bash-completion)"
+ echo "sudo port extract"
+ echo "sudo cp -R ./work/$(port info --version bash-completion | sed -e 's,version: ,bash-completion-,') ./a"
+ echo "sudo cp -R ./a ./b"
+ echo "# Edit files in b"
+ echo "sudo bash -c 'echo 1234 > b/newfile'"
+ echo "mkdir ./files"
+ echo "mp-make-patches a b"
+ echo "# Example mp-make-patches stdout:"
+ echo "patch.pre_args -p1"
+ echo "patchfiles patch-newfile.diff"
+ echo "# Copy mp-make-patches stdout and paste into Portfile"
+ exit 1
+fi
+PROCESSED_FILES=0
+CHANGED_FILES=$(diff -Nqur -x "\.*" $1 $2 | awk '{print $2}' | sed "s;$1/;;" | sed 's/\([^ ]+\)/\1 /g')
+CHANGED_FILES=($CHANGED_FILES)
+COUNTER=0
+if [ ${#CHANGED_FILES[@]} -gt 0 ]
+then
+ echo "patch.pre_args -p1"
+ while [ $COUNTER -lt ${#CHANGED_FILES[@]} ]
+ do
+ DIFF_NAME=$(echo ${CHANGED_FILES[$COUNTER]} | sed 's;/;-;g')
+ diff -Nu {$1,$2}/${CHANGED_FILES[$COUNTER]} > files/patch-$DIFF_NAME.diff
+ let COUNTER=COUNTER+1
+ if [ $COUNTER -eq ${#CHANGED_FILES[@]} ]
+ then
+ EOL=""
+ else
+ EOL=" \\"
+ fi
+ if [ $COUNTER -eq 1 ]
+ then
+ echo "patchfiles patch-${DIFF_NAME}.diff${EOL}"
+ else
+ echo " patch-${DIFF_NAME}.diff${EOL}"
+ fi
+ done
+fi
+exit 0
Property changes on: users/pixilla/scripts/mp-make-patches
___________________________________________________________________
Added: svn:executable
+ *
Modified: users/pixilla/scripts/mp-shared-objects
===================================================================
--- users/pixilla/scripts/mp-shared-objects 2012-09-30 14:19:03 UTC (rev 98237)
+++ users/pixilla/scripts/mp-shared-objects 2012-09-30 15:41:11 UTC (rev 98238)
@@ -1,4 +1,7 @@
#!/bin/bash
+# mp-shared-objects
+# Print path of linked objects and optionally test for their existence on disk.
+
# Argument = [-q] <path name>
eError="error: no such path"
Added: users/pixilla/scripts/mp-sqlite-registry
===================================================================
--- users/pixilla/scripts/mp-sqlite-registry (rev 0)
+++ users/pixilla/scripts/mp-sqlite-registry 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# mp-sqlite-registry
+EXECPATH=$(dirname $0)
+sqlite3 --init ${EXECPATH}/mp-sqlite-registry.init /opt/local/var/macports/registry/registry.db "$@" 2>&1 | tail +3
Property changes on: users/pixilla/scripts/mp-sqlite-registry
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-sqlite-registry.init
===================================================================
--- users/pixilla/scripts/mp-sqlite-registry.init (rev 0)
+++ users/pixilla/scripts/mp-sqlite-registry.init 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1 @@
+.load /opt/local/share/macports/sqlite/macports.sqlext
\ No newline at end of file
Modified: users/pixilla/scripts/mp-svn-propedit
===================================================================
--- users/pixilla/scripts/mp-svn-propedit 2012-09-30 14:19:03 UTC (rev 98237)
+++ users/pixilla/scripts/mp-svn-propedit 2012-09-30 15:41:11 UTC (rev 98238)
@@ -1,4 +1,7 @@
#!/bin/bash
+# mp-svn-propedit
+# Edit svn commit messages.
+
# Argument = [-q] <path name>
usage()
Added: users/pixilla/scripts/mp-svn-st-port
===================================================================
--- users/pixilla/scripts/mp-svn-st-port (rev 0)
+++ users/pixilla/scripts/mp-svn-st-port 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,11 @@
+#!/bin/sh
+# mp-svn-st-port
+# Get svn st for "port dir <stdin>"
+CMD="port dir $@"
+#echo $CMD
+#exit
+#$CMD
+#exit
+for dir in $($CMD); do \
+ svn st ${dir}
+done
Property changes on: users/pixilla/scripts/mp-svn-st-port
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-svn-tree-setup
===================================================================
--- users/pixilla/scripts/mp-svn-tree-setup (rev 0)
+++ users/pixilla/scripts/mp-svn-tree-setup 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,82 @@
+#!/bin/bash
+# mp-svn-tree-setup
+
+# set date for file names
+DATE=$(date +%Y%m%d%H%M$S)
+
+# set MacPorts prefix if not in env
+[[ -z $MP_PREFIX ]] && MP_PREFIX=/opt/local
+
+# set local svn directory if not in env
+[[ -z $MP_SVNDIR ]] && MP_SVNDIR=$MP_PREFIX/var/macports/sources/svn.macports.org
+
+# set svn repo to get if not in env
+# If you want to build base set MP_SVNREPO to trunk (base, doc, doc-new, dports and www).
+[[ -z $MP_SVNREPO ]] && MP_SVNREPO=trunk/dports
+
+# temp sources.conf file if not in env
+[[ -z $MP_SRCCONFTEMP ]] && MP_SRCCONFTEMP=/tmp/sources.conf.$DATE
+
+if [ "x$1" = "xgo" ]; then
+
+ # create and cd to repository directory
+ sudo mkdir -p $MP_SVNDIR
+ sudo chown -R $(whoami) $MP_SVNDIR
+ cd $MP_SVNDIR
+ # checkout macports trunk
+ svn co https://svn.macports.org/repository/macports/$MP_SVNREPO $MP_SVNREPO
+ # create port index files
+ cd trunk/dports
+ portindex
+ # sources.conf: comment out rsync directories and save to $MP_SRCCONFTEMP
+ sudo sed 's;^rsync://rsync.macports.org;#rsync://rsync.macports.org;g' $MP_PREFIX/etc/macports/sources.conf > $MP_SRCCONFTEMP
+ # sources.conf: add svn dports to end of $MP_SRCCONFTEMP
+ echo "file://$MP_SVNDIR/trunk/dports [default]" >> $MP_SRCCONFTEMP
+ # sources.conf: move current sources.conf out of the way and move $MP_SRCCONFTEMP in place
+ sudo mv $MP_PREFIX/etc/macports/{sources.conf,sources.conf.$DATE}
+ sudo mv $MP_SRCCONFTEMP $MP_PREFIX/etc/macports/sources.conf
+elif [ "x$1" = "xshow" ]; then
+
+ cat <<EOF
+
+# create and cd to repository directory
+sudo mkdir -p $MP_SVNDIR
+sudo chown -R $(whoami) $MP_SVNDIR
+cd $MP_SVNDIR
+# checkout macports trunk
+svn co https://svn.macports.org/repository/macports/$MP_SVNREPO $MP_SVNREPO
+# create port index files
+cd trunk/dports
+portindex
+# sources.conf: comment out rsync directories and save to $MP_SRCCONFTEMP
+sudo sed 's;^rsync://rsync.macports.org;#rsync://rsync.macports.org;g' $MP_PREFIX/etc/macports/sources.conf > $MP_SRCCONFTEMP
+# sources.conf: add svn dports to end of $MP_SRCCONFTEMP
+echo "file://$MP_SVNDIR/trunk/dports [default]" >> $MP_SRCCONFTEMP
+# sources.conf: move current sources.conf out of the way and move $MP_SRCCONFTEMP in place
+sudo mv $MP_PREFIX/etc/macports/{sources.conf,sources.conf.$DATE}
+sudo mv $MP_SRCCONFTEMP $MP_PREFIX/etc/macports/sources.conf
+
+EOF
+
+else
+
+ echo ""
+ echo "# You can set these env vars to control this script"
+ echo "MP_PREFIX=$MP_PREFIX"
+ echo "MP_SVNDIR=$MP_SVNDIR"
+ echo "MP_SVNREPO=$MP_SVNREPO"
+ echo "MP_SRCCONFTEMP=$MP_SRCCONFTEMP"
+ echo ""
+ echo "# You can change these vars like so:"
+ echo "MP_PREFIX=/opt/macports-test $(basename ${0}) go"
+ echo ""
+ echo "# MP_PREFIX must be an existing MacPorts prefix. NO CHECKS ARE MADE!"
+ echo ""
+ echo "# To print the generated commands to stdout add 'show' as the first arg:"
+ echo "$(basename ${0}) show"
+ echo ""
+ echo "# To execute the generated commands add 'go' as the first arg:"
+ echo "$(basename ${0}) go"
+ echo ""
+ echo ""
+fi
\ No newline at end of file
Property changes on: users/pixilla/scripts/mp-svn-tree-setup
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-svn-up-dports
===================================================================
--- users/pixilla/scripts/mp-svn-up-dports (rev 0)
+++ users/pixilla/scripts/mp-svn-up-dports 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,11 @@
+#!/bin/bash
+# mp-svn-up-dports
+# Set vars if not set.
+: ${MP_PREFIX:="/opt/local"}
+: ${MP_SVNCMD:="/opt/local/bin/svn"}
+: ${MP_SVNTRUNK:="${MP_PREFIX}/var/macports/sources/svn.macports.org/trunk"}
+: ${MP_SVNDPORTS:="${MP_SVNTRUNK}/dports"}
+echo "MP_SVNDPORTS=${MP_SVNDPORTS}"
+cd "${MP_SVNDPORTS}"
+${MP_SVNCMD} up
+portindex
\ No newline at end of file
Property changes on: users/pixilla/scripts/mp-svn-up-dports
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-svn-up-trunk
===================================================================
--- users/pixilla/scripts/mp-svn-up-trunk (rev 0)
+++ users/pixilla/scripts/mp-svn-up-trunk 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,12 @@
+#!/bin/bash
+# mp-svn-up-trunk
+# Set vars if not set.
+: ${MP_PREFIX:="/opt/local"}
+: ${MP_SVNCMD:="/opt/local/bin/svn"}
+: ${MP_SVNTRUNK:="${MP_PREFIX}/var/macports/sources/svn.macports.org/trunk"}
+echo "MP_PREFIX=${MP_PREFIX}"
+echo "MP_SVNTRUNK=${MP_SVNTRUNK}"
+
+# svn update trunk
+cd "${MP_SVNTRUNK}"
+${MP_SVNCMD} up
Property changes on: users/pixilla/scripts/mp-svn-up-trunk
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-trac-table-port
===================================================================
--- users/pixilla/scripts/mp-trac-table-port (rev 0)
+++ users/pixilla/scripts/mp-trac-table-port 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,33 @@
+#!/bin/sh
+# mp-trac-table-port
+# Make trac wiki formatted table of MacPorts ports matching "port echo <stdin>"
+CMD="port echo $@"
+#echo $CMD
+#exit
+echo "||'''Port'''||'''Category'''||'''Repository'''||'''Tickets'''||"; \
+for name in $($CMD); do \
+ svn info $(port file $name) 2>&1 \
+ | grep -B 20 -E "^Revision" \
+ | grep -E '^URL: https?://svn.macports.org/repository/macports/' \
+ | sed -E \
+ -e 's|^URL: https?://svn.macports.org/repository/macports/||' \
+ -e 's|/Portfile$||' \
+ | awk -v NAME=$name 'BEGIN \
+ { FS = "/" } ; \
+ { printf "||[source:"$0" "NAME"]||[source:" } ; \
+ { \
+ for (x=1; x<NF; x++) { \
+ printf "%s", $x ; \
+ if (x != NF-1) printf "/" \
+ } \
+ } ; \
+ { printf " "$(NF-1)"]||[source:" } ; \
+ { \
+ for (x=1; x<NF-1; x++) { \
+ printf "%s", $x ; \
+ if (x != NF-2) printf "/" \
+ } \
+ } ; \
+ { printf " "$(NF-3)"]||[[TicketQuery(port="NAME"&status=new|assigned|reopened)]]||\n" } ; \
+ ' ;
+done
\ No newline at end of file
Property changes on: users/pixilla/scripts/mp-trac-table-port
___________________________________________________________________
Added: svn:executable
+ *
Deleted: users/pixilla/scripts/mp-trac-user-ports
===================================================================
--- users/pixilla/scripts/mp-trac-user-ports 2012-09-30 14:19:03 UTC (rev 98237)
+++ users/pixilla/scripts/mp-trac-user-ports 2012-09-30 15:41:11 UTC (rev 98238)
@@ -1,28 +0,0 @@
-#!/bin/sh
-echo "||'''Port'''||'''Category'''||'''Repository'''||'''Tickets'''||"; \
-for name in $(port echo "maintainer:(\W|^)$1(\W|$)"); do \
- svn info $(port file $name) 2>&1 \
- | grep -B 20 -E "^Revision" \
- | grep -E '^URL: https?://svn.macports.org/repository/macports/' \
- | sed -E \
- -e 's|^URL: https?://svn.macports.org/repository/macports/||' \
- -e 's|/Portfile$||' \
- | awk -v NAME=$name 'BEGIN \
- { FS = "/" } ; \
- { printf "||[source:"$0" "NAME"]||[source:" } ; \
- { \
- for (x=1; x<NF; x++) { \
- printf "%s", $x ; \
- if (x != NF-1) printf "/" \
- } \
- } ; \
- { printf " "$(NF-1)"]||[source:" } ; \
- { \
- for (x=1; x<NF-1; x++) { \
- printf "%s", $x ; \
- if (x != NF-2) printf "/" \
- } \
- } ; \
- { printf " "$(NF-3)"]||[[TicketQuery(port="NAME"&status=new|assigned|reopened)]]||\n" } ; \
- ' ;
-done
\ No newline at end of file
Added: users/pixilla/scripts/mp-upgrade-base
===================================================================
--- users/pixilla/scripts/mp-upgrade-base (rev 0)
+++ users/pixilla/scripts/mp-upgrade-base 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,22 @@
+#!/bin/bash
+# mp-upgrade-base
+: ${MP_PREFIX:="/opt/local"}
+: ${MP_SVNCMD:="/opt/local/bin/svn"}
+: ${MP_SVNTRUNK:="${MP_PREFIX}/var/macports/sources/svn.macports.org/trunk"}
+: ${MP_SVNBASE:="${MP_SVNTRUNK}/base"}
+echo "MP_SVNBASE=${MP_SVNBASE}"
+if [ "${MP_PREFIX}" = "/opt/local" ];then
+ CONFIGURE_ARGS="--prefix=${MP_PREFIX} --enable-readline"
+else
+ CONFIGURE_ARGS="--prefix=${MP_PREFIX} --enable-readline --with-tclpackage=${MP_PREFIX}/Library/Tcl --with-applications-dir=${MP_PREFIX}/Applications"
+fi
+echo "CONFIGURE_ARGS=${CONFIGURE_ARGS}"
+cd "${MP_SVNBASE}"
+${MP_SVNCMD} upgrade
+${MP_SVNCMD} up
+make distclean
+./configure ${CONFIGURE_ARGS}
+make
+sudo make install
+make distclean
+port version
\ No newline at end of file
Property changes on: users/pixilla/scripts/mp-upgrade-base
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-upgrade-trunk
===================================================================
--- users/pixilla/scripts/mp-upgrade-trunk (rev 0)
+++ users/pixilla/scripts/mp-upgrade-trunk 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,37 @@
+#!/bin/bash
+# mp-upgrade-trunk
+# Set vars if not set.
+: ${MP_PREFIX:="/opt/local"}
+: ${MP_SVNCMD:="/opt/local/bin/svn"}
+: ${MP_SVNTRUNK:="${MP_PREFIX}/var/macports/sources/svn.macports.org/trunk"}
+: ${MP_SVNDPORTS:="${MP_SVNTRUNK}/dports"}
+: ${MP_SVNBASE:="${MP_SVNTRUNK}/base"}
+echo "MP_PREFIX=${MP_PREFIX}"
+echo "MP_SVNCMD=${MP_SVNCMD}"
+echo "MP_SVNTRUNK=${MP_SVNTRUNK}"
+echo "MP_SVNDPORTS=${MP_SVNDPORTS}"
+echo "MP_SVNBASE=${MP_SVNBASE}"
+
+# svn upgrade and update trunk
+cd "${MP_SVNTRUNK}"
+${MP_SVNCMD} upgrade
+${MP_SVNCMD} up
+
+# build base
+cd "${MP_SVNBASE}"
+if [ "${MP_PREFIX}" = "/opt/local" ];then
+ CONFIGURE_ARGS="--prefix=${MP_PREFIX} --enable-readline"
+else
+ CONFIGURE_ARGS="--prefix=${MP_PREFIX} --enable-readline --with-tclpackage=${MP_PREFIX}/Library/Tcl --with-applications-dir=${MP_PREFIX}/Applications"
+fi
+echo "CONFIGURE_ARGS=${CONFIGURE_ARGS}"
+make distclean
+./configure ${CONFIGURE_ARGS}
+make
+sudo make install
+make distclean
+port version
+
+# update portindex
+cd "${MP_SVNDPORTS}"
+portindex
Property changes on: users/pixilla/scripts/mp-upgrade-trunk
___________________________________________________________________
Added: svn:executable
+ *
Added: users/pixilla/scripts/mp-upgrade-trunk-all
===================================================================
--- users/pixilla/scripts/mp-upgrade-trunk-all (rev 0)
+++ users/pixilla/scripts/mp-upgrade-trunk-all 2012-09-30 15:41:11 UTC (rev 98238)
@@ -0,0 +1,13 @@
+#!/bin/bash
+# mp-upgrade-trunk-all
+. ~/.bash_profile
+# Store our active MP* function name.
+MP_PREOLD=$(MP-GET)
+echo $MP_PREOLD
+# Call each MP* function followed by pm-upgrad-trunk
+for MPPRE in $(MP-LIST);do
+ $MPPRE
+ mp-upgrade-trunk
+done
+# Call our original MP* function to end up where we started
+$MP_PREOLD
Property changes on: users/pixilla/scripts/mp-upgrade-trunk-all
___________________________________________________________________
Added: svn:executable
+ *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120930/47f70a24/attachment-0001.html>
More information about the macports-changes
mailing list