# HG changeset patch # User d3v11 # Date 1322260479 0 # Node ID e771b7217646f316a8b2d857bd0473c09480f9ce # Parent 1ba55b415d50239f7a973686d6160a355e1951ed updated peer2anonet diff -r 1ba55b415d50 -r e771b7217646 contrib/peer2anonet/peer2anonet --- a/contrib/peer2anonet/peer2anonet Fri Nov 25 21:11:12 2011 +0000 +++ b/contrib/peer2anonet/peer2anonet Fri Nov 25 22:34:39 2011 +0000 @@ -6,10 +6,11 @@ USAGE(){ echo -e '\npeer2anonet:' - echo -e '\n --configure generate a new local configuration and exit' - echo -e '\n --update regenerate peer configurations' - echo -e '\n --configure-peer generate a new peer configuration and update' - echo -e '\n --rm-peer remove a peer configuration and update\n' + echo -e '\n --configure generate a new local configuration and exit' + echo -e '\n --update regenerate peer configurations' + echo -e '\n --configure-peer generate a new peer configuration and update' + echo -e '\n --rm-peer remove a peer configuration and update' + echo -e '\n --install-daemontools installs daemontools\n' exit 0 } @@ -264,6 +265,23 @@ fi } +INSTALL_DAEMONTOOLS(){ + [[ $(echo X`which gcc`) == X ]] && echo ' error: cannot find gcc' + [[ $(echo X`which gcc`) == X ]] && exit 1 + [[ $(echo X`which make`) == X ]] && echo ' error: cannot find make' + [[ $(echo X`which make`) == X ]] && exit 1 + mkdir -p /package + chmod 1755 /package + cd /package + wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz + gunzip daemontools-0.76.tar + tar -xpf daemontools-0.76.tar + rm -f daemontools-0.76.tar + cd admin/daemontools-0.76 + sed -i 's/gcc/gcc -include errno.h/g' src/conf-cc + package/install + } + if [ "$1" == '--configure' ]; then CONFIGURE @@ -275,6 +293,8 @@ elif [ "$1" == '--rm-peer' ]; then RM_PEER UPDATE +elif [ "$1" == '--rm-peer' ]; then + INSTALL_DAEMONTOOLS else USAGE fi