File: fix_autogen

package info (click to toggle)
afterstep 2.2.12-18.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 33,184 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,094; perl: 1,558; cpp: 811
file content (19 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (7)
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 264 2011-01-23 12:58:09Z 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 autogen 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