mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 877733 - bump mozinfo, mozprocess, mozdevice, mozinstall version and mirror to m-c;r=jmaher
--HG-- extra : rebase_source : d8a76eed73309af2bbd696544e667ae104bf22a8
This commit is contained in:
parent
dab3cd5c03
commit
27dbe62709
@ -147,7 +147,9 @@ def parse_versions(*args):
|
||||
return retval
|
||||
|
||||
def version_tag(directory, version):
|
||||
return '%s-%s' % (directory, version)
|
||||
"""return a version tag string given the directory name of the package"""
|
||||
package = current_package_info[directory]['name']
|
||||
return '%s-%s' % (package, version)
|
||||
|
||||
def setup(**kwargs):
|
||||
"""monkey-patch function for setuptools.setup"""
|
||||
@ -321,7 +323,7 @@ def main(args=sys.argv[1:]):
|
||||
|
||||
tag = version_tag(directory, version)
|
||||
if tag not in _tags:
|
||||
error("Tag for '%s' -- %s -- not in tags")
|
||||
error("Tag for '%s' -- %s -- not in tags:\n%s" % (directory, version, '\n'.join(sorted(_tags))))
|
||||
|
||||
# ensure that the versions to mirror are compatible with what is in m-c
|
||||
old_package_info = current_package_info.copy()
|
||||
@ -376,6 +378,7 @@ def main(args=sys.argv[1:]):
|
||||
|
||||
finally:
|
||||
# cleanup
|
||||
if options.check:
|
||||
revert(hg_root, untracked)
|
||||
shutil.rmtree(tempdir)
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
PACKAGE_VERSION = '0.6'
|
||||
PACKAGE_VERSION = '0.7'
|
||||
|
||||
# dependencies
|
||||
deps = ['mozfile >= 0.3',
|
||||
|
@ -1,62 +0,0 @@
|
||||
Throughout [mozmill](https://developer.mozilla.org/en/Mozmill)
|
||||
and other Mozilla python code, checking the underlying
|
||||
platform is done in many different ways. The various checks needed
|
||||
lead to a lot of copy+pasting, leaving the reader to wonder....is this
|
||||
specific check necessary for (e.g.) an operating system? Because
|
||||
information is not consolidated, checks are not done consistently, nor
|
||||
is it defined what we are checking for.
|
||||
|
||||
[MozInfo](https://github.com/mozilla/mozbase/tree/master/mozinfo)
|
||||
proposes to solve this problem. MozInfo is a bridge interface,
|
||||
making the underlying (complex) plethora of OS and architecture
|
||||
combinations conform to a subset of values of relavence to
|
||||
Mozilla software. The current implementation exposes relavent key,
|
||||
values: `os`, `version`, `bits`, and `processor`. Additionally, the
|
||||
service pack in use is available on the windows platform.
|
||||
|
||||
|
||||
# API Usage
|
||||
|
||||
MozInfo is a python package. Downloading the software and running
|
||||
`python setup.py develop` will allow you to do `import mozinfo`
|
||||
from python.
|
||||
[mozinfo.py](https://github.com/mozilla/mozbase/blob/master/mozinfo/mozinfo.py)
|
||||
is the only file contained is this package,
|
||||
so if you need a single-file solution, you can just download or call
|
||||
this file through the web.
|
||||
|
||||
The top level attributes (`os`, `version`, `bits`, `processor`) are
|
||||
available as module globals:
|
||||
|
||||
if mozinfo.os == 'win': ...
|
||||
|
||||
In addition, mozinfo exports a dictionary, `mozinfo.info`, that
|
||||
contain these values. mozinfo also exports:
|
||||
|
||||
- `choices`: a dictionary of possible values for os, bits, and
|
||||
processor
|
||||
- `main`: the console_script entry point for mozinfo
|
||||
- `unknown`: a singleton denoting a value that cannot be determined
|
||||
|
||||
`unknown` has the string representation `"UNKNOWN"`. unknown will evaluate
|
||||
as `False` in python:
|
||||
|
||||
if not mozinfo.os: ... # unknown!
|
||||
|
||||
|
||||
# Command Line Usage
|
||||
|
||||
MozInfo comes with a command line, `mozinfo` which may be used to
|
||||
diagnose one's current system.
|
||||
|
||||
Example output:
|
||||
|
||||
os: linux
|
||||
version: Ubuntu 10.10
|
||||
bits: 32
|
||||
processor: x86
|
||||
|
||||
Three of these fields, os, bits, and processor, have a finite set of
|
||||
choices. You may display the value of these choices using
|
||||
`mozinfo --os`, `mozinfo --bits`, and `mozinfo --processor`.
|
||||
`mozinfo --help` documents command-line usage.
|
@ -2,4 +2,53 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
interface to transform introspected system information to a format palatable to
|
||||
Mozilla
|
||||
|
||||
Module variables:
|
||||
|
||||
.. attribute:: bits
|
||||
|
||||
32 or 64
|
||||
|
||||
.. attribute:: isBsd
|
||||
|
||||
Returns ``True`` if the operating system is BSD
|
||||
|
||||
.. attribute:: isLinux
|
||||
|
||||
Returns ``True`` if the operating system is Linux
|
||||
|
||||
.. attribute:: isMac
|
||||
|
||||
Returns ``True`` if the operating system is Mac
|
||||
|
||||
.. attribute:: isWin
|
||||
|
||||
Returns ``True`` if the operating system is Windows
|
||||
|
||||
.. attribute:: os
|
||||
|
||||
Operating system [``'win'``, ``'mac'``, ``'linux'``, ...]
|
||||
|
||||
.. attribute:: processor
|
||||
|
||||
Processor architecture [``'x86'``, ``'x86_64'``, ``'ppc'``, ...]
|
||||
|
||||
.. attribute:: version
|
||||
|
||||
Operating system version string. For windows, the service pack information is also included
|
||||
|
||||
.. attribute:: info
|
||||
|
||||
Returns information identifying the current system.
|
||||
|
||||
* :attr:`bits`
|
||||
* :attr:`os`
|
||||
* :attr:`processor`
|
||||
* :attr:`version`
|
||||
|
||||
"""
|
||||
|
||||
from mozinfo import *
|
||||
|
@ -4,19 +4,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
file for interface to transform introspected system information to a format
|
||||
pallatable to Mozilla
|
||||
|
||||
Information:
|
||||
- os : what operating system ['win', 'mac', 'linux', ...]
|
||||
- bits : 32 or 64
|
||||
- processor : processor architecture ['x86', 'x86_64', 'ppc', ...]
|
||||
- version : operating system version string
|
||||
|
||||
For windows, the service pack information is also included
|
||||
"""
|
||||
|
||||
# TODO: it might be a good idea of adding a system name (e.g. 'Ubuntu' for
|
||||
# linux) to the information; I certainly wouldn't want anyone parsing this
|
||||
# information and having behaviour depend on it
|
||||
@ -26,6 +13,13 @@ import platform
|
||||
import re
|
||||
import sys
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
|
||||
import mozfile
|
||||
|
||||
# keep a copy of the os module since updating globals overrides this
|
||||
_os = os
|
||||
|
||||
@ -58,6 +52,9 @@ if system in ["Microsoft", "Windows"]:
|
||||
service_pack = os.sys.getwindowsversion()[4]
|
||||
info['service_pack'] = service_pack
|
||||
elif system == "Linux":
|
||||
if hasattr(platform, "linux_distribution"):
|
||||
(distro, version, codename) = platform.linux_distribution()
|
||||
else:
|
||||
(distro, version, codename) = platform.dist()
|
||||
version = "%s %s" % (distro, version)
|
||||
if not processor:
|
||||
@ -111,7 +108,15 @@ def sanitize(info):
|
||||
|
||||
# method for updating information
|
||||
def update(new_info):
|
||||
"""update the info"""
|
||||
"""Update the info.
|
||||
new_info can either be a dict or a path/url
|
||||
to a json file containing a dict."""
|
||||
|
||||
if isinstance(new_info, basestring):
|
||||
f = mozfile.load(new_info)
|
||||
new_info = json.loads(f.read())
|
||||
f.close()
|
||||
|
||||
info.update(new_info)
|
||||
sanitize(info)
|
||||
globals().update(info)
|
||||
@ -144,21 +149,12 @@ def main(args=None):
|
||||
|
||||
# args are JSON blobs to override info
|
||||
if args:
|
||||
try:
|
||||
from json import loads
|
||||
except ImportError:
|
||||
try:
|
||||
from simplejson import loads
|
||||
except ImportError:
|
||||
def loads(string):
|
||||
"""*really* simple json; will not work with unicode"""
|
||||
return eval(string, {'true': True, 'false': False, 'null': None})
|
||||
for arg in args:
|
||||
if _os.path.exists(arg):
|
||||
string = file(arg).read()
|
||||
else:
|
||||
string = arg
|
||||
update(loads(string))
|
||||
update(json.loads(string))
|
||||
|
||||
# print out choices if requested
|
||||
flag = False
|
||||
|
@ -2,21 +2,12 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
import os
|
||||
from setuptools import setup
|
||||
|
||||
PACKAGE_VERSION = '0.4'
|
||||
|
||||
# get documentation from the README
|
||||
try:
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
description = file(os.path.join(here, 'README.md')).read()
|
||||
except (OSError, IOError):
|
||||
description = ''
|
||||
PACKAGE_VERSION = '0.5'
|
||||
|
||||
# dependencies
|
||||
deps = []
|
||||
deps = ['mozfile >= 0.6']
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
@ -24,8 +15,8 @@ except ImportError:
|
||||
|
||||
setup(name='mozinfo',
|
||||
version=PACKAGE_VERSION,
|
||||
description="file for interface to transform introspected system information to a format pallatable to Mozilla",
|
||||
long_description=description,
|
||||
description="Library to get system information for use in Mozilla testing",
|
||||
long_description="see http://mozbase.readthedocs.org",
|
||||
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
keywords='mozilla',
|
||||
author='Mozilla Automation and Testing Team',
|
||||
|
@ -1,60 +0,0 @@
|
||||
[Mozinstall](https://github.com/mozilla/mozbase/tree/master/mozinstall) is a
|
||||
python package for installing and uninstalling Mozilla applications on
|
||||
various platforms.
|
||||
|
||||
For example, depending on the platform, Firefox can be distributed as a
|
||||
zip, tar.bz2, exe, or dmg file or cloned from a repository. Mozinstall takes
|
||||
the hassle out of extracting and/or running these files and for convenience
|
||||
returns the full path to the install directory. In the case that mozinstall
|
||||
is invoked from the command line, the binary path will be printed to stdout.
|
||||
|
||||
To remove an installed application the uninstaller can be used. It requires
|
||||
the installation path of the application and will remove all the installed
|
||||
files. On Windows the uninstaller will be tried first.
|
||||
|
||||
# Usage
|
||||
Mozinstall can be used as API or via the CLI commands.
|
||||
|
||||
## API
|
||||
An application can be installed by running the commands below. The install
|
||||
method will return the installation path of the application.
|
||||
|
||||
import mozinstall
|
||||
path = mozinstall.install(%installer%, %install_folder%)
|
||||
|
||||
To retrieve the real binary call get_binary with the path and
|
||||
the application name as arguments:
|
||||
|
||||
mozinstall.get_binary(path, 'firefox')
|
||||
|
||||
If the application is not needed anymore the uninstaller will remove all
|
||||
traces from the system:
|
||||
|
||||
mozinstall.uninstall(path)
|
||||
|
||||
## CLI
|
||||
The installer can also be used as a command line tool:
|
||||
|
||||
$ mozinstall -d firefox %installer%
|
||||
|
||||
Whereby the directory option is optional and will default to the current
|
||||
working directory. If the installation was successful the path to the
|
||||
binary will be printed to stdout.
|
||||
|
||||
Also the uninstaller can be called via the command line:
|
||||
|
||||
$ mozuninstall %install_path%
|
||||
|
||||
# Error Handling
|
||||
|
||||
Mozinstall throws different types of exceptions:
|
||||
|
||||
- mozinstall.InstallError is thrown when the installation fails for any reason. A traceback is provided.
|
||||
- mozinstall.InvalidBinary is thrown when the binary cannot be found.
|
||||
- mozinstall.InvalidSource is thrown when the source is not a recognized file type (zip, exe, tar.bz2, tar.gz, dmg).
|
||||
|
||||
|
||||
# Dependencies
|
||||
|
||||
Mozinstall depends on the [mozinfo](https://github.com/mozilla/mozbase/tree/master/mozinfo)
|
||||
package which is also found in the mozbase repository.
|
@ -11,17 +11,16 @@ try:
|
||||
except IOError:
|
||||
description = None
|
||||
|
||||
PACKAGE_VERSION = '1.4'
|
||||
PACKAGE_VERSION = '1.6'
|
||||
|
||||
deps = ['mozinfo == 0.4',
|
||||
deps = ['mozinfo >= 0.4',
|
||||
'mozfile'
|
||||
]
|
||||
|
||||
setup(name='mozInstall',
|
||||
version=PACKAGE_VERSION,
|
||||
description="This is a utility package for installing and uninstalling "
|
||||
"Mozilla applications on various platforms.",
|
||||
long_description=description,
|
||||
description="package for installing and uninstalling Mozilla applications",
|
||||
long_description="see http://mozbase.readthedocs.org/",
|
||||
# Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
classifiers=['Environment :: Console',
|
||||
'Intended Audience :: Developers',
|
||||
@ -40,10 +39,14 @@ setup(name='mozInstall',
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
install_requires=deps,
|
||||
# we have to generate two more executables for those systems that cannot run as Administrator
|
||||
# and the filename containing "install" triggers the UAC
|
||||
entry_points="""
|
||||
# -*- Entry points: -*-
|
||||
[console_scripts]
|
||||
mozinstall = mozinstall:install_cli
|
||||
mozuninstall = mozinstall:uninstall_cli
|
||||
moz_add_to_system = mozinstall:install_cli
|
||||
moz_remove_from_system = mozinstall:uninstall_cli
|
||||
""",
|
||||
)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
PACKAGE_VERSION = '0.10'
|
||||
PACKAGE_VERSION = '0.11'
|
||||
|
||||
setup(name='mozprocess',
|
||||
version=PACKAGE_VERSION,
|
||||
|
@ -27,7 +27,7 @@ ifeq ($(UNAME), Darwin)
|
||||
AR = ar
|
||||
ARFLAGS = rcv
|
||||
SHLD = libtool
|
||||
CFLAGS = -v -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk -fPIC -Wall -ansi -pedantic
|
||||
CFLAGS = -v -arch i386 -fPIC -Wall -ansi -pedantic
|
||||
LDFLAGS = -arch_only i386
|
||||
endif
|
||||
ifeq ($(WIN32), 1)
|
||||
|
@ -2,4 +2,4 @@
|
||||
# see https://bugzilla.mozilla.org/show_bug.cgi?id=790765#c51
|
||||
|
||||
[test_mozprocess.py]
|
||||
skip-if = os == 'win'
|
||||
disabled = bug 877864
|
||||
|
Loading…
Reference in New Issue
Block a user