~ubuntu-branches/ubuntu/natty/firefox/natty-updates

« back to all changes in this revision

Viewing changes to debian/compare-locales/scripts/test-locales

  • Committer: Package Import Robot
  • Author(s): Chris Coulson, Chris Coulson, Jamie Strandboge
  • Date: 2012-06-01 18:31:55 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120601183155-4q12f7adnllql614
Tags: 13.0+build1-0ubuntu0.11.04.1
* New upstream stable release (FIREFOX_13_0_BUILD1)
  - see LP: #1007495 for USN information

[ Chris Coulson <chris.coulson@canonical.com> ]
* Update globalmenu-extension to 3.2.3
  - Reduce our memory footprint a bit, which wasn't really a lot anyway
  - Avoid the use of the component manager for accessing commonly used
    services, where "commonly used" means "accessed when building every
    menu item". This should save some CPU cycles when building or
    refreshing menus
  - Try to recycle menuitems when they are removed from a menu by
    adding contiguous blocks of removed items to a "free list" which
    is emptied asynchronously, and reusing the items in this list when
    new items are added in place of the removed items. This means that
    refreshing the history menu contents when the menu is opened no
    longer alters the menu structure, but results in a shifting of
    properties between existing nodes instead. This has a few benefits:
    + With no layout changes, unity-panel-service doesn't request
      the entire menu structure, which significantly reduces dbus traffic
      and makes it much faster to refresh the menu contents
    + The size of the menu doesn't change when it is refreshed, which
      eliminates the flicker that used to occur when opening the history
      menu.
  - Remove all use of the global observer service for sending our own
    internal notifications around
  - Clean up the way we ensure that the correct edit commands are
    enabled by just installing our own onpopupshowing handler rather
    than using an additional notification to fix things up after the
    default handler runs
  - Get rid of a static initializer
  - Don't support older than Firefox 11
  - Fix some GError leaks
  - Hide the internal menu when creating a native menu, rather than
    waiting for confirmation that the native menu is registered
    successfully. We don't try to create a native menu if we don't
    find a menu service to register the menu with anyway
  - Keep menu contents updated whilst the menu is open, rather than
    just whilst it is opening
  - Fix LP: #915888 - Handling of checkbox menuitems with a command
    node is wrong
* Refresh build-depends:
  - Bump minimum GTK version to 2.14 as we build with GIO support
  - Add minimum requirement for glib (2.18)
  - Drop libidl-dev, this doesn't appear to be needed now
  - Bump minimum NSPR version to 4.9.0 for --enable-system-nspr builds
  - Bump minimum sqlite version to 3.7.10 for --enable-system-sqlite
    builds
  - Bump minimum NSS version to 3.13.2 for --enable-system-nss builds
* Refresh patches:
  - update debian/patches/ubuntu-ua-string-changes.patch
  - update debian/patches/ubuntu-codes-google.patch
  - update debian/patches/firefox-kde.patch
  - update debian/patches/mozilla-kde.patch
  - update debian/patches/dont-include-hyphenation-patterns.patch
* Clean up the file exclude list and add comments for excluded files
  - update debian/build/create-tarball.py
* Make it easy to run Firefox in valgrind for builds that are compiled
  with explicit valgrind support
  - update debian/firefox.sh.in
* Bump debhelper compat to 7
  - update debian/apport/blacklist.in
  - update debian/apport/source_firefox.py.in
  - update debian/compat
  - update debian/config/mozconfig.in
  - update debian/control.in
  - update debian/firefox-dev.install.in
  - update debian/firefox-dev.links.in
  - update debian/firefox-globalmenu.dirs.in
  - update debian/firefox-gnome-support.install.in
  - update debian/firefox.dirs.in
  - update debian/firefox.install.in
  - update debian/firefox.links.in
  - update debian/firefox.postinst.in
  - update debian/firefox.preinst.in
  - update debian/firefox.sh.in
  - update debian/pkgconfig/libxul.pc.in
  - update debian/pkgconfig/mozilla-nspr.pc.in
  - update debian/pkgconfig/mozilla-plugin.pc.in
  - update debian/rules
  - update debian/usr.bin.firefox.apparmor.10.04
  - update debian/usr.bin.firefox.apparmor.10.10
  - update debian/usr.bin.firefox.apparmor.11.04
  - update debian/usr.bin.firefox.apparmor.9.10
* Override 2 embedded-library lintian errors
  - update debian/firefox.lintian-overrides.in
* Drop debian/patches/distro-locale-searchplugins after landing of
  bmo: #515232
* Don't hardcode general.useragent.locale to en-US, now that it's used
  for searchplugin localization. This means we can drop this pref from
  ubufox
  - add debian/patches/dont-override-general-useragent-locale.patch
  - update debian/patches/series
* Drop patches fixed upstream
  - remove debian/patches/no-sps-profiler-on-unsupported-archs.patch
  - remove debian/patches/avoid-dbus-roundtrip-for-httpchannel.patch
  - update debian/patches/series
* Apport hook improvements:
  - Add support for reporting preference defaults that are set by extensions
  - When reporting preferences, record the source of each preference
  - Report plugin packages for plugins that are installed with the
    package manager
  - Add some addon manager related prefs to the whitelist
  - Display additional metadata in the extensions report
  - Take "default-to-compatible" in to account when determining whether
    the user is running incompatible addons
  - Attach submitted crash ID's to bug reports
  - Report if files in the profile folder have broken permissions
* Update compare-locales to 0.9.5
* Fix make-makefile test failure when the build directory contains
  perl regexp control characters
  - add debian/patches/make-makefile-test-fix.patch
  - update debian/patches/series
* Fix for NSS libs not being signed, breaking FIPS
  - update debian/rules

[ Jamie Strandboge <jamie@ubuntu.com> ]
* adjust apparmor profile to deny reads to @{PROC}/[0-9]*/net/dev. Patch 
  thanks to James Troup (LP: #955066)
* adjust apparmor profile to deny reads to @{PROC}/[0-9]*/net/wireless.
  Patch thanks to James Troup (LP: #974141)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! python
2
 
# ***** BEGIN LICENSE BLOCK *****
3
 
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
 
#
5
 
# The contents of this file are subject to the Mozilla Public License Version
6
 
# 1.1 (the "License"); you may not use this file except in compliance with
7
 
# the License. You may obtain a copy of the License at
8
 
# http://www.mozilla.org/MPL/
9
 
#
10
 
# Software distributed under the License is distributed on an "AS IS" basis,
11
 
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 
# for the specific language governing rights and limitations under the
13
 
# License.
14
 
#
15
 
# The Original Code is l10n test automation.
16
 
#
17
 
# The Initial Developer of the Original Code is
18
 
# Mozilla Foundation
19
 
# Portions created by the Initial Developer are Copyright (C) 2006
20
 
# the Initial Developer. All Rights Reserved.
21
 
#
22
 
# Contributor(s):
23
 
#       Axel Hecht <l10n@mozilla.com>
24
 
#
25
 
# Alternatively, the contents of this file may be used under the terms of
26
 
# either the GNU General Public License Version 2 or later (the "GPL"), or
27
 
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
 
# in which case the provisions of the GPL or the LGPL are applicable instead
29
 
# of those above. If you wish to allow use of your version of this file only
30
 
# under the terms of either the GPL or the LGPL, and not to allow others to
31
 
# use your version of this file under the terms of the MPL, indicate your
32
 
# decision by deleting the provisions above and replace them with the notice
33
 
# and other provisions required by the GPL or the LGPL. If you do not delete
34
 
# the provisions above, a recipient may use your version of this file under
35
 
# the terms of any one of the MPL, the GPL or the LGPL.
36
 
#
37
 
# ***** END LICENSE BLOCK *****
38
 
 
39
 
 
40
 
import logging
41
 
import sys
42
 
import os
43
 
import os.path
44
 
from datetime import datetime
45
 
import time
46
 
from optparse import OptionParser
47
 
import gzip
48
 
import codecs
49
 
 
50
 
from Mozilla import Parser, CompareLocales, Paths, Tests
51
 
import simplejson
52
 
 
53
 
#
54
 
# Helper classes
55
 
#
56
 
 
57
 
#
58
 
# Logging
59
 
#
60
 
class LogHandler(logging.Handler):
61
 
  def __init__(self):
62
 
    self.log = []
63
 
    logging.Handler.__init__(self)
64
 
  def emit(self, record):
65
 
    self.log.append((record.name, record.levelname, record.getMessage().strip()))
66
 
 
67
 
#
68
 
# JSON with optional gzip
69
 
#
70
 
class Wrapper:
71
 
  def __init__(self, path, name):
72
 
    self.p = os.path.join(path, name)
73
 
    self.n = name
74
 
    self.f = None
75
 
    if opts.gzip:
76
 
      self.p += '.gz'
77
 
  def open(self, mode):
78
 
    if self.f:
79
 
      self.f.close()
80
 
    if opts.gzip:
81
 
      mode += 'b'
82
 
    self.f = open(self.p, mode)
83
 
    if opts.gzip:
84
 
      self.f = gzip.GzipFile(fileobj = self.f, filename = self.n)
85
 
    self.w = codecs.getwriter('utf-8')(self.f)
86
 
    self.r = codecs.getreader('utf-8')(self.f)
87
 
  def write(self, str):
88
 
    self.w.write(str)
89
 
  def read(self, size = -1):
90
 
    return self.r.read(size)
91
 
  def rewind(self):
92
 
    if opts.gzip:
93
 
      self.f.rewind()
94
 
    else:
95
 
      self.f.seek(0,0)
96
 
  def close(self):
97
 
    if opts.gzip:
98
 
      f = self.f.fileobj;
99
 
    self.f.close()
100
 
    if opts.gzip:
101
 
      f.close()
102
 
    self.w = self.r = self.f = None
103
 
#
104
 
# Helper function for JSON output with optional gzip
105
 
#
106
 
def saveJSON(dic, localName):
107
 
  name = os.path.join(basePath, localName) ;
108
 
  if opts.gzip:
109
 
    f = open(name + '.gz', 'wb')
110
 
    s = gzip.GzipFile(fileobj = f, filename = localName)
111
 
  else:
112
 
    f = open(name, 'w')
113
 
    s = f
114
 
  sw = codecs.getwriter('utf-8')(s)
115
 
  sw.write(simplejson.dumps(dic, sort_keys=True))
116
 
  sw.reset()
117
 
  if opts.gzip:
118
 
    s.close()
119
 
  f.close()
120
 
 
121
 
 
122
 
lvl = logging.WARNING
123
 
date = datetime.utcnow().replace(second=0,microsecond=0).isoformat(' ')
124
 
# parse commandline arguments
125
 
cp = OptionParser(version='0.2')
126
 
cp.add_option('-v', '--verbose', action='count', dest='v', default=0,
127
 
              help='Make more noise')
128
 
cp.add_option('-q', '--quiet', action='count', dest='q', default=0,
129
 
              help='Make less noise')
130
 
cp.add_option('-O', '--base-dir', type='string', dest='target',
131
 
              default='results',
132
 
              help='Destination base directory')
133
 
cp.add_option('-c', '--checkout', action='store_true', dest='checkout',
134
 
              default=False,
135
 
              help='Run make -f client.mk l10n-checkout [Default: not]')
136
 
cp.add_option('-d', '--date', type='string', dest='date',
137
 
              help='Explicit start date or subdir [Default: now]')
138
 
cp.add_option('-z',action="store_true", dest="gzip", default=False,
139
 
              help='Use gzip compression for output')
140
 
cp.add_option('-w','--enable-waterfall', action="store_true",
141
 
              dest="waterfall", default=False,
142
 
              help='Update waterfall data')
143
 
cp.add_option('--end-date', type='string', dest='enddate',
144
 
              help='Explicit (faked) end date')
145
 
opts, optlist = cp.parse_args(sys.argv[1:])
146
 
 
147
 
#
148
 
# Set up Logging
149
 
#
150
 
logging.basicConfig(level=(logging.WARNING + 10*(opts.q - opts.v)))
151
 
# Add a handler to store the output
152
 
h = LogHandler()
153
 
logging.getLogger('').addHandler(h)
154
 
 
155
 
#
156
 
# Check that we're in the right location and check out if requested
157
 
#
158
 
try:
159
 
  os.chdir('mozilla')
160
 
  if opts.checkout:
161
 
    env = ''
162
 
    l = logging.getLogger('cvsco')
163
 
    if opts.date:
164
 
      env = 'MOZ_CO_DATE="' + opts.date + ' +0" '
165
 
    fh = os.popen(env + 'make -f client.mk l10n-checkout')
166
 
    for ln in fh:
167
 
      l.info(ln.strip())
168
 
    if fh.close():
169
 
      raise Exception('cvs checkout failed')
170
 
  os.chdir('..')
171
 
except Exception,e:
172
 
  sys.exit(str(e))
173
 
 
174
 
if not opts.date:
175
 
  opts.date = date # use default set above
176
 
 
177
 
logging.debug(' Ensure output directory')
178
 
# replace : with -
179
 
opts.date = opts.date.replace(':','-')
180
 
if not os.path.isdir(opts.target):
181
 
  sys.exit('error: ' + opts.target + ' is not a directory')
182
 
if opts.waterfall:
183
 
  startdate = time.mktime(time.strptime(opts.date, '%Y-%m-%d %H-%M-%S')) + time.altzone
184
 
basePath = os.path.join(opts.target, opts.date)
185
 
if not os.path.isdir(basePath):
186
 
  os.mkdir(basePath)
187
 
 
188
 
 
189
 
tests = [Tests.CompareTest(),
190
 
         Tests.SearchTest(),
191
 
         Tests.RSSReaderTest()]
192
 
# disable bookmarks test, that's hard to fix. XXX
193
 
#         Tests.BookmarksTest()]
194
 
drop = {}
195
 
for test in tests:
196
 
  res = test.run()
197
 
  test.serialize(res, saveJSON)
198
 
  if opts.waterfall:
199
 
    test.failureTest(res, drop)
200
 
 
201
 
if not opts.waterfall:
202
 
  saveJSON(h.log, 'buildlog.json')
203
 
  sys.exit()
204
 
 
205
 
 
206
 
if opts.enddate:
207
 
  endtime = time.mktime(time.strptime(opts.enddate, '%Y-%m-%d %H:%M:%S')) + time.altzone
208
 
else:
209
 
  endtime = time.mktime(datetime.now().timetuple())
210
 
f = None
211
 
w = Wrapper(opts.target, 'waterfall.json')
212
 
if os.path.isfile(w.p):
213
 
  w.open('r')
214
 
  water = simplejson.load(w)
215
 
else:
216
 
  water = []
217
 
 
218
 
water.append((opts.date, (startdate, endtime), drop))
219
 
#
220
 
# Check if we need to rotate the waterfall
221
 
#
222
 
rotateLen = 24
223
 
if len(water) > rotateLen * 1.5:
224
 
  # rotate, maximum of 16 logs
225
 
  suffix = ''
226
 
  if opts.gzip:
227
 
    suffix = '.gz'
228
 
  fnames = [os.path.join(opts.target, 'waterfall-%x.json'%i) + suffix for i in range(16)]
229
 
  # remove oldest log
230
 
  if os.path.isfile(fnames[15]):
231
 
    os.remove(fnames[15])
232
 
  for l in range(14, -1, -1):
233
 
    if os.path.isfile(fnames[l]):
234
 
      os.rename(fnames[l], fnames[l+1])
235
 
  w0 = Wrapper('.', fnames[0])
236
 
  w0.open('w')
237
 
  simplejson.dump(water[:rotateLen], w0, sort_keys=True)
238
 
  w0.close()
239
 
  water = water[rotateLen:]
240
 
 
241
 
w.open('w')
242
 
simplejson.dump(water, w, sort_keys=True)
243
 
w.close()
244
 
 
245
 
saveJSON(h.log, 'buildlog.json')