[Assorted-commits] SF.net SVN: assorted:[1024] wp-easy-filter
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-10-22 20:00:58
|
Revision: 1024 http://assorted.svn.sourceforge.net/assorted/?rev=1024&view=rev Author: yangzhang Date: 2008-10-22 20:00:37 +0000 (Wed, 22 Oct 2008) Log Message: ----------- added cabal-install Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Added Paths: ----------- sandbox/trunk/src/php/ sandbox/trunk/src/php/subprocess.php wp-easy-filter/ wp-easy-filter/trunk/ wp-easy-filter/trunk/src/ Added: sandbox/trunk/src/php/subprocess.php =================================================================== --- sandbox/trunk/src/php/subprocess.php (rev 0) +++ sandbox/trunk/src/php/subprocess.php 2008-10-22 20:00:37 UTC (rev 1024) @@ -0,0 +1,23 @@ +<? +$descriptorspec = $descriptorspec = array( + 0 => array("pipe", "r"), // stdin is a pipe that the child will read from + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("pipe", "w") // stderr is a file to write to +); +$cwd = '/tmp'; +$env = array('some_option' => 'option'); + +$process = proc_open('php', $descriptorspec, $pipes, $cwd, $env); + +if (is_resource($process)) { + fwrite($pipes[0], '<? print_r($_ENV); ?>'); + fclose($pipes[0]); + + $stdout = stream_get_contents($pipes[1]); + fclose($pipes[1]); + echo $stdout; + + $return_value = proc_close($process); + echo "command returned $return_value\n"; +} +?> Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2008-10-22 06:47:05 UTC (rev 1023) +++ shell-tools/trunk/src/bash-commons/common.bash 2008-10-22 20:00:37 UTC (rev 1024) @@ -467,6 +467,19 @@ find "${1:-.}" -type d -empty -print0 | xargs -0r rmdir -p } +cabal-install() { + for i in "${@:-}" ; do + local pkg="$(basename "$(pwd)" )" && + pushd "$i" && + runhaskell Setup.*hs clean && + runhaskell Setup.*hs configure --user --prefix="$HOME/.local/pkg/ghc-${pkg%-*}" && + runhaskell Setup.*hs build && + runhaskell Setup.*hs install --user && + popd || + break + done +} + #if ! is_declared indent ; then # noindent #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |