-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
3 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |