src/modules/portable/os_darwin.py
author shreyas.k.kulkarni@oracle.com
Wed, 22 Feb 2017 23:48:10 +0530
branchs11u3-sru
changeset 3518 e6b239f75e89
parent 1516 8c950a3b4171
permissions -rw-r--r--
21041778 upgrade of a group action that involves changing gid seems broken.
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: 1407
diff changeset
     1
#!/usr/bin/python
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
#
3518
e6b239f75e89 21041778 upgrade of a group action that involves changing gid seems broken.
shreyas.k.kulkarni@oracle.com
parents: 1516
diff changeset
    22
#
e6b239f75e89 21041778 upgrade of a group action that involves changing gid seems broken.
shreyas.k.kulkarni@oracle.com
parents: 1516
diff changeset
    23
# Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    25
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    26
"""
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
Most if not all of the os_unix methods apply on Darwin. The methods
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    28
below override the definitions from os_unix
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
"""
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
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 290
diff changeset
    31
from os_unix import \
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 290
diff changeset
    32
    get_isainfo, get_release, get_platform, get_group_by_name, \
3518
e6b239f75e89 21041778 upgrade of a group action that involves changing gid seems broken.
shreyas.k.kulkarni@oracle.com
parents: 1516
diff changeset
    33
    get_user_by_name, get_name_by_gid, get_name_by_uid, get_usernames_by_gid, \
e6b239f75e89 21041778 upgrade of a group action that involves changing gid seems broken.
shreyas.k.kulkarni@oracle.com
parents: 1516
diff changeset
    34
    is_admin, get_userid, get_username, chown, rename, remove, link, \
e6b239f75e89 21041778 upgrade of a group action that involves changing gid seems broken.
shreyas.k.kulkarni@oracle.com
parents: 1516
diff changeset
    35
    split_path, get_root, assert_mode
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 290
diff changeset
    36
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
    37
import macostools
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    38
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    39
def copyfile(src, dst):
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
        """
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    41
        Use the Mac OS X-specific version of copyfile() so that
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
        Mac OS X stuff gets handled properly.
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
        """
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
        macostools.copy(src, dst)
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    45