File: fix_autogen

package info (click to toggle)
afterstep 2.2.9-5
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,392 kB
  • ctags: 32
  • sloc: makefile: 250; sh: 100
file content (19 lines) | stat: -rw-r--r-- 497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# vim: ts=3 et
# $Id: fix_autogen 251 2010-03-23 22:17:56Z robert $

set -e

[ -d debian ] || cd ..
[ -d debian ] || cd ..
[ -d debian ] || { echo "Can't find debian directory" ; exit 1; }

for pkg in "$@"; do
	fgrep -rl "### Generated from" debian/$pkg  2>/dev/null | while read f ; do
		echo "Removing bogus comment from $f"
		sed -e '/^### Generated from.*###$/d' < "$f" > "$f.tmp"
      chmod --reference="$f" "$f.tmp"
      touch --reference="$f" "$f.tmp"
		mv $f.tmp $f
	done
done