setup.py revision 2828
290N/A# The contents of this file are subject to the terms of the 290N/A# Common Development and Distribution License (the "License"). 290N/A# You may not use this file except in compliance with the License. 290N/A# See the License for the specific language governing permissions 290N/A# and limitations under the License. 290N/A# When distributing Covered Code, include this CDDL HEADER in each 290N/A# If applicable, add the following below this CDDL HEADER, with the 290N/A# fields enclosed by brackets "[]" replaced with your own identifying 290N/A# information: Portions Copyright [yyyy] [name of copyright owner] 2639N/A# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. 2828N/A# the version of pylint that we must have in order to run the pylint checks. 534N/A# Unbuffer stdout and stderr. This helps to ensure that subprocess output 534N/A# is properly interleaved with output from this program. 1674N/A# A list of source, destination tuples of modules which should be hardlinked 1674N/A# together if the os supports it and otherwise copied. 2688N/A # install same set of files in "en/" in "__LOCALE__/ as well" 2688N/A # for localizable file package (regarding themes, install 2535N/A 'C ar ca cs de es fr hu id it ja ko pl pt_BR ru sv zh_CN zh_HK zh_TW'.
split()
2535N/A for n
in 'pkgmgr-main startpage_new update_all_new webinstall'.
split()
2688N/A# add package-manager-__LOCALE__.omf for localizable file package 2535N/A 'C ar ca cs de es fr hu id it ja ko nl pt_BR ru sv zh_CN zh_HK zh_TW'.
split()
2535N/A 'dialog-information',
'dialog-warning',
'hc_dialog-information',
2535N/A 'hc_dialog-warning',
'hc_install',
'hc_opensolaris',
2535N/A 'hci_dialog-information',
'hci_dialog-warning',
'hci_install',
2535N/A 'hci_opensolaris',
'install',
'opensolaris' 2535N/A 'ar ca cs de es fr he hu id it ja ko nl pl pt_BR ru sk sv zh_CN zh_HK zh_TW'.
split()
2339N/A# Runs lint on the extension module source code 2339N/A # Make string shell-friendly 2828N/A """Compare the installed version against the version 2828N/A we require to build with, returning False if the version 2828N/A is too old. It's tempting to use pkg.version.Version 2828N/A here, but since that's a build artifact, we'll do it 2828N/A # if the lists are of different lengths, we just 2828N/A # compare with the precision we have. 2828N/A # if we somehow get non-numeric version 2828N/A # components, we ignore them. 2828N/A # it's fine to default to the required version - the build will 2828N/A # break if the installed version is incompatible and $PYLINT_VER 2828N/A "$PKG_SKIP_PYLINT was set")
2828N/A "installed version %s is older than version %s" %
2339N/A # Insert tests directory onto sys.path so any custom checkers 2339N/A # assumes pylint is accessible on the sys.path 2339N/A # For some reason, the load-plugins option, when used in the 2339N/A # rcfile, does not work, so we put it here instead, to load 2339N/A # Unfortunately, pylint seems pretty fragile and will crash if 2339N/A # we try to run it over all the current pkg source. Hence for 2339N/A # now we only run it over a subset of the source. As source 2339N/A # files are made pylint clean they should be added to the 290N/A# Runs lint on the extension module source code 290N/A # Make string shell-friendly 2674N/A [
'-D_FILE_OFFSET_BITS=64'] + \
2674N/A [
'-D_FILE_OFFSET_BITS=64'] + \
2674N/A [
'-D_FILE_OFFSET_BITS=64'] + \
2339N/A# Runs both C and Python lint 2339N/A # Make string shell-friendly 506N/A # PRIVATE_BUILD set in the environment tells us to put the build 506N/A # directory into the .pyc files, rather than the final 506N/A # installation directory. 506N/A # This is used when installing scripts, below, but it isn't a 506N/A # standard distutils variable. 2535N/A """At the end of the install function, we need to rename some 2535N/A files because distutils provides no way to rename files as they 2535N/A are placed in their install locations. 395N/A # make scripts executable 2561N/A """Remove the target files prior to the standard install_lib procedure 2561N/A if the build_py module has determined that they've actually changed. 2561N/A This may be needed when a module's timestamp goes backwards in time, if 2561N/A a working-directory change is reverted, or an older changeset is checked 2535N/A """Enhance the standard install_data subcommand to take not only a list 2535N/A of filenames, but a list of source and destination filename tuples, for 2535N/A the cases where a filename needs to be renamed between the two 2535N/A # Don't bother making this generic for the one symlink. 2688N/A # use temp environment modified with the given dict 2688N/A # just use environment of this (parent) process as is 2688N/A # just use stderr of this (parent) process 2535N/A """A clone of distutils.file_util._copy_file_contents() that strips the 2597N/A CDDL text. For Python files, we replace the CDDL text with an equal 2597N/A number of empty comment lines so that line numbers match between the 2597N/A source and destination files.""" 2535N/A # Match the lines between and including the CDDL header signposts, as 2535N/A # well as empty comment lines before and after, if they exist. 2597N/A # replace the CDDL expression 2597N/A # with the same number of empty 2597N/A # comment lines as the cddl_re 2535N/A# Make file_util use our version of _copy_file_contents 2688N/A """Check if scope of localization looks up-to-date or possibly not, 2688N/A actual source files (e.g. .py) detected. 2688N/A "New file(s) with translatable strings detected:" 2688N/A"""Please evaluate whether any of the above file(s) needs localization. 2688N/APlease be sure to maintain alphabetical ordering in both files.""" 2688N/A """Generate pkg.pot by extracting localizable strings from source 2688N/A "Failed in generating pkg.pot." 2826N/A """Checks for common i18n messaging bugs in the source.""" 2826N/A # A list of the i18n errors we check for in the code 2826N/A # This checks that messages with multiple parameters are always 2826N/A # written using "%(name)s" format, rather than just "%s" 2826N/A "format string with unnamed arguments cannot be properly localized" 2826N/A"The following i18n errors were detected and should be corrected:\n" \
2688N/A """create XML help for localization, where French part of legalnotice 2688N/A # indicates currently in French part of legalnotice 2688N/A # reached end of legalnotice 2688N/A """Input is English XML file. Output is pkg_help.pot, message 2688N/A source for next translation update. 2688N/A """Input is English XML file and <lang>.po file (which contains 2688N/A translations). Output is translated XML file. 2535N/A (
"file=",
"f",
"source file to copy"),
2535N/A (
"dest=",
"d",
"destination directory"),
2535N/A (
"mode=",
"m",
"file mode"),
849N/A """ Run python's compiler over the file, and discard the results. 849N/A Arrange to generate an exception if the file does not compile. 849N/A This is needed because distutil's own use of pycompile (in the 849N/A distutils.utils module) is broken, and doesn't stop on error. """ 2242N/A # Assume it's a tuple of (filename, lineno, col, code) 2508N/A# On Solaris, ld inserts the full argument to the -o option into the symbol 2508N/A# table. This means that the resulting object will be different depending on 2508N/A# the path at which the workspace lives, and not just on the interesting content 2508N/A# In order to work around that bug (7076871), we create a new compiler class 2508N/A# that looks at the argument indicating the output file, chdirs to its 2508N/A# directory, and runs the real link with the output file set to just the base 2508N/A# Unfortunately, distutils isn't too customizable in this regard, so we have to 2508N/A# twiddle with a couple of the names in the distutils.ccompiler namespace: we 2508N/A# have to add a new entry to the compiler_class dict, and we have to override 2508N/A# the new_compiler() function to point to our own. Luckily, our copy of 2508N/A# new_compiler() gets to be very simple, since we always know what we want to 2508N/A 'unixccompiler',
'MyUnixCCompiler',
2508N/A 'standard Unix-style compiler with a link stage modified for Solaris' 2677N/A # store our 64-bit extensions elsewhere 2508N/A # Gather the timestamps of the .py files in the gate, so we can 2508N/A # force the mtimes of the built and delivered copies to be 2508N/A # consistent across builds, causing their corresponding .pyc 2508N/A # files to be unchanged unless the .py file content changed. 2535N/A # override the build_module method to do VERSION substitution on 422N/A # Grab the previously-built version out of the build 422N/A # If the versions haven't changed, there's no need to 383N/A print "doing version substitution: ", v
849N/A # Will raise a DistutilsError on failure. 2508N/A # If the timestamp on the source file (coming from mercurial if 2508N/A # unchanged, or from the filesystem if changed) doesn't match 2508N/A # the filesystem timestamp on the destination, then force the 2508N/A # copy to make sure the right data is in place. 2561N/A # Force a copy of the file if the source timestamp is different 2561N/A # from that of the destination, not just if it's newer. This 2561N/A # allows timestamps in the working directory to regress (for 2561N/A # instance, following the reversion of a change). 2508N/A # If we copied the file, then we need to go and readjust the 2508N/A # timestamp on the file to match what we have in our database. 2561N/A # Save the filename aside for our version of install_lib. 2535N/A # As a subclass of distutils.cmd.Command, these methods are required to 2535N/A # Anything that gets created here should get deleted in 2688N/A # create xml for localization 2688N/A # generate pkg_help.pot for next translation 2688N/A # generate pkg.pot for next translation 2688N/A # create __LOCALE__ -> C symlink for omf file 2688N/A # to make installation with data_files list work 2535N/A """Remove a file without caring whether it exists.""" 1101N/A # list of options stored in initialize_options below. The first entry 1101N/A # in each tuple must be the exact name of a member variable. 1715N/A (
"archivedir=",
'a',
"archive failed tests <dir>"),
1513N/A (
"baselinefile=",
'b',
"baseline file <file>"),
1513N/A (
"coverage",
"c",
"collect code coverage data"),
448N/A (
"genbaseline",
'g',
"generate test baseline"),
1513N/A (
"only=",
"o",
"only <regex>"),
448N/A (
"parseable",
'p',
"parseable output"),
2272N/A (
"port=",
"z",
"lowest port to start a depot on"),
1101N/A (
"timing",
"t",
"timing file <file>"),
1513N/A (
"verbosemode",
'v',
"run tests in verbose mode"),
2340N/A (
"enableguitests",
'u',
"enable IPS GUI tests, disabled by default"),
1715N/A (
"stoponerr",
'x',
"stop when a baseline mismatch occurs"),
1715N/A (
"debugoutput",
'd',
"emit debugging output"),
1716N/A (
"showonexpectedfail",
'f',
1715N/A "show all failure info, even for expected fails"),
1715N/A (
"startattest=",
's',
"start at indicated test"),
2499N/A (
"jobs=",
'j',
"number of parallel processes to use"),
2499N/A (
"quiet",
"q",
"use the dots as the output format"),
2698N/A # This class wraps the distutils Extension class, allowing us to set 2698N/A # build_64 in the object constructor instead of being forced to add it 2698N/A # after the object has been created. 290N/A# These are set to real values based on the platform, down below 2698N/A# We don't support 64-bit yet, but 64-bit _actions.so, _common.so, and 2698N/A# _varcet.so are needed for a system repository mod_wsgi application, 383N/A# all builds of IPS should have manpages 395N/A # Solaris-specific extensions are added here 2688N/A # install localizable .xml and its .pot file to put into localizable file package 2688N/A # install English .pot file to put into localizable file package 2535N/A for t
in 'HighContrast',
'HighContrastInverse',
'':
2535N/A for n
in (
'filter_all',
'filter_selected',
'progress_checkmark',
2535N/A 'selection',
'status_checkmark',
'status_installed',
2535N/A 'status_newupdate',
'status_notinstalled')
2535N/A for n
in (
'pm-install_update',
'pm-refresh',
2535N/A 'pm-remove',
'pm-update_all')
2535N/A # These two icons don't fit any patterns. 395N/A # Unix platforms which the elf extension has been ported to 395N/A # are specified here, so they are built automatically 395N/A # Solaris has built-in md library and Solaris-specific arch extension 395N/A # All others use OpenSSL and cross-platform arch module