ubuntu-dev-tools/suspicious-source

49 lines
1.4 KiB
Plaintext
Raw Normal View History

2007-08-04 00:49:38 +02:00
#!/bin/bash
2008-01-17 19:43:26 +01:00
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
2007-08-04 00:49:38 +02:00
# Based upon a script by Martin Pitt <martin.pitt@ubuntu.com>
# License: GPLv3 or later
#
# This script 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 "preferred 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 \
2007-10-21 11:53:01 +02:00
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 *.hh *.in"
2007-08-04 00:49:38 +02:00
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[@]}"
2007-08-04 00:49:38 +02:00
$COMMAND # Execute the command