ubuntu-dev-tools/suspicious-source
Siegfried-Angel Gevatter Pujals (RainCT) 8a755560ad Rewrote suspicious-source
2007-08-04 00:49:38 +02:00

49 lines
1.4 KiB
Bash
Executable File

#!/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
#
# 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.
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