i2pd: Update to 2.29.0
authorRosen Penev <redacted>
Fri, 17 Jan 2020 03:10:59 +0000 (19:10 -0800)
committerRosen Penev <redacted>
Fri, 17 Jan 2020 03:10:59 +0000 (19:10 -0800)
Ran init script through shellcheck. Simplified several statements.

Replaced INSTALL_CONF with INSTALL_DATA. i2pd runs as non-root and so the
conf file must be accessible.

Fixed: https://github.com/openwrt/packages/issues/10977

Signed-off-by: Rosen Penev <redacted>
net/i2pd/Makefile
net/i2pd/files/i2pd.init

index 09aafa5a47585aa0aadea0c86b15df6110ebd596..1335194c309a275c4d4a542b1f8b111cba1dee88 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=i2pd
-PKG_VERSION:=2.28.0
+PKG_VERSION:=2.29.0
 PKG_RELEASE:=1
 PKG_BUILD_PARALLEL:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=181327edc7cf5b3c25ee51ecc518a4da90fa9e421eca2107996791038a514a21
+PKG_HASH:=fd0474c33b411593b9dc8197f3799d37d68455c11a9ee3994ec993a96388ec06
 
 PKG_MAINTAINER:=David Yang <mmyangfl@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
index 21473407f13db4cb08df34f8d45fc9ac13544b98..4c4790fc3ef6bc93b8aa11fc5c17801d6db12e3d 100755 (executable)
@@ -27,20 +27,18 @@ i2pd_start() {
        config_get addressbook_dir "$cfg" addressbook_dir
 
        ## Setting up data dir
-       if [ ! -d "$data_dir" ]; then
+       [ -d "$data_dir" ] || {
                mkdir -p "$data_dir"
+               chown "$USER:$GROUP" "$data_dir"
                ln -s /usr/share/i2pd/certificates "$data_dir/certificates"
-               if [ -n "$addressbook_dir" ]; then
-                       if [ ! -d "$addressbook_dir" ]; then
-                               mkdir -p "$addressbook_dir"
-                       fi
+               [ -n "$addressbook_dir" ] && {
+                       [ -d "$addressbook_dir" ] || mkdir -p "$addressbook_dir"
+                       chown "$USER:$GROUP" "$addressbook_dir"
                        ln -s "$addressbook_dir" "$data_dir/addressbook"
-               fi
-       fi
+               }
+       }
 
        ## We need permissions
-       chown "$USER:$GROUP" "$data_dir"
-       chown "$USER:$GROUP" "$addressbook_dir"
        touch "$PIDFILE"
        chown "$USER:adm" "$PIDFILE"
 
@@ -67,11 +65,7 @@ start_service() {
        config_cb() {
                local type="$1"
                local name="$2"
-               if [ "$type" = "i2pd" ]; then
-                       if [ -n "$instance" ] && [ "$instance" = "$name" ]; then
-                               instance_found=1
-                       fi
-               fi
+               [ "$type" = "i2pd" ] && [ -n "$instance" ] && [ "$instance" = "$name" ] && instance_found=1
        }
 
        config_load i2pd
git clone https://git.99rst.org/PROJECT