src/setup.py
author Tim Foster <tim.s.foster@oracle.com>
Wed, 23 May 2012 09:49:43 +1200
changeset 2677 7f1c7dd5254f
parent 2674 d342fbfbc2fd
child 2688 5508b2313c70
permissions -rwxr-xr-x
7140764 pkg.sysrepo should support p5p files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
     1
#!/usr/bin/python2.6
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     2
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     3
# CDDL HEADER START
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     4
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     8
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    12
# and limitations under the License.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    13
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    19
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    20
# CDDL HEADER END
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    21
#
2639
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
    22
# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    23
#
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    24
883
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
    25
import errno
454
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
    26
import fnmatch
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    27
import os
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
    28
import platform
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    29
import stat
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    30
import sys
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    31
import shutil
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
    32
import re
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    33
import subprocess
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    34
import tarfile
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    35
import tempfile
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    36
import urllib
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
    37
import py_compile
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
    38
import hashlib
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
    39
import time
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    40
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
    41
from distutils.errors import DistutilsError, DistutilsFileError
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    42
from distutils.core import setup, Extension
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    43
from distutils.cmd import Command
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    44
from distutils.command.install import install as _install
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
    45
from distutils.command.install_data import install_data as _install_data
2561
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
    46
from distutils.command.install_lib import install_lib as _install_lib
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    47
from distutils.command.build import build as _build
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
    48
from distutils.command.build_ext import build_ext as _build_ext
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
    49
from distutils.command.build_py import build_py as _build_py
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    50
from distutils.command.bdist import bdist as _bdist
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    51
from distutils.command.clean import clean as _clean
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
    52
from distutils.dist import Distribution
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
    53
from distutils import log
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    54
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    55
from distutils.sysconfig import get_python_inc
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
    56
import distutils.dep_util as dep_util
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
    57
import distutils.dir_util as dir_util
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    58
import distutils.file_util as file_util
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    59
import distutils.util as util
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
    60
import distutils.ccompiler
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
    61
from distutils.unixccompiler import UnixCCompiler
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    62
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    63
osname = platform.uname()[0].lower()
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    64
ostype = arch = 'unknown'
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    65
if osname == 'sunos':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    66
        arch = platform.processor()
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    67
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    68
elif osname == 'linux':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    69
        arch = "linux_" + platform.machine()
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    70
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    71
elif osname == 'windows':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    72
        arch = osname
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    73
        ostype = "windows"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    74
elif osname == 'darwin':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    75
        arch = osname
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    76
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    77
elif osname == 'aix':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    78
        arch = "aix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    79
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    80
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
    81
pwd = os.path.normpath(sys.path[0])
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
    82
534
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    83
#
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    84
# Unbuffer stdout and stderr.  This helps to ensure that subprocess output
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    85
# is properly interleaved with output from this program.
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    86
#
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    87
sys.stdout = os.fdopen(sys.stdout.fileno(), "w", 0)
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    88
sys.stderr = os.fdopen(sys.stderr.fileno(), "w", 0)
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    89
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    90
dist_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "dist_" + arch))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    91
build_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "build_" + arch))
954
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
    92
if "ROOT" in os.environ and os.environ["ROOT"] != "":
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
    93
        root_dir = os.environ["ROOT"]
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
    94
else:
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
    95
        root_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "root_" + arch))
534
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
    96
pkgs_dir = os.path.normpath(os.path.join(pwd, os.pardir, "packages", arch))
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
    97
extern_dir = os.path.normpath(os.path.join(pwd, "extern"))
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    98
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
    99
py_install_dir = 'usr/lib/python2.6/vendor-packages'
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   100
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   101
scripts_dir = 'usr/bin'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   102
lib_dir = 'usr/lib'
661
edf14bae4465 2717 pkg.depotd: need smf support for depot mode options
Brock Pytlik <bpytlik@sun.com>
parents: 613
diff changeset
   103
svc_method_dir = 'lib/svc/method'
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   104
2494
106731ab1e98 18776 man pages need to be in nroff format
Danek Duvall <danek.duvall@oracle.com>
parents: 2490
diff changeset
   105
man1_dir = 'usr/share/man/man1'
106731ab1e98 18776 man pages need to be in nroff format
Danek Duvall <danek.duvall@oracle.com>
parents: 2490
diff changeset
   106
man1m_dir = 'usr/share/man/man1m'
106731ab1e98 18776 man pages need to be in nroff format
Danek Duvall <danek.duvall@oracle.com>
parents: 2490
diff changeset
   107
man5_dir = 'usr/share/man/man5'
2516
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   108
man1_ja_JP_dir = 'usr/share/man/ja_JP.UTF-8/man1'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   109
man1m_ja_JP_dir = 'usr/share/man/ja_JP.UTF-8/man1m'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   110
man5_ja_JP_dir = 'usr/share/man/ja_JP.UTF-8/man5'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   111
man1_zh_CN_dir = 'usr/share/man/zh_CN.UTF-8/man1'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   112
man1m_zh_CN_dir = 'usr/share/man/zh_CN.UTF-8/man1m'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   113
man5_zh_CN_dir = 'usr/share/man/zh_CN.UTF-8/man5'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   114
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   115
resource_dir = 'usr/share/lib/pkg'
2523
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
   116
transform_dir = 'usr/share/pkg/transforms'
2390
49043c6c5187 18399 ipkg brand doing svcadm enable -s zones-proxyd deadlocks svc:/system/zones
Tim Foster <tim.s.foster@oracle.com>
parents: 2364
diff changeset
   117
smf_app_dir = 'lib/svc/manifest/application/pkg'
1498
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
   118
execattrd_dir = 'etc/security/exec_attr.d'
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
   119
authattrd_dir = 'etc/security/auth_attr.d'
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   120
sysrepo_dir = 'etc/pkg/sysrepo'
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   121
sysrepo_logs_dir = 'var/log/pkg/sysrepo'
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   122
sysrepo_cache_dir = 'var/cache/pkg/sysrepo'
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   123
autostart_dir = 'etc/xdg/autostart'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   124
desktop_dir = 'usr/share/applications'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   125
gconf_dir = 'etc/gconf/schemas'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   126
help_dir = 'usr/share/gnome/help/package-manager'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   127
omf_dir = 'usr/share/omf/package-manager'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   128
startpage_dir = 'usr/share/package-manager/data/startpagebase'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   129
um_lib_dir = 'usr/lib/update-manager'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   130
um_share_dir = 'usr/share/update-manager'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   131
pm_share_dir = 'usr/share/package-manager'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   132
locale_dir = 'usr/share/locale'
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   133
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   134
1674
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   135
# A list of source, destination tuples of modules which should be hardlinked
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   136
# together if the os supports it and otherwise copied.
2262
8d2364b8e9d5 17315 pkgdep test suite should remove python2.5 usage
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2242
diff changeset
   137
