[81786] users/pixilla

pixilla at macports.org pixilla at macports.org
Thu Aug 4 16:32:01 PDT 2011


Revision: 81786
          http://trac.macports.org/changeset/81786
Author:   pixilla at macports.org
Date:     2011-08-04 16:32:00 -0700 (Thu, 04 Aug 2011)
Log Message:
-----------
users/pixilla: Move port cat dirs to dports dir.

Modified Paths:
--------------
    users/pixilla/dports/devel/mp-shared-objects/Portfile
    users/pixilla/dports/devel/mp-shared-objects/files/mp-shared-objects

Added Paths:
-----------
    users/pixilla/dports/
    users/pixilla/dports/_resources/
    users/pixilla/dports/devel/
    users/pixilla/dports/devel/mp-shared-objects/
    users/pixilla/dports/php/

Modified: users/pixilla/dports/devel/mp-shared-objects/Portfile
===================================================================
--- users/pixilla/devel/mp-shared-objects/Portfile	2011-05-21 21:59:38 UTC (rev 78776)
+++ users/pixilla/dports/devel/mp-shared-objects/Portfile	2011-08-04 23:32:00 UTC (rev 81786)
@@ -5,10 +5,10 @@
 PortSystem          1.0
 
 name                mp-shared-objects
-version             0.0.1
+version             0.0.2
 categories          devel
 platforms           darwin
-license             GPL-2
+license             BEERWARE-42+
 maintainers         pixilla
 distfiles
 
@@ -17,9 +17,123 @@
 
 homepage            {}
 master_sites        {}
+extract.mkdir       yes
+use_configure       no
+build {
+    set fp [open ${worksrcpath}/${name} w]
+    puts $fp \
+{#!/usr/bin/env bash
+# Argument = [-q] <path name>
 
-use_configure       no
-build               {}
+eError="error: no such path"
+
+usage()
+{
+cat << EOF
+
+usage: $(basename $0) options
+
+This script runs otool -XL over the contents of a path:
+\$ $(basename $0) -p /opt/local/lib/mysql5
+or a MacPorts port name:
+\$ $(basename $0) -p mysql5 -m
+
+
+OPTIONS:
+    -h      Show this message
+    -p      Path or Port (requires -m) to check
+    -m      Use -p as a port name rather then a path
+    -c      Check if shared library exists, print "${eError}" if it does not
+    -q      Quite, only print errors, implies -c
+    -s      Stop on errors
+
+EOF
+}
+
+[ -z $TYPE ] && TYPE=PATH
+[ -z $CHECK_EXISTS ] && CHECK_EXISTS=
+[ -z $QUITE ] && QUITE=
+[ -z $STOP ] && STOP=
+
+while getopts "hp:mcqs" OPTION
+do
+    case $OPTION in
+        h)
+            usage
+            exit 1
+            ;;
+        p)
+            NAME=$OPTARG
+            ;;
+        m)
+            TYPE=PORT
+            ;;
+        c)
+            CHECK_EXISTS=yes
+            ;;
+        q)
+            QUITE=yes
+            CHECK_EXISTS=yes
+            ;;
+        s)
+            STOP=yes
+            ;;
+        ?)
+            usage
+            exit
+            ;;
+    esac
+done
+
+if [[ -z $NAME ]]
+then
+    usage
+    exit 1
+fi
+
+IFS=$'\n'
+if [ "${TYPE}" == "PATH" ]
+then
+  FILES=( $(find "${NAME}" -type f) )
+fi
+if [ "${TYPE}" == "PORT" ]
+then
+  FILES=( $(port -q contents "${NAME}" | sed -e "s/^ *//") )
+fi
+for (( fc = 0 ; fc < ${#FILES[@]} ; fc++ ))
+do
+    if [[ ! -f "${FILES[$fc]}" && ! -d "${FILES[$fc]}" ]]
+    then
+        echo "FILE ${eError}: ${FILES[$fc]}"
+        break 1
+    fi
+    if [ ! -d "${FILES[$fc]}" ]
+    then    
+        SHAREDLIBRARYS=( $(otool -XL "${FILES[$fc]}" | sed -e "s/^Archive.*//" | tr -d '\t' | awk '{print $1}') )
+        if [[ ${#SHAREDLIBRARYS[@]} -gt 0 ]]
+        then
+            [ -z $QUITE ] && echo "${FILES[$fc]}"
+            for (( sc = 0 ; sc < ${#SHAREDLIBRARYS[@]} ; sc++ ))
+            do
+                if [ ! -f "${SHAREDLIBRARYS[$sc]}" ]
+                then
+                    [ -n $QUITE ] && echo "${FILE[$fc]}"
+                    echo "SHAREDLIBRARY ${eError}: ${SHAREDLIBRARYS[$sc]}"
+                    [ "${STOP}" == "yes" ] && break 2
+                else
+                    [ -z $QUITE ] && echo -e "\t${SHAREDLIBRARYS[$sc]}"
+                fi
+            done
+        fi
+    fi
+done
+unset IFS
+unset NAME
+unset CHECK_EXISTS
+unset QUITE
+    }
+    close $fp
+}
 destroot {
     xinstall -m 755 -W ${filespath} mp-shared-objects \
         ${destroot}${prefix}/sbin/

Modified: users/pixilla/dports/devel/mp-shared-objects/files/mp-shared-objects
===================================================================
--- users/pixilla/devel/mp-shared-objects/files/mp-shared-objects	2011-05-21 21:59:38 UTC (rev 78776)
+++ users/pixilla/dports/devel/mp-shared-objects/files/mp-shared-objects	2011-08-04 23:32:00 UTC (rev 81786)
@@ -21,6 +21,7 @@
     -m      Use -p as a port name rather then a path
     -c      Check if shared library exists, print "${eError}" if it does not
     -q      Quite, only print errors, implies -c
+    -s      Stop on errors
 
 EOF
 }
@@ -28,8 +29,9 @@
 [ -z $TYPE ] && TYPE=PATH
 [ -z $CHECK_EXISTS ] && CHECK_EXISTS=
 [ -z $QUITE ] && QUITE=
+[ -z $STOP ] && STOP=
 
-while getopts "hp:mcq" OPTION
+while getopts "hp:mcqs" OPTION
 do
     case $OPTION in
         h)
@@ -49,6 +51,9 @@
             QUITE=yes
             CHECK_EXISTS=yes
             ;;
+        s)
+            STOP=yes
+            ;;
         ?)
             usage
             exit
@@ -90,7 +95,7 @@
                 then
                     [ -n $QUITE ] && echo "${FILE[$fc]}"
                     echo "SHAREDLIBRARY ${eError}: ${SHAREDLIBRARYS[$sc]}"
-break 2
+                    [ "${STOP}" == "yes" ] && break 2
                 else
                     [ -z $QUITE ] && echo -e "\t${SHAREDLIBRARYS[$sc]}"
                 fi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110804/3e8d6f0b/attachment-0001.html>


More information about the macports-changes mailing list