New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 81786


Ignore:
Timestamp:
08/04/11 16:32:00 (4 years ago)
Author:
pixilla@…
Message:

users/pixilla: Move port cat dirs to dports dir.

Location:
users/pixilla/dports
Files:
1 added
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • users/pixilla/dports/devel/mp-shared-objects/Portfile

    r78776 r81786  
    66 
    77name                mp-shared-objects 
    8 version             0.0.1 
     8version             0.0.2 
    99categories          devel 
    1010platforms           darwin 
    11 license             GPL-2 
     11license             BEERWARE-42+ 
    1212maintainers         pixilla 
    1313distfiles 
     
    1818homepage            {} 
    1919master_sites        {} 
     20extract.mkdir       yes 
     21use_configure       no 
     22build { 
     23    set fp [open ${worksrcpath}/${name} w] 
     24    puts $fp \ 
     25{#!/usr/bin/env bash 
     26# Argument = [-q] <path name> 
    2027 
    21 use_configure       no 
    22 build               {} 
     28eError="error: no such path" 
     29 
     30usage() 
     31{ 
     32cat << EOF 
     33 
     34usage: $(basename $0) options 
     35 
     36This script runs otool -XL over the contents of a path: 
     37\$ $(basename $0) -p /opt/local/lib/mysql5 
     38or a MacPorts port name: 
     39\$ $(basename $0) -p mysql5 -m 
     40 
     41 
     42OPTIONS: 
     43    -h      Show this message 
     44    -p      Path or Port (requires -m) to check 
     45    -m      Use -p as a port name rather then a path 
     46    -c      Check if shared library exists, print "${eError}" if it does not 
     47    -q      Quite, only print errors, implies -c 
     48    -s      Stop on errors 
     49 
     50EOF 
     51} 
     52 
     53[ -z $TYPE ] && TYPE=PATH 
     54[ -z $CHECK_EXISTS ] && CHECK_EXISTS= 
     55[ -z $QUITE ] && QUITE= 
     56[ -z $STOP ] && STOP= 
     57 
     58while getopts "hp:mcqs" OPTION 
     59do 
     60    case $OPTION in 
     61        h) 
     62            usage 
     63            exit 1 
     64            ;; 
     65        p) 
     66            NAME=$OPTARG 
     67            ;; 
     68        m) 
     69            TYPE=PORT 
     70            ;; 
     71        c) 
     72            CHECK_EXISTS=yes 
     73            ;; 
     74        q) 
     75            QUITE=yes 
     76            CHECK_EXISTS=yes 
     77            ;; 
     78        s) 
     79            STOP=yes 
     80            ;; 
     81        ?) 
     82            usage 
     83            exit 
     84            ;; 
     85    esac 
     86done 
     87 
     88if [[ -z $NAME ]] 
     89then 
     90    usage 
     91    exit 1 
     92fi 
     93 
     94IFS=$'\n' 
     95if [ "${TYPE}" == "PATH" ] 
     96then 
     97  FILES=( $(find "${NAME}" -type f) ) 
     98fi 
     99if [ "${TYPE}" == "PORT" ] 
     100then 
     101  FILES=( $(port -q contents "${NAME}" | sed -e "s/^ *//") ) 
     102fi 
     103for (( fc = 0 ; fc < ${#FILES[@]} ; fc++ )) 
     104do 
     105    if [[ ! -f "${FILES[$fc]}" && ! -d "${FILES[$fc]}" ]] 
     106    then 
     107        echo "FILE ${eError}: ${FILES[$fc]}" 
     108        break 1 
     109    fi 
     110    if [ ! -d "${FILES[$fc]}" ] 
     111    then     
     112        SHAREDLIBRARYS=( $(otool -XL "${FILES[$fc]}" | sed -e "s/^Archive.*//" | tr -d '\t' | awk '{print $1}') ) 
     113        if [[ ${#SHAREDLIBRARYS[@]} -gt 0 ]] 
     114        then 
     115            [ -z $QUITE ] && echo "${FILES[$fc]}" 
     116            for (( sc = 0 ; sc < ${#SHAREDLIBRARYS[@]} ; sc++ )) 
     117            do 
     118                if [ ! -f "${SHAREDLIBRARYS[$sc]}" ] 
     119                then 
     120                    [ -n $QUITE ] && echo "${FILE[$fc]}" 
     121                    echo "SHAREDLIBRARY ${eError}: ${SHAREDLIBRARYS[$sc]}" 
     122                    [ "${STOP}" == "yes" ] && break 2 
     123                else 
     124                    [ -z $QUITE ] && echo -e "\t${SHAREDLIBRARYS[$sc]}" 
     125                fi 
     126            done 
     127        fi 
     128    fi 
     129done 
     130unset IFS 
     131unset NAME 
     132unset CHECK_EXISTS 
     133unset QUITE 
     134    } 
     135    close $fp 
     136} 
    23137destroot { 
    24138    xinstall -m 755 -W ${filespath} mp-shared-objects \ 
  • users/pixilla/dports/devel/mp-shared-objects/files/mp-shared-objects

    r78776 r81786  
    2222    -c      Check if shared library exists, print "${eError}" if it does not 
    2323    -q      Quite, only print errors, implies -c 
     24    -s      Stop on errors 
    2425 
    2526EOF 
     
    2930[ -z $CHECK_EXISTS ] && CHECK_EXISTS= 
    3031[ -z $QUITE ] && QUITE= 
     32[ -z $STOP ] && STOP= 
    3133 
    32 while getopts "hp:mcq" OPTION 
     34while getopts "hp:mcqs" OPTION 
    3335do 
    3436    case $OPTION in 
     
    4951            QUITE=yes 
    5052            CHECK_EXISTS=yes 
     53            ;; 
     54        s) 
     55            STOP=yes 
    5156            ;; 
    5257        ?) 
     
    9196                    [ -n $QUITE ] && echo "${FILE[$fc]}" 
    9297                    echo "SHAREDLIBRARY ${eError}: ${SHAREDLIBRARYS[$sc]}" 
    93 break 2 
     98                    [ "${STOP}" == "yes" ] && break 2 
    9499                else 
    95100                    [ -z $QUITE ] && echo -e "\t${SHAREDLIBRARYS[$sc]}" 
Note: See TracChangeset for help on using the changeset viewer.