hardlink_modules = []
1674
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   138
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   139
scripts_sunos = {
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   140
        scripts_dir: [
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   141
                ['client.py', 'pkg'],
1544
e0ce5081236a 12697 pkgdep throws an exception for $PLATFORM or $ISALIST in runpath
Brock Pytlik <bpytlik@sun.com>
parents: 1516
diff changeset
   142
                ['pkgdep.py', 'pkgdepend'],
1968
c0540b1e4f7e 8722 advanced repository metadata store needed
Shawn Walker <shawn.walker@oracle.com>
parents: 1903
diff changeset
   143
                ['pkgrepo.py', 'pkgrepo'],
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   144
                ['util/publish/pkgdiff.py', 'pkgdiff'],
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
   145
                ['util/publish/pkgfmt.py', 'pkgfmt'],
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   146
                ['util/publish/pkglint.py', 'pkglint'],
2240
de59b73f1428 14965 merge should be productized
Shawn Walker <shawn.walker@oracle.com>
parents: 2223
diff changeset
   147
                ['util/publish/pkgmerge.py', 'pkgmerge'],
1506
9c8b3a3184be 12373 Need a programatic way of transforming manifests
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1505
diff changeset
   148
                ['util/publish/pkgmogrify.py', 'pkgmogrify'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   149
                ['publish.py', 'pkgsend'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   150
                ['pull.py', 'pkgrecv'],
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   151
                ['sign.py', 'pkgsign'],
424
a767ef6bf887 2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents: 422
diff changeset
   152
                ['packagemanager.py', 'packagemanager'],
1024
e83271f2e133 7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 954
diff changeset
   153
                ['updatemanager.py', 'pm-updatemanager'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   154
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   155
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   156
                ['depot.py', 'pkg.depotd'],
2078
a13afe24c79a 17024 pm-updatemanager can't find display when running from cron
John Rice <john.rice@oracle.com>
parents: 2075
diff changeset
   157
                ['checkforupdates.py', 'pm-checkforupdates'],
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents: 534
diff changeset
   158
                ['updatemanagernotifier.py', 'updatemanagernotifier'],
1172
fc39dcc70f84 9574 Package Manager should use user's GNOME proxy settings
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1101
diff changeset
   159
                ['launch.py', 'pm-launch'],
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   160
                ['sysrepo.py', 'pkg.sysrepo'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   161
                ],
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   162
        um_lib_dir: [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   163
                ['um/update-refresh.sh', 'update-refresh.sh'],
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   164
        ],
661
edf14bae4465 2717 pkg.depotd: need smf support for depot mode options
Brock Pytlik <bpytlik@sun.com>
parents: 613
diff changeset
   165
        svc_method_dir: [
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   166
                ['svc/svc-pkg-depot', 'svc-pkg-depot'],
1902
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1815
diff changeset
   167
                ['svc/svc-pkg-mdns', 'svc-pkg-mdns'],
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   168
                ['svc/svc-pkg-sysrepo', 'svc-pkg-sysrepo'],
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   169
                ['um/pkg-update', 'pkg-update'],
661
edf14bae4465 2717 pkg.depotd: need smf support for depot mode options
Brock Pytlik <bpytlik@sun.com>
parents: 613
diff changeset
   170
                ],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   171
        }
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   172
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   173
scripts_windows = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   174
        scripts_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   175
                ['client.py', 'client.py'],
1968
c0540b1e4f7e 8722 advanced repository metadata store needed
Shawn Walker <shawn.walker@oracle.com>
parents: 1903
diff changeset
   176
                ['pkgrepo.py', 'pkgrepo.py'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   177
                ['publish.py', 'publish.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   178
                ['pull.py', 'pull.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   179
                ['scripts/pkg.bat', 'pkg.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   180
                ['scripts/pkgsend.bat', 'pkgsend.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   181
                ['scripts/pkgrecv.bat', 'pkgrecv.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   182
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   183
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   184
                ['depot.py', 'depot.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   185
                ['scripts/pkg.depotd.bat', 'pkg.depotd.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   186
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   187
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   188
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   189
scripts_other_unix = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   190
        scripts_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   191
                ['client.py', 'client.py'],
1231
f7b99e8118d2 9290 need a way to find the file dependencies of a package
Brock Pytlik <bpytlik@sun.com>
parents: 1228
diff changeset
   192
                ['pkgdep.py', 'pkgdep'],
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   193
                ['util/publish/pkgdiff.py', 'pkgdiff'],
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
   194
                ['util/publish/pkgfmt.py', 'pkgfmt'],
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   195
                ['util/publish/pkgmogrify.py', 'pkgmogrify'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   196
                ['pull.py', 'pull.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   197
                ['publish.py', 'publish.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   198
                ['scripts/pkg.sh', 'pkg'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   199
                ['scripts/pkgsend.sh', 'pkgsend'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   200
                ['scripts/pkgrecv.sh', 'pkgrecv'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   201
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   202
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   203
                ['depot.py', 'depot.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   204
                ['scripts/pkg.depotd.sh', 'pkg.depotd'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   205
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   206
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   207
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   208
# indexed by 'osname'
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   209
scripts = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   210
        "sunos": scripts_sunos,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   211
        "linux": scripts_other_unix,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   212
        "windows": scripts_windows,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   213
        "darwin": scripts_other_unix,
1302
65995c02a467 10042 Port pkg(5) to AIX
Tom Mueller <Tom.Mueller@sun.com>
parents: 1265
diff changeset
   214
        "aix" : scripts_other_unix,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   215
        "unknown": scripts_sunos,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   216
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   217
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   218
man1_files = [
1024
e83271f2e133 7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 954
diff changeset
   219
        'man/packagemanager.1',
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   220
        'man/pkg.1',
1544
e0ce5081236a 12697 pkgdep throws an exception for $PLATFORM or $ISALIST in runpath
Brock Pytlik <bpytlik@sun.com>
parents: 1516
diff changeset
   221
        'man/pkgdepend.1',
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   222
        'man/pkgdiff.1',
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
   223
        'man/pkgfmt.1',
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   224
        'man/pkglint.1',
2240
de59b73f1428 14965 merge should be productized
Shawn Walker <shawn.walker@oracle.com>
parents: 2223
diff changeset
   225
        'man/pkgmerge.1',
1506
9c8b3a3184be 12373 Need a programatic way of transforming manifests
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1505
diff changeset
   226
        'man/pkgmogrify.1',
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   227
        'man/pkgsend.1',
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   228
        'man/pkgsign.1',
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   229
        'man/pkgrecv.1',
1978
69f2ff97bcd8 16567 pkgrepo help and manpage need to be consistent, and manpage needs publishing
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
   230
        'man/pkgrepo.1',
1024
e83271f2e133 7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 954
diff changeset
   231
        'man/pm-updatemanager.1',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   232
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   233
man1m_files = [
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   234
        'man/pkg.depotd.1m',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   235
        'man/pkg.sysrepo.1m'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   236
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   237
man5_files = [
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   238
        'man/pkg.5'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   239
        ]
2516
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   240
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   241
man1_ja_files = [
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   242
        'man/ja_JP/packagemanager.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   243
        'man/ja_JP/pkg.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   244
        'man/ja_JP/pkgdepend.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   245
        'man/ja_JP/pkgdiff.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   246
        'man/ja_JP/pkgfmt.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   247
        'man/ja_JP/pkglint.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   248
        'man/ja_JP/pkgmerge.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   249
        'man/ja_JP/pkgmogrify.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   250
        'man/ja_JP/pkgsend.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   251
        'man/ja_JP/pkgsign.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   252
        'man/ja_JP/pkgrecv.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   253
        'man/ja_JP/pkgrepo.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   254
        'man/ja_JP/pm-updatemanager.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   255
        ]
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   256
man1m_ja_files = [
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   257
        'man/ja_JP/pkg.depotd.1m',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   258
        'man/ja_JP/pkg.sysrepo.1m'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   259
        ]
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   260
man5_ja_files = [
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   261
        'man/ja_JP/pkg.5'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   262
        ]
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   263
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   264
man1_zh_CN_files = [
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   265
        'man/zh_CN/packagemanager.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   266
        'man/zh_CN/pkg.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   267
        'man/zh_CN/pkgdepend.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   268
        'man/zh_CN/pkgdiff.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   269
        'man/zh_CN/pkgfmt.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   270
        'man/zh_CN/pkglint.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   271
        'man/zh_CN/pkgmerge.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   272
        'man/zh_CN/pkgmogrify.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   273
        'man/zh_CN/pkgsend.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   274
        'man/zh_CN/pkgsign.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   275
        'man/zh_CN/pkgrecv.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   276
        'man/zh_CN/pkgrepo.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   277
        'man/zh_CN/pm-updatemanager.1',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   278
        ]
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   279
man1m_zh_CN_files = [
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   280
        'man/zh_CN/pkg.depotd.1m',
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   281
        'man/zh_CN/pkg.sysrepo.1m'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   282
        ]
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   283
man5_zh_CN_files = [
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   284
        'man/zh_CN/pkg.5'
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   285
        ]
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   286
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   287
packages = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   288
        'pkg',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   289
        'pkg.actions',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   290
        'pkg.bundle',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   291
        'pkg.client',
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   292
        'pkg.client.linkedimage',
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   293
        'pkg.client.transport',
1452
bd6ffa78fed9 7960 client and depot need different organization of files
Brock Pytlik <bpytlik@sun.com>
parents: 1401
diff changeset
   294
        'pkg.file_layout',
1231
f7b99e8118d2 9290 need a way to find the file dependencies of a package
Brock Pytlik <bpytlik@sun.com>
parents: 1228
diff changeset
   295
        'pkg.flavor',
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   296
        'pkg.gui',
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   297
        'pkg.lint',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   298
        'pkg.portable',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   299
        'pkg.publish',
424
a767ef6bf887 2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents: 422
diff changeset
   300
        'pkg.server'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   301
        ]
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   302
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   303
pylint_targets = [
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   304
        'pkg.altroot',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   305
        'pkg.client.linkedimage',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   306
        'pkg.client.pkgdefs',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   307
        ]
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   308
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   309
web_files = []
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   310
for entry in os.walk("web"):
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   311
        web_dir, dirs, files = entry
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   312
        if not files:
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   313
                continue
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   314
        web_files.append((os.path.join(resource_dir, web_dir), [
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   315
            os.path.join(web_dir, f) for f in files
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   316
            if f != "Makefile"
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   317
            ]))
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   318
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   319
smf_app_files = [
1902
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1815
diff changeset
   320
        'svc/pkg-mdns.xml',
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   321
        'svc/pkg-server.xml',
2390
49043c6c5187 18399 ipkg brand doing svcadm enable -s zones-proxyd deadlocks svc:/system/zones
Tim Foster <tim.s.foster@oracle.com>
parents: 2364
diff changeset
   322
        'svc/pkg-update.xml',
2335
33734ca16f74 18254 system repository package should be renamed
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2310
diff changeset
   323
        'svc/pkg-system-repository.xml',
2338
63a4d56416c6 18240 zone proxy needed
johansen <johansen@opensolaris.org>
parents: 2337
diff changeset
   324
        'svc/zoneproxy-client.xml',
63a4d56416c6 18240 zone proxy needed
johansen <johansen@opensolaris.org>
parents: 2337
diff changeset
   325
        'svc/zoneproxyd.xml'
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   326
        ]
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   327
resource_files = [
2223
2da8c49e53dc 17735 build should use custom pkglintrc to locate proto version of opensolaris.org.sections
Tim Foster <tim.s.foster@oracle.com>
parents: 2180
diff changeset
   328
        'util/opensolaris.org.sections',
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   329
        'util/pkglintrc',
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   330
        ]
2523
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
   331
transform_files = [
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
   332
        'util/publish/transforms/developer',
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
   333
        'util/publish/transforms/documentation',
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
   334
        'util/publish/transforms/locale',
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
   335
        'util/publish/transforms/smf-manifests'
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
   336
        ]
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   337
sysrepo_files = [
2677
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   338
        'util/apache2/sysrepo/sysrepo_p5p.py',
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   339
        'util/apache2/sysrepo/sysrepo_httpd.conf.mako',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   340
        'util/apache2/sysrepo/sysrepo_publisher_response.mako',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   341
        ]
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   342
sysrepo_log_stubs = [
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   343
        'util/apache2/sysrepo/logs/access_log',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   344
        'util/apache2/sysrepo/logs/error_log',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   345
        ]
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   346
execattrd_files = [
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   347
        'util/misc/exec_attr.d/package:pkg',
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   348
        'util/misc/exec_attr.d/package:pkg:package-manager'
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   349
]
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   350
authattrd_files = ['util/misc/auth_attr.d/package:pkg']
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   351
autostart_files = [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   352
        'um/data/updatemanagernotifier.desktop',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   353
]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   354
desktop_files = [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   355
        'gui/data/addmoresoftware.desktop',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   356
        'gui/data/packagemanager.desktop',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   357
        'um/data/updatemanager.desktop',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   358
]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   359
gconf_files = [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   360
        'gui/data/packagemanager-preferences.schemas',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   361
        'um/data/updatemanager-preferences.schemas',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   362
]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   363
intl_files = [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   364
        'gui/data/addmoresoftware.desktop.in',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   365
        'gui/data/packagemanager-info.xml.in',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   366
        'gui/data/packagemanager-preferences.schemas.in',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   367
        'gui/data/packagemanager.desktop.in',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   368
        'um/data/updatemanager-preferences.schemas.in',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   369
        'um/data/updatemanager.desktop.in',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   370
        'um/data/updatemanagernotifier.desktop.in',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   371
]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   372
help_locales = \
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   373
    'C ar ca cs de es fr hu id it ja ko pl pt_BR ru sv zh_CN zh_HK zh_TW'.split()
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   374
help_files = {
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   375
        'C': ['gui/help/C/package-manager.xml'],
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   376
        'C/figures': [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   377
            'gui/help/C/figures/%s.png' % n
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   378
            for n in 'pkgmgr-main startpage_new update_all_new webinstall'.split()
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   379
        ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   380
}
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   381
help_files.update(
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   382
        (locale, ['gui/help/%s/package-manager.xml' % locale])
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   383
        for locale in help_locales[1:]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   384
)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   385
omf_files = [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   386
        'gui/help/package-manager-%s.omf' % locale
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   387
        for locale in help_locales
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   388
]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   389
startpage_locales = \
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   390
    'C ar ca cs de es fr hu id it ja ko nl pt_BR ru sv zh_CN zh_HK zh_TW'.split()
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   391
startpage_files = {
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   392
        'C': [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   393
            'gui/data/startpagebase/C/%s.png' % n
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   394
            for n in [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   395
                'dialog-information', 'dialog-warning', 'hc_dialog-information',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   396
                'hc_dialog-warning', 'hc_install', 'hc_opensolaris',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   397
                'hci_dialog-information', 'hci_dialog-warning', 'hci_install',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   398
                'hci_opensolaris', 'install', 'opensolaris'
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   399
            ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   400
        ] + ['gui/data/startpagebase/C/startpage.html']
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   401
}
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   402
startpage_files.update(
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   403
        (locale, ['gui/data/startpagebase/%s/startpage.html' % locale])
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   404
        for locale in startpage_locales[1:]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   405
)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   406
pkg_locales = \
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   407
    '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()
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   408
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   409
syscallat_srcs = [
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   410
        'modules/syscallat.c'
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   411
        ]
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   412
pspawn_srcs = [
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   413
        'modules/pspawn.c'
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   414
        ]
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   415
elf_srcs = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   416
        'modules/elf.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   417
        'modules/elfextract.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   418
        'modules/liblist.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   419
        ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   420
arch_srcs = [
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   421
        'modules/arch.c'
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   422
        ]
591
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   423
_actions_srcs = [
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   424
        'modules/actions/_actions.c'
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   425
        ]
2639
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   426
_actcomm_srcs = [
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   427
        'modules/actions/_common.c'
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   428
        ]
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   429
_varcet_srcs = [
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   430
        'modules/_varcet.c'
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   431
        ]
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1498
diff changeset
   432
solver_srcs = [
2516
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
   433
        'modules/solver/solver.c',
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1498
diff changeset
   434
        'modules/solver/py_solver.c'
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1498
diff changeset
   435
        ]
1632
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   436
solver_link_args = ["-lm", "-lc"]
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   437
if osname == 'sunos':
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   438
        solver_link_args = ["-ztext"] + solver_link_args
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   439
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   440
# Runs lint on the extension module source code
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   441
class pylint_func(Command):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   442
        description = "Runs pylint tools over IPS python source code"
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   443
        user_options = []
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   444
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   445
        def initialize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   446
                pass
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   447
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   448
        def finalize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   449
                pass
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   450
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   451
        # Make string shell-friendly
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   452
        @staticmethod
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   453
        def escape(astring):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   454
                return astring.replace(' ', '\\ ')
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   455
2364
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   456
        def run(self, quiet=False):
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   457
                proto = os.path.join(root_dir, py_install_dir)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   458
                sys.path.insert(0, proto)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   459
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   460
                # Insert tests directory onto sys.path so any custom checkers
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   461
                # can be found.
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   462
                sys.path.insert(0, os.path.join(pwd, 'tests'))
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   463
                # assumes pylint is accessible on the sys.path
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   464
                from pylint import lint
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   465
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   466
                #
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   467
                # For some reason, the load-plugins option, when used in the
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   468
                # rcfile, does not work, so we put it here instead, to load
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   469
                # our custom checkers.
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   470
                #
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   471
                # Unfortunately, pylint seems pretty fragile and will crash if
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   472
                # we try to run it over all the current pkg source.  Hence for
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   473
                # now we only run it over a subset of the source.  As source
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   474
                # files are made pylint clean they should be added to the
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   475
                # pylint_targets list.
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   476
                #
2364
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   477
                args = ['--load-plugins=multiplatform']
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   478
                if quiet:
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   479
                        args += ['--reports=no']
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   480
                args += ['--rcfile', os.path.join(pwd, 'tests', 'pylintrc')]
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   481
                args += pylint_targets
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   482
                lint.Run(args)
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   483
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   484
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   485
class pylint_func_quiet(pylint_func):
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   486
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   487
        def run(self, quiet=False):
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   488
                pylint_func.run(self, quiet=True)
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   489
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   490
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   491
include_dirs = [ 'modules' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   492
lint_flags = [ '-u', '-axms', '-erroff=E_NAME_DEF_NOT_USED2' ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   493
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   494
# Runs lint on the extension module source code
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   495
class clint_func(Command):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   496
        description = "Runs lint tools over IPS C extension source code"
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   497
        user_options = []
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   498
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   499
        def initialize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   500
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   501
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   502
        def finalize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   503
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   504
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   505
        # Make string shell-friendly
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   506
        @staticmethod
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   507
        def escape(astring):
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   508
                return astring.replace(' ', '\\ ')
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   509
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   510
        def run(self):
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   511
                if "LINT" in os.environ and os.environ["LINT"] != "":
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   512
                        lint = [os.environ["LINT"]]
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   513
                else:
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   514
                        lint = ['lint']
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   515
                if osname == 'sunos' or osname == "linux":
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   516
                        archcmd = lint + lint_flags + \
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   517
                            ['-D_FILE_OFFSET_BITS=64'] + \
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   518
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   519
                            ['-I' + self.escape(get_python_inc())] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   520
                            arch_srcs
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   521
                        elfcmd = lint + lint_flags + \
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   522
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   523
                            ['-I' + self.escape(get_python_inc())] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   524
                            ["%s%s" % ("-l", k) for k in elf_libraries] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   525
                            elf_srcs
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   526
                        _actionscmd = lint + lint_flags + \
591
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   527
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   528
                            ['-I' + self.escape(get_python_inc())] + \
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   529
                            _actions_srcs
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   530
                        _actcommcmd = lint + lint_flags + \
2639
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   531
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   532
                            ['-I' + self.escape(get_python_inc())] + \
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   533
                            _actcomm_srcs
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   534
                        _varcetcmd = lint + lint_flags + \
2639
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   535
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   536
                            ['-I' + self.escape(get_python_inc())] + \
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   537
                            _varcet_srcs
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   538
                        pspawncmd = lint + lint_flags + \
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   539
                            ['-D_FILE_OFFSET_BITS=64'] + \
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   540
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   541
                            ['-I' + self.escape(get_python_inc())] + \
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   542
                            pspawn_srcs
2674
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   543
                        syscallatcmd = lint + lint_flags + \
d342fbfbc2fd 7168702 PUBLISHALL still needs work
david.comay@oracle.com
parents: 2639
diff changeset
   544
                            ['-D_FILE_OFFSET_BITS=64'] + \
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   545
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   546
                            ['-I' + self.escape(get_python_inc())] + \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   547
                            syscallat_srcs
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   548
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   549
                        print(" ".join(archcmd))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   550
                        os.system(" ".join(archcmd))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   551
                        print(" ".join(elfcmd))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   552
                        os.system(" ".join(elfcmd))
591
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   553
                        print(" ".join(_actionscmd))
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   554
                        os.system(" ".join(_actionscmd))
2639
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   555
                        print(" ".join(_actcommcmd))
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   556
                        os.system(" ".join(_actcommcmd))
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   557
                        print(" ".join(_varcetcmd))
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
   558
                        os.system(" ".join(_varcetcmd))
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   559
                        print(" ".join(pspawncmd))
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   560
                        os.system(" ".join(pspawncmd))
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   561
                        print(" ".join(syscallatcmd))
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   562
                        os.system(" ".join(syscallatcmd))
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   563
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   564
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   565
# Runs both C and Python lint
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   566
class lint_func(Command):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   567
        description = "Runs C and Python lint checkers"
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   568
        user_options = []
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   569
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   570
        def initialize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   571
                pass
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   572
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   573
        def finalize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   574
                pass
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   575
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   576
        # Make string shell-friendly
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   577
        @staticmethod
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   578
        def escape(astring):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   579
                return astring.replace(' ', '\\ ')
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   580
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   581
        def run(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   582
                clint_func(Distribution()).run()
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   583
                pylint_func(Distribution()).run()
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   584
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   585
class install_func(_install):
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   586
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   587
                _install.initialize_options(self)
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   588
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   589
                # PRIVATE_BUILD set in the environment tells us to put the build
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   590
                # directory into the .pyc files, rather than the final
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   591
                # installation directory.
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   592
                private_build = os.getenv("PRIVATE_BUILD", None)
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   593
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   594
                if private_build is None:
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   595
                        self.install_lib = py_install_dir
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 801
diff changeset
   596
                        self.install_data = os.path.sep
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   597
                        self.root = root_dir
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   598
                else:
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   599
                        self.install_lib = os.path.join(root_dir, py_install_dir)
513
4ddcb572f5d9 3330 smf manifest file in wrong location
Danek Duvall <danek.duvall@sun.com>
parents: 506
diff changeset
   600
                        self.install_data = root_dir
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   601
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   602
                # This is used when installing scripts, below, but it isn't a
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   603
                # standard distutils variable.
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   604
                self.root_dir = root_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   605
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   606
        def run(self):
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   607
                """At the end of the install function, we need to rename some
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   608
                files because distutils provides no way to rename files as they
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   609
                are placed in their install locations.
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   610
                """
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   611
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   612
                _install.run(self)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   613
1674
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   614
                for o_src, o_dest in hardlink_modules:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   615
                        for e in [".py", ".pyc"]:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   616
                                src = util.change_root(self.root_dir, o_src + e)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   617
                                dest = util.change_root(
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   618
                                    self.root_dir, o_dest + e)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   619
                                if ostype == "posix":
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   620
                                        if os.path.exists(dest) and \
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   621
                                            os.stat(src)[stat.ST_INO] != \
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   622
                                            os.stat(dest)[stat.ST_INO]:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   623
                                                os.remove(dest)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   624
                                        file_util.copy_file(src, dest,
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   625
                                            link="hard", update=1)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   626
                                else:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   627
                                        file_util.copy_file(src, dest, update=1)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   628
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   629
                for d, files in scripts[osname].iteritems():
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   630
                        for (srcname, dstname) in files:
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   631
                                dst_dir = util.change_root(self.root_dir, d)
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   632
                                dst_path = util.change_root(self.root_dir,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   633
                                       os.path.join(d, dstname))
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   634
                                dir_util.mkpath(dst_dir, verbose=True)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   635
                                file_util.copy_file(srcname, dst_path, update=True)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   636
                                # make scripts executable
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   637
                                os.chmod(dst_path,
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   638
                                    os.stat(dst_path).st_mode
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 801
diff changeset
   639
                                    | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   640
2561
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   641
class install_lib_func(_install_lib):
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   642
        """Remove the target files prior to the standard install_lib procedure
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   643
        if the build_py module has determined that they've actually changed.
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   644
        This may be needed when a module's timestamp goes backwards in time, if
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   645
        a working-directory change is reverted, or an older changeset is checked
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   646
        out.
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   647
        """
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   648
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   649
        def install(self):
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   650
                build_py = self.get_finalized_command("build_py")
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   651
                prefix_len = len(self.build_dir) + 1
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   652
                for p in build_py.copied:
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   653
                        id_p = os.path.join(self.install_dir, p[prefix_len:])
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   654
                        rm_f(id_p)
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   655
                        if self.compile:
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   656
                                rm_f(id_p + "c")
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   657
                        if self.optimize > 0:
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   658
                                rm_f(id_p + "o")
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   659
                return _install_lib.install(self)
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   660
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   661
class install_data_func(_install_data):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   662
        """Enhance the standard install_data subcommand to take not only a list
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   663
        of filenames, but a list of source and destination filename tuples, for
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   664
        the cases where a filename needs to be renamed between the two
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   665
        locations."""
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   666
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   667
        def run(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   668
                self.mkpath(self.install_dir)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   669
                for f in self.data_files:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   670
                        dir, files = f
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   671
                        dir = util.convert_path(dir)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   672
                        if not os.path.isabs(dir):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   673
                                dir = os.path.join(self.install_dir, dir)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   674
                        elif self.root:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   675
                                dir = change_root(self.root, dir)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   676
                        self.mkpath(dir)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   677
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   678
                        if not files:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   679
                                self.outfiles.append(dir)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   680
                        else:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   681
                                for file in files:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   682
                                        if isinstance(file, basestring):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   683
                                                infile = file
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   684
                                                outfile = os.path.join(dir,
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   685
                                                    os.path.basename(file))
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   686
                                        else:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   687
                                                infile, outfile = file
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   688
                                        infile = util.convert_path(infile)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   689
                                        outfile = util.convert_path(outfile)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   690
                                        if os.path.sep not in outfile:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   691
                                                outfile = os.path.join(dir,
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   692
                                                    outfile)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   693
                                        self.copy_file(infile, outfile)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   694
                                        self.outfiles.append(outfile)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   695
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   696
                # Don't bother making this generic for the one symlink.
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   697
                src = "HighContrastInverse"
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   698
                dst = os.path.join(self.install_dir, pm_share_dir,
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   699
                    "icons/HighContrastLargePrintInverse")
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   700
                try:
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   701
                        targ = os.readlink(dst)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   702
                except OSError, e:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   703
                        if e.errno in (errno.ENOENT, errno.EINVAL):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   704
                                targ = None
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   705
                        else:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   706
                                raise
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   707
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   708
                if src != targ:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   709
                        log.info("linking %s -> %s" % (src, dst))
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   710
                        rm_f(dst)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   711
                        os.symlink(src, dst)
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   712
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   713
def run_cmd(args, swdir, env=None):
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   714
                if env is None:
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   715
                        env = os.environ
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   716
                ret = subprocess.Popen(args, cwd=swdir, env=env).wait()
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   717
                if ret != 0:
1208
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   718
                        print >> sys.stderr, \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   719
                            "install failed and returned %d." % ret
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   720
                        print >> sys.stderr, \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   721
                            "Command was: %s" % " ".join(args)
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   722
                        sys.exit(1)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   723
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   724
def _copy_file_contents(src, dst, buffer_size=16*1024):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   725
        """A clone of distutils.file_util._copy_file_contents() that strips the
2597
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   726
        CDDL text.  For Python files, we replace the CDDL text with an equal
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   727
        number of empty comment lines so that line numbers match between the
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   728
        source and destination files."""
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   729
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   730
        # Match the lines between and including the CDDL header signposts, as
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   731
        # well as empty comment lines before and after, if they exist.
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   732
        cddl_re = re.compile("\n(#\s*\n)?^[^\n]*CDDL HEADER START.+"
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   733
            "CDDL HEADER END[^\n]*$(\n#\s*$)?", re.MULTILINE|re.DOTALL)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   734
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   735
        with file(src, "r") as sfp:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   736
                try:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   737
                        os.unlink(dst)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   738
                except EnvironmentError, e:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   739
                        if e.errno != errno.ENOENT:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   740
                                raise DistutilsFileError("could not delete "
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   741
                                    "'%s': %s" % (dst, e))
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   742
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   743
                with file(dst, "w") as dfp:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   744
                        while True:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   745
                                buf = sfp.read(buffer_size)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   746
                                if not buf:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   747
                                        break
2597
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   748
                                if src.endswith(".py"):
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   749
                                        match = cddl_re.search(buf)
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   750
                                        if match:
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   751
                                                # replace the CDDL expression
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   752
                                                # with the same number of empty
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   753
                                                # comment lines as the cddl_re
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   754
                                                # matched.
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   755
                                                substr = buf[
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   756
                                                    match.start():match.end()]
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   757
                                                count = len(
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   758
                                                    substr.split("\n")) - 2
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   759
                                                blanks = "#\n" * count
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   760
                                                buf = cddl_re.sub("\n" + blanks,
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   761
                                                    buf)
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   762
                                else:
d77be056d7ec 18628 pkglint needs to support mediated links
Tim Foster <tim.s.foster@oracle.com>
parents: 2561
diff changeset
   763
                                         buf = cddl_re.sub("", buf)
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   764
                                dfp.write(buf)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   765
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   766
# Make file_util use our version of _copy_file_contents
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   767
file_util._copy_file_contents = _copy_file_contents
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   768
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   769
def intltool_merge(src, dst):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   770
        if not dep_util.newer(src, dst):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   771
                return
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   772
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   773
        args = [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   774
            "/usr/bin/intltool-merge", "-d", "-u",
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   775
            "-c", "po/.intltool-merge-cache", "po", src, dst
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   776
        ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   777
        print " ".join(args)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   778
        run_cmd(args, os.getcwd(), os.environ.copy().update({"LC_ALL": "C"}))
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   779
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   780
def msgfmt(src, dst):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   781
        if not dep_util.newer(src, dst):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   782
                return
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   783
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   784
        args = ["/usr/bin/msgfmt", "-o", dst, src]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   785
        print " ".join(args)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   786
        run_cmd(args, os.getcwd())
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   787
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   788
def xml2po(src, dst, mofile):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   789
        msgfmt(mofile[:-3] + ".po", mofile)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   790
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   791
        monewer = dep_util.newer(mofile, dst)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   792
        srcnewer = dep_util.newer(src, dst)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   793
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   794
        if not srcnewer and not monewer:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   795
                return
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   796
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   797
        args = ["/usr/bin/xml2po", "-t", mofile, "-o", dst, src]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   798
        print " ".join(args)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   799
        run_cmd(args, os.getcwd())
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   800
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   801
class installfile(Command):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   802
        user_options = [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   803
            ("file=", "f", "source file to copy"),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   804
            ("dest=", "d", "destination directory"),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   805
            ("mode=", "m", "file mode"),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   806
        ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   807
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   808
        description = "De-CDDLing file copy"
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   809
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   810
        def initialize_options(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   811
                self.file = None
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   812
                self.dest = None
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   813
                self.mode = None
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   814
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   815
        def finalize_options(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   816
                if self.mode is None:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   817
                        self.mode = 0644
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   818
                elif isinstance(self.mode, basestring):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   819
                        try:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   820
                                self.mode = int(self.mode, 8)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   821
                        except ValueError:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   822
                                self.mode = 0644
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   823
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   824
        def run(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   825
                dest_file = os.path.join(self.dest, os.path.basename(self.file))
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   826
                ret = self.copy_file(self.file, dest_file)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   827
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   828
                os.chmod(dest_file, self.mode)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   829
                os.utime(dest_file, None)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   830
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   831
                return ret
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   832
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   833
class build_func(_build):
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   834
        sub_commands = _build.sub_commands + [('build_data', None)]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   835
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   836
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   837
                _build.initialize_options(self)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   838
                self.build_base = build_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   839
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   840
def get_hg_version():
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   841
        try:
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   842
                p = subprocess.Popen(['hg', 'id', '-i'], stdout = subprocess.PIPE)
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   843
                return p.communicate()[0].strip()
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   844
        except OSError:
384
9d4746e5dd3e 115 pkg needs to not have a cow on a SIGPIPE
Shawn Walker <swalker@opensolaris.org>
parents: 383
diff changeset
   845
                print >> sys.stderr, "ERROR: unable to obtain mercurial version"
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   846
                return "unknown"
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   847
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   848
def syntax_check(filename):
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   849
        """ Run python's compiler over the file, and discard the results.
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   850
            Arrange to generate an exception if the file does not compile.
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   851
            This is needed because distutil's own use of pycompile (in the
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   852
            distutils.utils module) is broken, and doesn't stop on error. """
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   853
        try:
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   854
                py_compile.compile(filename, os.devnull, doraise=True)
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   855
        except py_compile.PyCompileError, e:
2242
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   856
                res = ""
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   857
                for err in e.exc_value:
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   858
                        if isinstance(err, basestring):
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   859
                                res += err + "\n"
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   860
                                continue
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   861
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   862
                        # Assume it's a tuple of (filename, lineno, col, code)
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   863
                        fname, line, col, code = err
2337
acd36bf537d3 18271 setup.py can die if "col" is None
Danek Duvall <danek.duvall@oracle.com>
parents: 2335
diff changeset
   864
                        res += "line %d, column %s, in %s:\n%s" % (line,
acd36bf537d3 18271 setup.py can die if "col" is None
Danek Duvall <danek.duvall@oracle.com>
parents: 2335
diff changeset
   865
                            col or "unknown", fname, code)
2242
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   866
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   867
                raise DistutilsError(res)
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   868
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   869
# On Solaris, ld inserts the full argument to the -o option into the symbol
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   870
# table.  This means that the resulting object will be different depending on
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   871
# the path at which the workspace lives, and not just on the interesting content
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   872
# of the object.
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   873
#
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   874
# In order to work around that bug (7076871), we create a new compiler class
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   875
# that looks at the argument indicating the output file, chdirs to its
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   876
# directory, and runs the real link with the output file set to just the base
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   877
# name of the file.
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   878
#
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   879
# Unfortunately, distutils isn't too customizable in this regard, so we have to
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   880
# twiddle with a couple of the names in the distutils.ccompiler namespace: we
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   881
# have to add a new entry to the compiler_class dict, and we have to override
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   882
# the new_compiler() function to point to our own.  Luckily, our copy of
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   883
# new_compiler() gets to be very simple, since we always know what we want to
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   884
# return.
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   885
class MyUnixCCompiler(UnixCCompiler):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   886
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   887
        def link(self, *args, **kwargs):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   888
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   889
                output_filename = args[2]
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   890
                output_dir = kwargs.get('output_dir')
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   891
                cwd = os.getcwd()
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   892
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   893
                assert(not output_dir)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   894
                output_dir = os.path.join(cwd, os.path.dirname(output_filename))
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   895
                output_filename = os.path.basename(output_filename)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   896
                nargs = args[:2] + (output_filename,) + args[3:]
2677
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   897
                if not os.path.exists(output_dir):
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   898
                        os.mkdir(output_dir, 0755)
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   899
                os.chdir(output_dir)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   900
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   901
                UnixCCompiler.link(self, *nargs, **kwargs)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   902
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   903
                os.chdir(cwd)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   904
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   905
distutils.ccompiler.compiler_class['myunix'] = (
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   906
    'unixccompiler', 'MyUnixCCompiler',
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   907
    'standard Unix-style compiler with a link stage modified for Solaris'
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   908
)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   909
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   910
def my_new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   911
        return MyUnixCCompiler(None, dry_run, force)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   912
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   913
if osname == 'sunos':
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   914
        distutils.ccompiler.new_compiler = my_new_compiler
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   915
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   916
class build_ext_func(_build_ext):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   917
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   918
        def initialize_options(self):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   919
                _build_ext.initialize_options(self)
2677
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   920
                self.build64 = False
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   921
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   922
                if osname == 'sunos':
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   923
                        self.compiler = 'myunix'
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   924
2677
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   925
        def build_extension(self, ext):
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   926
                # Build 32-bit
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   927
                log.info("building 32-bit extension")
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   928
                _build_ext.build_extension(self, ext)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   929
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   930
                # Set up for 64-bit
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   931
                old_build_temp = self.build_temp
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   932
                d, f = os.path.split(self.build_temp)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   933
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   934
                # store our 64-bit extensions elsewhere
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   935
                self.build_temp = d + "/temp64.%s" % \
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   936
                    os.path.basename(self.build_temp).replace("temp.", "")
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   937
                ext.extra_compile_args += ["-m64"]
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   938
                ext.extra_link_args += ["-m64"]
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   939
                self.build64 = True
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   940
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   941
                # Build 64-bit
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   942
                log.info("building 64-bit extension")
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   943
                _build_ext.build_extension(self, ext)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   944
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   945
                # Reset to 32-bit
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   946
                self.build_temp = old_build_temp
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   947
                ext.extra_compile_args.remove("-m64")
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   948
                ext.extra_link_args.remove("-m64")
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   949
                self.build64 = False
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   950
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   951
        def get_ext_fullpath(self, ext_name):
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   952
                path = _build_ext.get_ext_fullpath(self, ext_name)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   953
                if not self.build64:
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   954
                        return path
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   955
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   956
                dpath, fpath = os.path.split(path)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   957
                return os.path.join(dpath, "64", fpath)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   958
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
   959
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   960
class build_py_func(_build_py):
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   961
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   962
        def __init__(self, dist):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   963
                ret = _build_py.__init__(self, dist)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   964
2561
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   965
                self.copied = []
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
   966
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   967
                # Gather the timestamps of the .py files in the gate, so we can
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   968
                # force the mtimes of the built and delivered copies to be
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   969
                # consistent across builds, causing their corresponding .pyc
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   970
                # files to be unchanged unless the .py file content changed.
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   971
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   972
                self.timestamps = {}
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   973
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   974
                p = subprocess.Popen(
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   975
                    [sys.executable, os.path.join(pwd, "pydates")],
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   976
                    stdout=subprocess.PIPE)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   977
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   978
                for line in p.stdout:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   979
                        stamp, path = line.split()
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   980
                        stamp = float(stamp)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   981
                        self.timestamps[path] = stamp
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   982
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   983
                if p.wait() != 0:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   984
                        print >> sys.stderr, "ERROR: unable to gather .py " \
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   985
                            "timestamps"
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   986
                        sys.exit(1)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   987
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   988
                return ret
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
   989
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   990
        # override the build_module method to do VERSION substitution on
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
   991
        # pkg/__init__.py
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   992
        def build_module (self, module, module_file, package):
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   993
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   994
                if module == "__init__" and package == "pkg":
422
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   995
                        versionre = '(?m)^VERSION[^"]*"([^"]*)"'
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   996
                        # Grab the previously-built version out of the build
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   997
                        # tree.
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   998
                        try:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   999
                                ocontent = \
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1000
                                    file(self.get_module_outfile(self.build_lib,
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1001
                                        [package], module)).read()
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1002
                                ov = re.search(versionre, ocontent).group(1)
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1003
                        except IOError:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1004
                                ov = None
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1005
                        v = get_hg_version()
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1006
                        vstr = 'VERSION = "%s"' % v
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1007
                        # If the versions haven't changed, there's no need to
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1008
                        # recompile.
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1009
                        if v == ov:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1010
                                return
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1011
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1012
                        mcontent = file(module_file).read()
422
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1013
                        mcontent = re.sub(versionre, vstr, mcontent)
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1014
                        tmpfd, tmp_file = tempfile.mkstemp()
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1015
                        os.write(tmpfd, mcontent)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1016
                        os.close(tmpfd)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1017
                        print "doing version substitution: ", v
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1018
                        rv = _build_py.build_module(self, module, tmp_file, package)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1019
                        os.unlink(tmp_file)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1020
                        return rv
422
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
  1021
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
  1022
                # Will raise a DistutilsError on failure.
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
  1023
                syntax_check(module_file)
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
  1024
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1025
                return _build_py.build_module(self, module, module_file, package)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1026
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1027
        def copy_file(self, infile, outfile, preserve_mode=1, preserve_times=1,
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1028
            link=None, level=1):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1029
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1030
                # If the timestamp on the source file (coming from mercurial if
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1031
                # unchanged, or from the filesystem if changed) doesn't match
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1032
                # the filesystem timestamp on the destination, then force the
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1033
                # copy to make sure the right data is in place.
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1034
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1035
                try:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1036
                        dst_mtime = os.stat(outfile).st_mtime
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1037
                except OSError, e:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1038
                        if e.errno != errno.ENOENT:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1039
                                raise
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1040
                        dst_mtime = time.time()
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1041
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1042
                # The timestamp for __init__.py is the timestamp for the
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1043
                # workspace itself.
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1044
                if outfile.endswith("/pkg/__init__.py"):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1045
                        src_mtime = self.timestamps["."]
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1046
                else:
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1047
                        src_mtime = self.timestamps.get(
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1048
                            os.path.join("src", infile), self.timestamps["."])
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1049
2561
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
  1050
                # Force a copy of the file if the source timestamp is different
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
  1051
                # from that of the destination, not just if it's newer.  This
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
  1052
                # allows timestamps in the working directory to regress (for
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
  1053
                # instance, following the reversion of a change).
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1054
                if dst_mtime != src_mtime:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1055
                        f = self.force
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1056
                        self.force = True
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1057
                        dst, copied = _build_py.copy_file(self, infile, outfile,
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1058
                            preserve_mode, preserve_times, link, level)
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1059
                        self.force = f
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1060
                else:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1061
                        dst, copied = outfile, 0
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1062
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1063
                # If we copied the file, then we need to go and readjust the
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1064
                # timestamp on the file to match what we have in our database.
2561
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
  1065
                # Save the filename aside for our version of install_lib.
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1066
                if copied and dst.endswith(".py"):
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1067
                        os.utime(dst, (src_mtime, src_mtime))
2561
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
  1068
                        self.copied.append(dst)
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1069
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1070
                return dst, copied
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1071
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1072
class build_data_func(Command):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1073
        description = "build data files whose source isn't in deliverable form"
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1074
        user_options = []
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1075
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1076
        # As a subclass of distutils.cmd.Command, these methods are required to
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1077
        # be implemented.
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1078
        def initialize_options(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1079
                pass
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1080
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1081
        def finalize_options(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1082
                pass
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1083
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1084
        def run(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1085
                # Anything that gets created here should get deleted in
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1086
                # clean_func.run() below.
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1087
                for f in intl_files:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1088
                        intltool_merge(f, f[:-3])
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1089
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1090
                for l in help_locales:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1091
                        path = "gui/help/%s/" % l
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1092
                        xml2po(path + "package-manager.xml.in",
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1093
                            path + "package-manager.xml",
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1094
                            path + "%s.mo" % l)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1095
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1096
                for l in pkg_locales:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1097
                        msgfmt("po/%s.po" % l, "po/%s.mo" % l)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1098
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1099
def rm_f(filepath):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1100
        """Remove a file without caring whether it exists."""
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1101
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1102
        try:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1103
                os.unlink(filepath)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1104
        except OSError, e:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1105
                if e.errno != errno.ENOENT:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1106
                        raise
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1107
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1108
class clean_func(_clean):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
  1109
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1110
                _clean.initialize_options(self)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1111
                self.build_base = build_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1112
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1113
        def run(self):
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1114
                _clean.run(self)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1115
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1116
                rm_f("po/.intltool-merge-cache")
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1117
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1118
                for f in intl_files:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1119
                        rm_f(f[:-3])
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1120
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1121
                for l in pkg_locales:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1122
                        rm_f("po/%s.mo" % l)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1123
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1124
                for l in help_locales:
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1125
                        path = "gui/help/%s/" % l
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1126
                        rm_f(path + "package-manager.xml")
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1127
                        rm_f(path + "%s.mo" % l)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1128
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1129
class clobber_func(Command):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1130
        user_options = []
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1131
        description = "Deletes any and all files created by setup"
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1132
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1133
        def initialize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1134
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1135
        def finalize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1136
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1137
        def run(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1138
                # nuke everything
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1139
                print("deleting " + dist_dir)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1140
                shutil.rmtree(dist_dir, True)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1141
                print("deleting " + build_dir)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1142
                shutil.rmtree(build_dir, True)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1143
                print("deleting " + root_dir)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1144
                shutil.rmtree(root_dir, True)
534
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
  1145
                print("deleting " + pkgs_dir)
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
  1146
                shutil.rmtree(pkgs_dir, True)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
  1147
                print("deleting " + extern_dir)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
  1148
                shutil.rmtree(extern_dir, True)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1149
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1150
class test_func(Command):
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1151
        # NOTE: these options need to be in sync with tests/run.py and the
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1152
        # list of options stored in initialize_options below. The first entry
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1153
        # in each tuple must be the exact name of a member variable.
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
  1154
        user_options = [
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1155
            ("archivedir=", 'a', "archive failed tests <dir>"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
  1156
            ("baselinefile=", 'b', "baseline file <file>"),
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
  1157
            ("coverage", "c", "collect code coverage data"),
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1158
            ("genbaseline", 'g', "generate test baseline"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
  1159
            ("only=", "o", "only <regex>"),
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1160
            ("parseable", 'p', "parseable output"),
2272
d81ea073d050 3617 Testsuite should allow choice for base port to use
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2263
diff changeset
  1161
            ("port=", "z", "lowest port to start a depot on"),
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1162
            ("timing", "t", "timing file <file>"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
  1163
            ("verbosemode", 'v', "run tests in verbose mode"),
2340
194a87d123d4 18072 Automated GUI tests broken
Michal Pryc <Michal.Pryc@Oracle.Com>
parents: 2339
diff changeset
  1164
            ("enableguitests", 'u', "enable IPS GUI tests, disabled by default"),
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1165
            ("stoponerr", 'x', "stop when a baseline mismatch occurs"),
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1166
            ("debugoutput", 'd', "emit debugging output"),
1716
10e09e28528a 12257 setup.py doesn't respect run.py options [fix traceback]
Dan Price <dp@eng.sun.com>
parents: 1715
diff changeset
  1167
            ("showonexpectedfail", 'f',
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1168
                "show all failure info, even for expected fails"),
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1169
            ("startattest=", 's', "start at indicated test"),
2499
683824f135a1 18636 a single test suite run should be parallelizable
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2494
diff changeset
  1170
            ("jobs=", 'j', "number of parallel processes to use"),
683824f135a1 18636 a single test suite run should be parallelizable
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2494
diff changeset
  1171
            ("quiet", "q", "use the dots as the output format"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
  1172
        ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1173
        description = "Runs unit and functional tests"
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1174
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1175
        def initialize_options(self):
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1176
                self.only = ""
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1177
                self.baselinefile = ""
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
  1178
                self.verbosemode = 0
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1179
                self.parseable = 0
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
  1180
                self.genbaseline = 0
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1181
                self.timing = 0
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
  1182
                self.coverage = 0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1183
                self.stoponerr = 0
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1184
                self.debugoutput = 0
1716
10e09e28528a 12257 setup.py doesn't respect run.py options [fix traceback]
Dan Price <dp@eng.sun.com>
parents: 1715
diff changeset
  1185
                self.showonexpectedfail = 0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1186
                self.startattest = ""
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
  1187
                self.archivedir = ""
2272
d81ea073d050 3617 Testsuite should allow choice for base port to use
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2263
diff changeset
  1188
                self.port = 12001
2499
683824f135a1 18636 a single test suite run should be parallelizable
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2494
diff changeset
  1189
                self.jobs = 1
683824f135a1 18636 a single test suite run should be parallelizable
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2494
diff changeset
  1190
                self.quiet = False
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1191
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1192
        def finalize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1193
                pass
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1194
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1195
        def run(self):
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
  1196
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1197
                os.putenv('PYEXE', sys.executable)
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1198
                os.chdir(os.path.join(pwd, "tests"))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1199
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1200
                # Reconstruct the cmdline and send that to run.py
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1201
                cmd = [sys.executable, "run.py"]
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1202
                args = ""
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1203
                if "test" in sys.argv:
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1204
                        args = sys.argv[sys.argv.index("test")+1:]
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
  1205
                        cmd.extend(args)
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
  1206
                subprocess.call(cmd)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1207
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1208
class dist_func(_bdist):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1209
        def initialize_options(self):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
  1210
                _bdist.initialize_options(self)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1211
                self.dist_dir = dist_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1212
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1213
# These are set to real values based on the platform, down below
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1214
compile_args = None
1637
0a60d77db8d9 13796 pkg(5) could stand to have its C modules optimized
Danek Duvall <danek.duvall@sun.com>
parents: 1632
diff changeset
  1215
if osname in ("sunos", "linux", "darwin"):
0a60d77db8d9 13796 pkg(5) could stand to have its C modules optimized
Danek Duvall <danek.duvall@sun.com>
parents: 1632
diff changeset
  1216
        compile_args = [ "-O3" ]
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1217
if osname == "sunos":
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1218
        link_args = [ "-zstrip-class=nonalloc" ]
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1219
else:
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1220
        link_args = []
613
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1221
ext_modules = [
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1222
        Extension(
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1223
                'actions._actions',
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1224
                _actions_srcs,
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1225
                include_dirs = include_dirs,
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1226
                extra_compile_args = compile_args,
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1227
                extra_link_args = link_args
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1228
                ),
1632
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
  1229
        Extension(
2639
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1230
                'actions._common',
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1231
                _actcomm_srcs,
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1232
                include_dirs = include_dirs,
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1233
                extra_compile_args = compile_args,
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1234
                extra_link_args = link_args
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1235
                ),
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1236
        Extension(
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1237
                '_varcet',
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1238
                _varcet_srcs,
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1239
                include_dirs = include_dirs,
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1240
                extra_compile_args = compile_args,
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1241
                extra_link_args = link_args
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1242
                ),
06a370373267 7145683 explore general pkg performance improvements
Shawn Walker <shawn.walker@oracle.com>
parents: 2597
diff changeset
  1243
        Extension(
1632
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
  1244
                'solver',
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
  1245
                solver_srcs,
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
  1246
                include_dirs = include_dirs + ["."],
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
  1247
                extra_compile_args = compile_args,
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1248
                extra_link_args = link_args + solver_link_args,
1632
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
  1249
                define_macros = [('_FILE_OFFSET_BITS', '64')]
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
  1250
                ),
613
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1251
        ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1252
elf_libraries = None
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
  1253
data_files = web_files
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1254
cmdclasses = {
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1255
        'install': install_func,
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1256
        'install_data': install_data_func,
2561
99ce9d129c70 18815 make install doesn't seem to update proto area any more
Danek Duvall <danek.duvall@oracle.com>
parents: 2535
diff changeset
  1257
        'install_lib': install_lib_func,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1258
        'build': build_func,
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1259
        'build_data': build_data_func,
2508
619ec4359319 5965 all .pyc files are shipped in every update
Danek Duvall <danek.duvall@oracle.com>
parents: 2499
diff changeset
  1260
        'build_ext': build_ext_func,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1261
        'build_py': build_py_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1262
        'bdist': dist_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1263
        'lint': lint_func,
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1264
        'clint': clint_func,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1265
        'pylint': pylint_func,
2364
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
  1266
        'pylint_quiet': pylint_func_quiet,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1267
        'clean': clean_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1268
        'clobber': clobber_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1269
        'test': test_func,
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1270
        'installfile': installfile,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1271
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1272
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
  1273
# all builds of IPS should have manpages
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1274
data_files += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1275
        (man1_dir, man1_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1276
        (man1m_dir, man1m_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1277
        (man5_dir, man5_files),
2516
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
  1278
        (man1_ja_JP_dir, man1_ja_files),
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
  1279
        (man1m_ja_JP_dir, man1m_ja_files),
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
  1280
        (man5_ja_JP_dir, man5_ja_files),
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
  1281
        (man1_zh_CN_dir, man1_zh_CN_files),
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
  1282
        (man1m_zh_CN_dir, man1m_zh_CN_files),
bcea906ea68d 18837 add translated nroff man pages
Shawn Walker <shawn.walker@oracle.com>
parents: 2508
diff changeset
  1283
        (man5_zh_CN_dir, man5_zh_CN_files),
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
  1284
        (resource_dir, resource_files),
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1285
        ]
2523
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
  1286
# add transforms
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
  1287
data_files += [
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
  1288
        (transform_dir, transform_files)
408a88a59f16 18805 IPS should include sample pkgmogrify transforms for Solaris
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2516
diff changeset
  1289
        ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1290
if osname == 'sunos':
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1291
        # Solaris-specific extensions are added here
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1292
        data_files += [
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1293
                (smf_app_dir, smf_app_files),
1498
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
  1294
                (execattrd_dir, execattrd_files),
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
  1295
                (authattrd_dir, authattrd_files),
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1296
                (sysrepo_dir, sysrepo_files),
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1297
                (sysrepo_logs_dir, sysrepo_log_stubs),
2535
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1298
                (sysrepo_cache_dir, {}),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1299
                (autostart_dir, autostart_files),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1300
                (desktop_dir, desktop_files),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1301
                (gconf_dir, gconf_files),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1302
                (omf_dir, omf_files),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1303
                ('usr/share/icons/hicolor/48x48/mimetypes',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1304
                    ['gui/data/gnome-mime-application-vnd.pkg5.info.png']),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1305
                ('usr/share/mime/packages', ['gui/data/packagemanager-info.xml']),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1306
                (pm_share_dir, ['gui/data/packagemanager.ui']),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1307
                ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1308
        data_files += [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1309
            (os.path.join(startpage_dir, locale), files)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1310
            for locale, files in startpage_files.iteritems()
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1311
        ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1312
        data_files += [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1313
            (os.path.join(help_dir, locale), files)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1314
            for locale, files in help_files.iteritems()
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1315
        ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1316
        data_files += [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1317
            (os.path.join(locale_dir, locale, 'LC_MESSAGES'),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1318
                [('po/%s.mo' % locale, 'pkg.mo')])
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1319
            for locale in pkg_locales
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1320
        ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1321
        for t in 'HighContrast', 'HighContrastInverse', '':
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1322
                for px in '24', '36', '48':
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1323
                        data_files += [(
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1324
                            '%s/icons/%s/%sx%s/actions' % (um_share_dir, t or 'hicolor', px, px),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1325
                            ['um/data/icons/%s/%sx%s/updatemanager.png' % (t, px, px)]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1326
                        )]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1327
                data_files += [(
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1328
                    '%s/icons/%s/16x16/actions' % (pm_share_dir, t or 'hicolor'),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1329
                    [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1330
                        'gui/data/icons/%s/16x16/%s.png' % (t, n)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1331
                        for n in ('filter_all', 'filter_selected', 'progress_checkmark',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1332
                            'selection', 'status_checkmark', 'status_installed',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1333
                            'status_newupdate', 'status_notinstalled')
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1334
                    ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1335
                )]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1336
                data_files += [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1337
                    ('%s/icons/%s/%sx%s/actions' % (pm_share_dir, t or 'hicolor', px, px),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1338
                    [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1339
                        'gui/data/icons/%s/%sx%s/%s.png' % (t, px, px, n)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1340
                        for n in ('pm-install_update', 'pm-refresh',
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1341
                            'pm-remove', 'pm-update_all')
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1342
                    ])
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1343
                    for px in (24, 48)
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1344
                ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1345
                data_files += [(
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1346
                    '%s/icons/%s/48x48/actions' % (pm_share_dir, t or 'hicolor'),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1347
                    ['gui/data/icons/%s/48x48/packagemanager.png' % t]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1348
                )]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1349
                data_files += [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1350
                    ('usr/share/icons/%s/48x48/apps' % (t or 'hicolor'),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1351
                        [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1352
                            'um/data/icons/%s/48x48/updatemanager.png' % t,
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1353
                            'gui/data/icons/%s/48x48/packagemanager.png' % t
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1354
                        ]),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1355
                ]
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1356
                # These two icons don't fit any patterns.
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1357
                data_files += [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1358
                    (os.path.join(pm_share_dir, 'icons/hicolor/16x16/actions'), [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1359
                        'gui/data/icons/16x16/progress_blank.png']),
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1360
                    (os.path.join(pm_share_dir, 'icons/hicolor/24x24/actions'), [
8dca919216c6 18768 need to remove CDDL from installed files
Danek Duvall <danek.duvall@oracle.com>
parents: 2523
diff changeset
  1361
                        'gui/data/icons/24x24/pm-check.png']),
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1362
                ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1363
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1364
if osname == 'sunos' or osname == "linux":
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1365
        # Unix platforms which the elf extension has been ported to
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1366
        # are specified here, so they are built automatically
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1367
        elf_libraries = ['elf']
613
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1368
        ext_modules += [
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1369
                Extension(
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1370
                        'elf',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1371
                        elf_srcs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1372
                        include_dirs = include_dirs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1373
                        libraries = elf_libraries,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1374
                        extra_compile_args = compile_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1375
                        extra_link_args = link_args
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1376
                        ),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1377
                ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1378
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1379
        # Solaris has built-in md library and Solaris-specific arch extension
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1380
        # All others use OpenSSL and cross-platform arch module
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1381
        if osname == 'sunos':
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1382
            elf_libraries += [ 'md' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1383
            ext_modules += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1384
                    Extension(
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
  1385
                            'arch',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1386
                            arch_srcs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1387
                            include_dirs = include_dirs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1388
                            extra_compile_args = compile_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1389
                            extra_link_args = link_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1390
                            define_macros = [('_FILE_OFFSET_BITS', '64')]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1391
                            ),
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1392
                    Extension(
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1393
                            'pspawn',
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1394
                            pspawn_srcs,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1395
                            include_dirs = include_dirs,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1396
                            extra_compile_args = compile_args,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1397
                            extra_link_args = link_args,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1398
                            define_macros = [('_FILE_OFFSET_BITS', '64')]
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1399
                            ),
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1400
                    Extension(
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1401
                            'syscallat',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1402
                            syscallat_srcs,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1403
                            include_dirs = include_dirs,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1404
                            extra_compile_args = compile_args,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1405
                            extra_link_args = link_args,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1406
                            define_macros = [('_FILE_OFFSET_BITS', '64')]
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1407
                            ),
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1408
                    ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1409
        else:
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1410
            elf_libraries += [ 'ssl' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1411
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1412
setup(cmdclass = cmdclasses,
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
  1413
    name = 'pkg',
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
  1414
    version = '0.1',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1415
    package_dir = {'pkg':'modules'},
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1416
    packages = packages,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1417
    data_files = data_files,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1418
    ext_package = 'pkg',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1419
    ext_modules = ext_modules,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1420
    )
2677
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1421
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1422
# We don't support 64-bit yet, but 64-bit _actions.so, _common.so and _varcet.so
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1423
# are needed for a system repository mod_wsgi application, sysrepo_p5p.py.
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1424
# Remove the others.
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1425
remove_libs = ["arch.so",
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1426
    "elf.so",
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1427
    "pspawn.so",
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1428
    "solver.so",
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1429
    "syscallat.so"
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1430
]
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1431
pkg_64_path = os.path.join(root_dir, "usr/lib/python2.6/vendor-packages/pkg/64")
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1432
for lib in remove_libs:
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1433
        rm_path = os.path.join(pkg_64_path, lib)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1434
        if os.path.exists(rm_path):
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1435
                log.info("Removing unnecessary 64-bit library: %s" % lib)
7f1c7dd5254f 7140764 pkg.sysrepo should support p5p files
Tim Foster <tim.s.foster@oracle.com>
parents: 2674
diff changeset
  1436
                os.unlink(rm_path)