Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  add initial version to search for used Perl modules
  Remove port 7072 from example as it's not required to be publicly available unless the user decides to do so
  Fix sorting order and leave EXPOSE as is
  Added debian packages for work with HTTPMOD
  Disable Crypt::Random installation for i386
  Add Crypt::Random installation
  • Loading branch information
jpawlowski committed Jan 5, 2019
2 parents ad54d8f + 363a96d commit 58d4969
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
sudo \
telnet \
telnet-ssl \
unzip \
usbutils \
wget \
\
Expand All @@ -113,6 +114,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
libcgi-pm-perl \
libclass-dbi-mysql-perl \
libclass-isa-perl \
libclass-loader-perl \
libcommon-sense-perl \
libconvert-base32-perl \
libcrypt-*-perl \
Expand All @@ -130,6 +132,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
libfile-fcntllock-perl \
libgd-graph-perl \
libgd-text-perl \
libhtml-strip-perl \
libhtml-treebuilder-xpath-perl \
libimage-info-perl \
libimage-librsvg-perl \
libio-file-withpath-perl \
Expand Down Expand Up @@ -172,11 +176,18 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
libwww-curl-perl \
libwww-perl \
libxml-parser-lite-perl \
libxml-parser-perl \
libxml-simple-perl \
libxml-stream-perl \
libxml-treebuilder-perl \
libxml-xpath-perl \
&& cpanm \
Net::MQTT::Constants \
Net::MQTT::Simple \
&& if [ "${ARCH}" != "i386" ]; then \
cpanm \
Crypt::Random \
; fi \
&& if [ "${ARCH}" = "amd64" ] || [ "${ARCH}" = "i386" ]; then \
cpanm \
Crypt::Cipher::AES \
Expand All @@ -190,6 +201,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get purge -qqy \
build-essential \
cpanminus \
unzip \
subversion \
&& apt-get autoremove -qqy && apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
5 changes: 0 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ services:
networks:
- net
ports:
- "7072:7072"
- "8083:8083"
volumes:
- "./fhem/:/opt/fhem/"
Expand All @@ -40,7 +39,6 @@ services:
networks:
- net
ports:
- "7072:7072"
- "8083:8083"
volumes:
- "./fhem/:/opt/fhem/"
Expand All @@ -61,7 +59,6 @@ services:
networks:
- net
ports:
- "7072:7072"
- "8083:8083"
volumes:
- "./fhem/:/opt/fhem/"
Expand All @@ -84,7 +81,6 @@ services:
networks:
- net
ports:
- "7072:7072"
- "8083:8083"
volumes:
- "./fhem/:/opt/fhem/"
Expand All @@ -105,7 +101,6 @@ services:
privileged: true
network_mode: "host"
ports:
- "7072:7072"
- "8083:8083"
volumes:
- "./fhem/:/opt/fhem/"
Expand Down
33 changes: 33 additions & 0 deletions scripts/find-perl-modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Find missing Perl modules that are in use by official modules

# use
for module in `find $1./FHEM -type f -name "*.pm" -print0 | xargs -0 grep -oP "^use .*;" | sed 's|[;"'\'']||g' | sed 's/$attr{global}{modpath}//g' | sed 's/$main::attr{global}{modpath}//g' | sort -u -f -k2,2 | cut -d : -f 2- | cut -d " " -f 2 | grep -v -i -E "^(\$|\@|warnings|vars|feature|inline|strict|constant|(\d\.\d+)|POSIX|utf8)"`; do
NAME=`echo $module | cut -d " " -f 1 | cut -d ";" -f 1 | cut -d ":" -f 1`
if [[ -e "$1./$NAME" || -e "$1./FHEM/$NAME" || -e "$1./$NAME.pm" || -e "$1./FHEM/$NAME.pm" ]]; then
# This is a FHEM internal Perl module
continue
fi
CHK=`perl -e "use $module" 2>1 >/dev/null`
ret=$?

if [ $ret != "0" ]; then
echo "Checking external module '$module' ... MISSING"
fi
done

# require
for module in `find $1./FHEM -type f -name "*.pm" -print0 | xargs -0 grep -oP "^require .*;" | sed 's|[;"'\'']||g' | sed 's/$attr{global}{modpath}//g' | sed 's/$main::attr{global}{modpath}//g' | sort -u -f -k2,2 | cut -d : -f 2- | cut -d " " -f 2 | grep -v -i -E "^(\$|\@|warnings|vars|feature|inline|strict|constant|(\d\.\d+)|POSIX|utf8)"`; do
NAME=`echo $module | cut -d " " -f 1 | cut -d ";" -f 1 | cut -d ":" -f 1`
if [[ -e "$1./$NAME" || -e "$1./FHEM/$NAME" || -e "$1./$NAME.pm" || -e "$1./FHEM/$NAME.pm" ]]; then
# This is a FHEM internal Perl module
continue
fi
CHK=`perl -e "use $module" 2>1 >/dev/null`
ret=$?

if [ $ret != "0" ]; then
echo "Checking external module '$module' ... MISSING"
fi
done

0 comments on commit 58d4969

Please sign in to comment.