Skip to content

Commit

Permalink
adds jq to preserve extra nodes in var/package.json, remove migration…
Browse files Browse the repository at this point in the history
… steps from old beta versions
  • Loading branch information
hobbyquaker committed Jun 20, 2018
1 parent 40c10a2 commit ecc9750
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 35 deletions.
Binary file added addon_files/redmatic/bin/jq
Binary file not shown.
41 changes: 41 additions & 0 deletions addon_files/redmatic/lib/libjq.la
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# libjq.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='libjq.so.1'

# Names of this library.
library_names='libjq.so.1.0.4 libjq.so.1 libjq.so'

# The name of the static archive.
old_library=''

# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''

# Libraries that this one depends upon.
dependency_libs=' -lm'

# Names of additional weak libraries provided by this library
weak_library_names=''

# Version information for libjq.
current=1
age=0
revision=4

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/lib'
Binary file added addon_files/redmatic/lib/libjq.so
Binary file not shown.
Binary file added addon_files/redmatic/lib/libjq.so.1
Binary file not shown.
Binary file added addon_files/redmatic/lib/libjq.so.1.0.4
Binary file not shown.
50 changes: 15 additions & 35 deletions addon_files/update_script
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,16 @@ if [ -f $CONF_DIR/rc.d/redmatic ]; then
fi

#
# Install addon files
#
cp -af redmatic $ADDONS_DIR/

#
# Migration from <= 1.0.0-beta.7
# Rename extra nodes package.json on update
#
if [ -d $ADDONS_DIR/node-red ]; then

if [ -f $CONF_DIR/rc.d/node-red ]; then
rm $CONF_DIR/rc.d/node-red
fi
if [ -f $CONF_DIR/addons/www/check_update_node_red.cgi ]; then
rm $CONF_DIR/addons/www/check_update_node_red.cgi
fi
if [ -f $CONF_DIR/lighttpd/node-red.conf ]; then
rm $CONF_DIR/lighttpd/node-red.conf
fi

cp $ADDONS_DIR/node-red/var/flows.json $RED_DIR/var/flows.json

rm -rf $ADDONS_DIR/node-red
if [ -f $RED_DIR/var/package.json ]; then
mv $RED_DIR/var/package.json $RED_DIR/var/package.json.old
fi

#
# Migration from <= 1.0.0-beta.9
# Install addon files
#
if [ -d $WWW_DIR ]; then
rm -rf $WWW_DIR
fi
if [ -f $RED_DIR/lighttpd-error-503.html ]; then
rm $RED_DIR/lighttpd-error-503.html
fi
if [ -f $RED_DIR/lighttpd.conf ]; then
rm $RED_DIR/lighttpd.conf
fi
if [ -f $RED_DIR/logo-w-200.png ]; then
rm $RED_DIR/logo-w-200.png
fi

cp -af redmatic $ADDONS_DIR/

#
# Create default config on first install
Expand All @@ -77,6 +47,16 @@ if [ ! -f $RED_DIR/var/flows.json ]; then
mv $RED_DIR/var/example-flows.json $RED_DIR/var/flows.json
fi

#
# Extend extra nodes package.json
#
if [ -f $RED_DIR/var/package.json.old ]; then
mv $RED_DIR/var/package.json $RED_DIR/var/package.json.new
export LD_LIBRARY_PATH=$RED_DIR/lib
$RED_DIR/bin/jq -s '.[0] * .[1]' $RED_DIR/var/package.json.old $RED_DIR/var/package.json.new > $RED_DIR/var/package.json
rm $RED_DIR/var/package.json.old $RED_DIR/var/package.json.new
fi

#
# Create Links
#
Expand Down

0 comments on commit ecc9750

Please sign in to comment.