~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-updates

« back to all changes in this revision

Viewing changes to scripts/commit

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
# need a Posix shell, so we simply use bash
3
 
 
4
 
set -e
5
 
 
6
 
uid=`id -u`
7
 
date=`date`
8
 
name=$(awk -F: "\$3==$uid { print \$5 }" /etc/passwd )
9
 
addr="<`id -un`@`hostname -d`>"
10
 
 
11
 
for i in `find . -name Changes -print`; do
12
 
    dir=`dirname $i`
13
 
    if [ -s $dir/Changes ]; then
14
 
        awk '
15
 
        state == 0 && /^[ \t]*$/  { next }
16
 
        state == 0  { state = 1 }
17
 
        /^[ \t]*$/ { empty++; next }
18
 
                   { while ( empty > 0 ) { print ""; empty--; }; print  }
19
 
        ' < $dir/Changes > $dir/Changes.tmp
20
 
        if [ -s $dir/Changes.tmp ]; then
21
 
            lines=`wc -l <$dir/Changes.tmp`
22
 
            echo "$date  $name  $addr" >$dir/ChangeLog.new
23
 
            echo >>$dir/ChangeLog.new
24
 
            cat $dir/Changes.tmp   >>$dir/ChangeLog.new
25
 
            echo >>$dir/ChangeLog.new
26
 
            [ -f $dir/ChangeLog ] && cat $dir/ChangeLog >>$dir/ChangeLog.new
27
 
            echo -n > $dir/Changes
28
 
            [ -f $dir/ChangeLog ] && rm $dir/ChangeLog
29
 
            mv $dir/ChangeLog.new $dir/ChangeLog
30
 
            echo "$lines new lines in $dir/ChangeLog"
31
 
        fi
32
 
        rm $dir/Changes.tmp || true
33
 
    fi
34
 
done
35
 
 
36
 
# Execute canned cvs remove commands
37
 
for i in `find . -name cvs-remove -print`; do
38
 
    dir=`dirname $i`
39
 
    if [ -s $dir/cvs-remove ]; then
40
 
        here=`pwd`
41
 
        cd $dir
42
 
        if cvs remove -f `cat cvs-remove`; then
43
 
            rm cvs-remove
44
 
        fi
45
 
        cd $here
46
 
    fi
47
 
done
48
 
 
49
 
# Execute canned cvs add commands
50
 
for i in `find . -name cvs-add -print`; do
51
 
    dir=`dirname $i`
52
 
    if [ -s $dir/cvs-add ]; then
53
 
        here=`pwd`
54
 
        cd $dir
55
 
        if cvs add `cat cvs-add`; then
56
 
            rm cvs-add
57
 
        fi
58
 
        cd $here
59
 
    fi
60
 
done
61
 
 
62
 
cvs -z3 commit -m "See ChangeLog: $date  $name" $*
63