~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/utils/lit/lit/ShCommands.py

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class Command:
 
2
    def __init__(self, args, redirects):
 
3
        self.args = list(args)
 
4
        self.redirects = list(redirects)
 
5
 
 
6
    def __repr__(self):
 
7
        return 'Command(%r, %r)' % (self.args, self.redirects)
 
8
 
 
9
    def __cmp__(self, other):
 
10
        if not isinstance(other, Command):
 
11
            return -1
 
12
 
 
13
        return cmp((self.args, self.redirects),
 
14
                   (other.args, other.redirects))
 
15
 
 
16
    def toShell(self, file):
 
17
        for arg in self.args:
 
18
            if "'" not in arg:
 
19
                quoted = "'%s'" % arg
 
20
            elif '"' not in arg and '$' not in arg:
 
21
                quoted = '"%s"' % arg
 
22
            else:
 
23
                raise NotImplementedError,'Unable to quote %r' % arg
 
24
            print >>file, quoted,
 
25
 
 
26
            # For debugging / validation.
 
27
            import ShUtil
 
28
            dequoted = list(ShUtil.ShLexer(quoted).lex())
 
29
            if dequoted != [arg]:
 
30
                raise NotImplementedError,'Unable to quote %r' % arg
 
31
 
 
32
        for r in self.redirects:
 
33
            if len(r[0]) == 1:
 
34
                print >>file, "%s '%s'" % (r[0][0], r[1]),
 
35
            else:
 
36
                print >>file, "%s%s '%s'" % (r[0][1], r[0][0], r[1]),
 
37
 
 
38
class Pipeline:
 
39
    def __init__(self, commands, negate=False, pipe_err=False):
 
40
        self.commands = commands
 
41
        self.negate = negate
 
42
        self.pipe_err = pipe_err
 
43
 
 
44
    def __repr__(self):
 
45
        return 'Pipeline(%r, %r, %r)' % (self.commands, self.negate,
 
46
                                         self.pipe_err)
 
47
 
 
48
    def __cmp__(self, other):
 
49
        if not isinstance(other, Pipeline):
 
50
            return -1
 
51
 
 
52
        return cmp((self.commands, self.negate, self.pipe_err),
 
53
                   (other.commands, other.negate, self.pipe_err))
 
54
 
 
55
    def toShell(self, file, pipefail=False):
 
56
        if pipefail != self.pipe_err:
 
57
            raise ValueError,'Inconsistent "pipefail" attribute!'
 
58
        if self.negate:
 
59
            print >>file, '!',
 
60
        for cmd in self.commands:
 
61
            cmd.toShell(file)
 
62
            if cmd is not self.commands[-1]:
 
63
                print >>file, '|\n ',
 
64
 
 
65
class Seq:
 
66
    def __init__(self, lhs, op, rhs):
 
67
        assert op in (';', '&', '||', '&&')
 
68
        self.op = op
 
69
        self.lhs = lhs
 
70
        self.rhs = rhs
 
71
 
 
72
    def __repr__(self):
 
73
        return 'Seq(%r, %r, %r)' % (self.lhs, self.op, self.rhs)
 
74
 
 
75
    def __cmp__(self, other):
 
76
        if not isinstance(other, Seq):
 
77
            return -1
 
78
 
 
79
        return cmp((self.lhs, self.op, self.rhs),
 
80
                   (other.lhs, other.op, other.rhs))
 
81
 
 
82
    def toShell(self, file, pipefail=False):
 
83
        self.lhs.toShell(file, pipefail)
 
84
        print >>file, ' %s\n' % self.op
 
85
        self.rhs.toShell(file, pipefail)