[81814] users/pixilla
pixilla at macports.org
pixilla at macports.org
Thu Aug 4 22:20:35 PDT 2011
Revision: 81814
http://trac.macports.org/changeset/81814
Author: pixilla at macports.org
Date: 2011-08-04 22:20:35 -0700 (Thu, 04 Aug 2011)
Log Message:
-----------
users/pixilla: Update pear2port.sh.
Modified Paths:
--------------
users/pixilla/tools/pear2port.sh
Added Paths:
-----------
users/pixilla/tools/
Modified: users/pixilla/tools/pear2port.sh
===================================================================
--- users/pixilla/_tools/pear2port.sh 2011-08-05 05:01:10 UTC (rev 81811)
+++ users/pixilla/tools/pear2port.sh 2011-08-05 05:20:35 UTC (rev 81814)
@@ -1,29 +1,29 @@
#!/bin/bash
[ ${MAINTAINERS+1} ] || MAINTAINERS="nomaintainer"
-extract_suffix='.tgz'
+[ ${EXTRACT_SUFFIX+1} ] || EXTRACT_SUFFIX=".tgz"
package=${1}
if [ "x${package}" == "x" ]
then
echo "Error: No package name given!"
echo "Try something like:"
- echo " \$ MAINTAINERS=\"$(users) openmaintainer\" ${0} Auth"
+ echo " \$ VERBOSE=yes MAINTAINERS=\"$(users) openmaintainer\" ${0} Auth"
echo "Or, for a version other than the most recent version"
- echo " \$ MAINTAINERS=\"$(users) openmaintainer\" ${0} Auth 0.3.1"
+ echo " \$ VERBOSE=yes MAINTAINERS=\"$(users) openmaintainer\" ${0} Auth 0.3.1"
exit
fi
-#echo "Package: ${package}"
+[ "x${VERBOSE}" == "xyes" ] && echo "Package: ${package}"
if [ "x${2}" == "x" ]
then
version=\
$(curl -s http://pear.php.net/package/${package}/download | \
-grep -o -P "http://download.pear.php.net/package/${package}-((?!\.tgz).*)\.tgz" | \
-sed -e "s/.*\///g" -e "s/${package}-//g" -e "s/\.tgz//g")
+grep -o -P "http://download.pear.php.net/package/${package}-((?!${EXTRACT_SUFFIX}).*)${EXTRACT_SUFFIX}" | \
+sed -e "s/.*\///g" -e "s/${package}-//g" -e "s/${EXTRACT_SUFFIX}//g")
else
version=${2}
fi
-#echo "Version: ${version}"
+[ "x${VERBOSE}" == "xyes" ] && echo "Version: ${version}"
if [ "x${version}" == "x" ]
then
@@ -35,7 +35,7 @@
mkdir pear-${package}
cd pear-${package}
-#echo "building Portfile..."
+[ "x${VERBOSE}" == "xyes" ] && echo "building Portfile..."
cat << EOF > Portfile
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# \$Id\$
@@ -54,9 +54,9 @@
EOF
sleep 1
-#echo "port -o fetch..."
+[ "x${VERBOSE}" == "xyes" ] && echo "port -o fetch..."
sudo port -o fetch > /dev/null 2>&1
-distfile=$(port -o distfiles | grep "\[${distname}${extract_suffix}\]" | awk '{print $2}')
+distfile=$(port -o distfiles | grep "\[${distname}${EXTRACT_SUFFIX}\]" | awk '{print $2}')
distfile_sha1=$(openssl sha1 ${distfile} | awk '{print $2}')
distfile_rmd160=$(openssl rmd160 ${distfile} | awk '{print $2}')
cat << EOF >> Portfile
@@ -64,14 +64,14 @@
rmd160 ${distfile_rmd160}
EOF
-#echo "removing sources..."
+[ "x${VERBOSE}" == "xyes" ] && echo "removing sources..."
-#echo "port -o extract..."
+[ "x${VERBOSE}" == "xyes" ] && echo "port -o extract..."
sudo port -o extract > /dev/null 2>&1
deps=''
count=0
IFS=$'\n'
-#echo "port -o build to check for deps..."
+[ "x${VERBOSE}" == "xyes" ] && echo "port -o build to check for deps..."
sleep 1
for dep in $(sudo port -o -v build | grep -P "${package} requires package")
do
@@ -91,8 +91,8 @@
echo "" >> Portfile
fi
unset IFS
-#echo "port -o clean..."
+[ "x${VERBOSE}" == "xyes" ] && echo "port -o clean..."
sudo port -o clean > /dev/null 2>&1
-#echo "final Portfile..."
+[ "x${VERBOSE}" == "xyes" ] &&echo "final Portfile..."
cat Portfile
cd ..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110804/a9e59968/attachment.html>
More information about the macports-changes
mailing list