check_logfiles: 3.7.5.1
[omd.git] / packages / perl-modules / check_files
blob361f69da090c03228d14f4dd44de047488b0d7fb
1 #!/bin/bash
3 echo "checking for duplicate entries..."
4 sort Makefile | uniq -d | grep -v '^\s*$' | grep -v 'echo' | grep -v ' cd '
6 echo "checking src dir..."
7 for file in $(ls -1 src/ | sed 's/\-[0-9\-\.]*\.tar\.gz//g' | sort | uniq -d); do
8 echo "$file is listed twice in src/"
9 done
11 echo "checking for duplicate files..."
12 for file in $(grep 'tar.gz' Makefile | awk '{ print $1 }' | sed 's/\-[0-9\-\.]*\.tar\.gz//g' | sort | uniq -d); do
13 echo "$file is listed twice in Makefile"
14 done
16 echo "checking for unused files..."
17 for file in $(cd src && ls -1 *.gz *.tgz *.zip 2>/dev/null | grep -v JSON | grep -v common-sense | grep -v ExtUtils-MakeMaker | grep -v Module-CoreList- | grep -v Types-Serialiser- | grep -v parent- | grep -v version-); do
18 if [ $(grep -c "$file" Makefile) = 0 ]; then
19 echo "$file is not used anymore"
21 done
23 echo "checking for missing files..."
24 for file in $(grep 'tar.gz' Makefile | awk '{ print $1 }' | tr -d ';'); do
25 ls src/$file >/dev/null 2>&1
26 if [ $? -ne 0 ]; then
27 echo "$file is missing but used in Makefile"
29 done
31 echo "checking orphaned files..."
32 ./orphaned_modules ../thruk/Makefile.PL