summaryrefslogtreecommitdiff
path: root/debian/git-cleanup.sh
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2011-01-24 23:24:49 +0100
committerCyril Brulebois <kibi@debian.org>2011-01-24 23:24:49 +0100
commit15a8ed973ab6eb859ec4092840af92af94555c8c (patch)
treeb0d013a3dede784c537e88ebe6a7d5d0ae7bebc7 /debian/git-cleanup.sh
parentc8779188b255d0cba9daa5c10b0eec085144dc56 (diff)
downloadmesa-15a8ed973ab6eb859ec4092840af92af94555c8c.tar.gz
Add a git clean-up script.
Upstream tends to release tarballs which don't exactly match the files stored in git. Among other things, that leads dpkg-source to bail out, so let's make it easier to prepare a new upstream release by adding a script listing files known to be a problem. Usage: ./debian/git-cleanup.sh to list files. ./debian/git-cleanup.sh -f to remove them.
Diffstat (limited to 'debian/git-cleanup.sh')
-rwxr-xr-xdebian/git-cleanup.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/git-cleanup.sh b/debian/git-cleanup.sh
new file mode 100755
index 0000000000..d2ae8bc6c4
--- /dev/null
+++ b/debian/git-cleanup.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+# © 2011 Cyril Brulebois <kibi@debian.org>
+set -e
+
+# List broken symlinks:
+broken_symlinks=$(find -follow -type l)
+
+# Symlinks vs. directories:
+dirs_vs_symlinks='
+src/gallium/tests/graw/fragment-shader
+src/gallium/tests/graw/vertex-shader
+'
+
+# Modified binaries:
+binaries='
+src/gallium/state_trackers/d3d1x/progs/bin/d3d10tri.exe
+src/gallium/state_trackers/d3d1x/progs/bin/d3d11gears.exe
+src/gallium/state_trackers/d3d1x/progs/bin/d3d11spikysphere.exe
+src/gallium/state_trackers/d3d1x/progs/bin/d3d11tex.exe
+src/gallium/state_trackers/d3d1x/progs/bin/d3d11tri.exe
+src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-abs.png
+docs/gears.png
+'
+
+case $1 in
+ "") clean=0; echo "I: No parameter given, listing only (-f to remove).";;
+ "-f") clean=1; echo "I: Removing files.";;
+ *) clean=0; echo "I: Unknown parameter given, listing only (-f to remove).";;
+esac
+
+# Readibility:
+echo
+
+for x in $broken_symlinks $dirs_vs_symlinks $binaries; do
+ # Do not fail if the file went away already, only warn:
+ if [ -e $x -o -L $x ]; then
+ if [ $clean = 1 ]; then
+ git rm $x
+ else
+ echo "I: Would remove $x"
+ fi
+ else
+ echo "W: Unable to remove non-existing: $x"
+ fi
+done