~ubuntu-branches/ubuntu/hardy/sbuild/hardy

« back to all changes in this revision

Viewing changes to bin/abort-current-build

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2005-04-01 21:23:30 UTC
  • mfrom: (1.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050401212330-lnjvuwrm9urpy54l
Tags: 0.35
Michael Banck:

* bin/abort-current-build: Remove the `-B' from the grep line as
  `sbuild -s' does not pass that option to dpkg-configure and abort-
  current-build fails in that case.
* sbuild: Set the locale to `POSIX' to make debconf and debhelper calls in
  the chroot not spew out locale warnings all the time.
  (closes: #287672)
* sbuild: Removed check for specific distributions. Instead, fail if
  build/chroot-$dist is not there.
* sbuild: Only override Distribution in .changes if specified as option on
  the command-line.
  (closes: #300145)
* sbuild: Specify full path for Dir::Etc::main and Dir::Etc::parts.
* example.sbuildrc: Clarify that $maintainer_name is not mandatory and
  overrides Maintainer: field, whereas $uploader_name overrides
  the Changed-By: field in changes.
* Applied patch by Santiago Vila:
  - Moves scripts from /usr/lib/sbuild to /usr/share/sbuild and modifies
    all callers accordingly.
  - Add -n option to tail to comply with POSIX.
  - Call /usr/sbin/sendmail instead of /usr/lib/sendmail.
  (closes: #292717)
* sbuild: Tolerate '0' as version number, thanks Santiago Vila.
  (closes: #300205)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
set -e
 
3
 
 
4
tmpfile=/tmp/abort-current-build.$$
 
5
set +e
 
6
ps xjww | egrep ' (/bin/sh /usr/bin/dpkg-buildpackage -us -uc |\(dpkg-buildpacka\))' >$tmpfile
 
7
set -e
 
8
n="`wc -l $tmpfile | awk '{print $1}'`" 
 
9
if [ "$n" -eq 0 ]; then
 
10
        echo "No dpkg-buildpackage process found" 1>&2
 
11
        rm -f $tmpfile
 
12
        exit 1
 
13
fi
 
14
if [ "$n" -ge 2 ]; then
 
15
        echo "More than one dpkg-buildpackage processes found:"
 
16
        echo ' PPID   PID  PGID   SID TTY TPGID  STAT  UID   TIME COMMAND'
 
17
        cat $tmpfile
 
18
        rm -f $tmpfile
 
19
        exit 1
 
20
fi
 
21
pgid=`awk '{print $3}' <$tmpfile`
 
22
echo "Killing pgid $pgid"
 
23
kill -15 -$pgid
 
24
rm -f $tmpfile
 
25
exit 0
 
26