~ubuntu-branches/ubuntu/hardy/devscripts/hardy-security

« back to all changes in this revision

Viewing changes to scripts/wnpp-alert.sh

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-11-11 08:14:51 UTC
  • Revision ID: james.westby@ubuntu.com-20071111081451-zv0qc4kuurls0kyz
Tags: 2.10.10ubuntu1
* Merge from Debian unstable.
* Remaining Ubuntu changes:
  - debian/control:
    + DebianMaintainerField foo.
    + Build-depend on lsb-release.
  - debian/rules:
    + Actually run tests in test-stamp target.
  - scripts/debchange.1:
    + Add info about --security option.
  - scripts/debchange.pl:
    + Add --security option, which acts like --nmu, but adds security update
      template instead of NMU template to changelog.
    + Add -U/--upstream flag that forces original "just increment
      the end" behaviour; Ubuntu is upstream for some pieces of software.
    + Add --distributor= to override lsb_release output.
    + Default to "hardy" as distribution.
    + Add "ubuntu1" to version string for new versions.
  - scripts/debuild.pl:
    + Preserve DEBEMAIL environment variable inside debuild.
    + Enforce Ubuntu merge policy.
  - test/debchange.pl:
    + Test for debchange.pl
* Change the default URL parameter of rmadison to be ubuntu. The old
  behaviour can be used by 'rmadison -u debian'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
PROGNAME=`basename $0`
17
17
CACHEDIR=~/.devscripts_cache
 
18
CACHEDDIFF="${CACHEDIR}/wnpp-diff"
18
19
 
19
20
usage () { echo \
20
21
"Usage: $PROGNAME [--help|-h|--version|-v]
31
32
Modifications: Julian Gilbey <jdg@debian.org>"
32
33
}
33
34
 
 
35
wnppdiff () {
 
36
    if [ ! -f "$CACHEDDIFF" ]; then
 
37
        # First use
 
38
        comm -12 $WNPP_PACKAGES $INSTALLED | sed -e 's/+/\\+/g' | \
 
39
          xargs -i egrep '^[A-Z]+ [0-9]+ {} ' $WNPP | \
 
40
          tee $CACHEDDIFF
 
41
    else
 
42
        comm -12 $WNPP_PACKAGES $INSTALLED | sed -e 's/+/\\+/g' | \
 
43
          xargs -i egrep '^[A-Z]+ [0-9]+ {} ' $WNPP > $WNPP_DIFF
 
44
        sort -o $CACHEDDIFF $CACHEDDIFF
 
45
        sort -o $WNPP_DIFF $WNPP_DIFF
 
46
        comm -3 $CACHEDDIFF $WNPP_DIFF | \
 
47
          sed -e 's/\t/\+/g' -e 's/^\([^+]\)/-\1/g'
 
48
        mv $WNPP_DIFF $CACHEDDIFF
 
49
    fi
 
50
}
 
51
 
34
52
if [ "x$1" = "x--help" -o "x$1" = "x-h" ]; then usage; exit 0; fi
35
53
if [ "x$1" = "x--version" -o "x$1" = "x-v" ]; then version; exit 0; fi
36
54
 
55
73
trap "rm -f '$INSTALLED' '$WNPP' '$WNPPTMP' '$WNPP_PACKAGES'" \
56
74
  0 1 2 3 7 10 13 15
57
75
 
 
76
if [ "x$1" = "x--diff" ] || [ "x$1" = "x-d" ]; then
 
77
    WNPP_DIFF=`mktemp -t wnppalert-wnpp_diff.XXXXXX`
 
78
    trap "rm -f '$INSTALLED' '$WNPP' '$WNPPTMP' '$WNPP_PACKAGES' '$WNPP_DIFF'" \
 
79
      0 1 2 3 7 10 13 15
 
80
fi
 
81
 
58
82
# Here's a really sly sed script.  Rather than first grepping for
59
83
# matching lines and then processing them, this attempts to sed
60
84
# every line; those which succeed execute the 'p' command, those
86
110
sort -u \
87
111
> $INSTALLED
88
112
 
 
113
if [ "x$1" = "x--diff" -o "x$1" = "x-d" ]; then 
 
114
    if [ -d "$CACHEDIR" ]; then
 
115
        wnppdiff
 
116
        exit 0
 
117
    else
 
118
        echo "$PROGNAME: Unable to create diff; displaying full output" 
 
119
    fi
 
120
fi
 
121
 
89
122
comm -12 $WNPP_PACKAGES $INSTALLED | sed -e 's/+/\\+/g' | \
90
123
xargs -i egrep '^[A-Z]+ [0-9]+ {} ' $WNPP