Rewrote suspicious-source

This commit is contained in:
Siegfried-Angel Gevatter Pujals (RainCT) 2007-08-04 00:49:38 +02:00
parent 35e3a0be26
commit 8a755560ad
2 changed files with 48 additions and 6 deletions

6
README
View File

@ -10,3 +10,9 @@ check-symbols <package> [<directory>]
what-patch
... will check what patching system is used by a package.
You need to be in it's source directory in order that it works.
suspicious-source
... will output a list of files which are not common source files. This
should be run in the root of a source tree to find files which might
not be the 'prefered form of modification' that the GPL and other
licenses require.

View File

@ -1,12 +1,48 @@
#!/bin/sh -e
# Author: Martin Pitt <martin.pitt@ubuntu.com>
# License: GPL v2 or later
#!/bin/bash
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntuwire.com>
# Based upon a script by Martin Pitt <martin.pitt@ubuntu.com>
# License: GPL v3 or later
#
# Output a list of files which are not common source files. This
# Outputs a list of files which are not common source files. This
# should be run in the root of a source tree to find files which might
# not be the 'prefered form of modification' that the GPL and other
# licenses require.
find -type f ! \( -name '*.h' -o -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name Makefile -o -name configure -o -name '*.3' -o -name '*.html' -o -name '*.txt' -o -name '*.xml' -o -name Makefile.am -o -name Makefile.in -o -name '*.m4' -o -name config.sub -o -name config.guess -o -name ltmain.sh -o -name depcomp -o -name configure.ac -o -name *.py -o -name NEWS -o -name README -o -name INSTALL -o -name TODO -o -name ChangeLog -o -name '*.docbook' -o -name '*.png' -o -name '*.desktop' -o -name '*.ui' -o -name '*.po' -o -name '*.py' -o -name '*.svg' -o -name '*.bmp' -o -name '*.gif' -o -name '*.pot' -o -name '*.xpm' -o -name '*.glade' -o -name '*.gladep' \)
FILES="*.h *.c *.cc *.cpp *.py *.sh *.txt *.text *.3 *.m4 *.xml *.html *.php *.php3 *.php4 \
*.class *.form *.module *.cfg *.conf *.config *.odt *.odp *.tex *.sla *.scd \
Makefile Makefile.am Makefile.in configure configure.ac *.diff *.debdiff *.patch *.dpatch \
config.sub config.guess depcomp *.docbook *.desktop *.menu \
AUTHORS INSTALL NEWS README TODO COPYING LICENSE ChangeLog \
*.ui *.glade *.gladep *.po *.pot *.ts *.pro *.svg *.png *.bmp *.gif *.xpm"
IGNORE=".bzr CVS .svn debian"
COMMAND=(find ! \( )
firstDone=False
for pattern in $FILES
do
if [[ $firstDone != True ]]; then
COMMAND+=( -name $pattern); firstDone=True
else
COMMAND+=( -o -name $pattern)
fi
done
COMMAND+=( \) \( )
firstDone=False
for pattern in $IGNORE
do
if [[ $firstDone != True ]]; then
COMMAND+=( -name $pattern -prune); firstDone=True
else
COMMAND+=( -o -name $pattern -prune)
fi
done
COMMAND+=( -o -type f -print \))
COMMAND="${COMMAND[@]}"
$COMMAND # Execute the command