[packages_10.03.2] polipo: merge r29139
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 5 Feb 2012 15:54:11 +0000 (15:54 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 5 Feb 2012 15:54:11 +0000 (15:54 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/packages_10.03.2@30238 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/polipo/Makefile
net/polipo/files/polipo.init

index bbd54eb..8099e65 100644 (file)
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2007 OpenWrt.org
+# Copyright (C) 2007-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=polipo
 PKG_VERSION:=1.0.4.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://freehaven.net/~chrisd/polipo/
index 5b5d54c..ec1d756 100644 (file)
@@ -1,47 +1,35 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2008 OpenWrt.org
+# Copyright (C) 2008-2011 OpenWrt.org
+
 START=99
 
-DAEMON=/usr/sbin/polipo
 CFGFILE=/var/etc/polipo.conf
 
 start() {
-       config_load polipo
+       config_load 'polipo'
 
-       config_get_bool enabled "general" enabled
-       [ "$enabled" -ne "1" ] && {
-               echo 'Polipo is disabled.'
-               return 0
-       }
+       config_get_bool enabled "general" 'enabled' '0'
+       [ $enabled -gt 0 ] || return 1
 
-       mkdir -p /var/etc/      
+       mkdir -m 0755 -p /var/etc/
        echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE
        echo '### DO NOT EDIT' >> $CFGFILE
        echo '### SEE /etc/config/polipo INSTEAD' >> $CFGFILE
        echo '' >> $CFGFILE
 
-       config_foreach polipo_config polipo
-       
-       # handle values that are disabled when not defiend or empty
+       config_foreach polipo_config 'polipo'
+
+       # handle values that are disabled when not defined or empty
        echo "### VALUES THAT ARE DISABLED WHEN EMPTY" >> $CFGFILE
        polipo_atom "cache" "diskCacheRoot" '"' "1" >> $CFGFILE
        polipo_atom "general" "logFile" '"' "1" >> $CFGFILE
        polipo_atom "general" "localDocumentRoot" '"' "1" >> $CFGFILE
-       
-       echo 'Polipo is starting...'
-       start-stop-daemon -S -q -x "$DAEMON" -- -c "$CFGFILE"
-}
 
-stop() {
-       echo 'Polipo is stopping...'
-       start-stop-daemon -K -q -x "$DAEMON"
-       rm -f $CFGFILE
+       service_start /usr/sbin/polipo -c "$CFGFILE"
 }
 
-restart() {
-       stop
-       sleep 2
-       start
+stop() {
+       service_stop /usr/sbin/polipo -c "$CFGFILE"
 }
 
 polipo_config() {