Changeset 3494


Ignore:
Timestamp:
Jun 19, 2007, 1:17:22 AM (18 years ago)
Author:
bird
Message:

Applied OS/2 patches (manually).

Location:
trunk/essentials/sys-apps/prefix-portage
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/essentials/sys-apps/prefix-portage/bin/ebuild.sh

    r3488 r3494  
    2323                source "${T}/environment" >& /dev/null
    2424        fi
     25fi
     26
     27PATH_SEP="@PATH_SEPARATOR@"
     28if [ "${PATH_SEP}" = "@"PATH_SEPARATOR$"@" ]; then
     29    PATH_SEP=":"
    2530fi
    2631
     
    6570unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
    6671
    67 export PATH="${DEFAULT_PATH}:${PORTAGE_BIN_PATH}:${ROOTPATH}"
    68 [ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}:$PATH"
     72# bird: kNIX requires ';' and the old PATH to work right. The latter is
     73#       because the gcc and other toolchain programs initially are
     74#       installed outside the kNIX penthouse.
     75if [ "${EPREFIX}" != "/" -o "{PPATH_SEP}" != ":" ]; then
     76    export PATH="${DEFAULT_PATH}${PATH_SEP}${PORTAGE_BIN_PATH}${PATH_SEP}${ROOTPATH}${PATH_SEP}${PATH}"
     77else
     78    export PATH="${DEFAULT_PATH}${PATH_SEP}${PORTAGE_BIN_PATH}${PATH_SEP}${ROOTPATH}"
     79fi
     80[ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}${PATH_SEP}$PATH"
    6981
    7082source "@PORTAGE_BASE@"/bin/isolated-functions.sh &>/dev/null
     
    13631375                                remove_path_entry "distcc"
    13641376                        fi
    1365                         export PATH="${EPREFIX}/usr/lib/distcc/bin:${PATH}"
     1377                        export PATH="${EPREFIX}/usr/lib/distcc/bin${PATH_SEP}${PATH}"
    13661378                        [ ! -z "${DISTCC_LOG}" ] && addwrite "$(dirname ${DISTCC_LOG})"
    13671379                elif which distcc &>/dev/null; then
     
    13831395
    13841396                if [ -d "${EPREFIX}"/usr/lib/ccache/bin ]; then
    1385                         export PATH="${EPREFIX}/usr/lib/ccache/bin:${PATH}"
     1397                        export PATH="${EPREFIX}/usr/lib/ccache/bin${PATH_SEP}${PATH}"
    13861398                elif [ -d "${EPREFIX}"/usr/bin/ccache ]; then
    1387                         export PATH="${EPREFIX}/usr/bin/ccache:${PATH}"
     1399                        export PATH="${EPREFIX}/usr/bin/ccache${PATH_SEP}${PATH}"
    13881400                fi
    13891401
  • trunk/essentials/sys-apps/prefix-portage/bin/prepstrip

    r3488 r3494  
    33# Distributed under the terms of the GNU General Public License v2
    44# $Id$
     5
     6# bird: We shouldn't get here on OS/2, but if we do make
     7#       sure we quit immediately. (for now, anyway)
     8case "${BASH_VERSINFO[5]}" in
     9    *-os2*) exit 0
     10        ;;
     11esac   
    512
    613source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh
  • trunk/essentials/sys-apps/prefix-portage/pym/emerge/__init__.py

    r3488 r3494  
    216216                file_path = EPREFIX+"/var/log/emerge.log"
    217217                mylogfile = open(file_path, "a")
     218                if sys.platform == "os2knix":           # bird: chmod doesn't work if the file is open.
     219                        mylogfile.close();              #       So, close it while applying permissions.
    218220                portage.util.apply_secpass_permissions(file_path,
    219221                        uid=portage.portage_uid, gid=portage.portage_gid,
    220222                        mode=0660)
     223                if sys.platform == "os2knix":       # bird: see above
     224                        mylogfile = open(file_path, "a")#
    221225                mylock = None
    222226                try:
  • trunk/essentials/sys-apps/prefix-portage/pym/portage/const.py

    r3488 r3494  
    6767
    6868MANIFEST2_IDENTIFIERS = ["AUX","MISC","DIST","EBUILD"]
     69
     70# bird: drop RMD160 and SHA1 until we get dev-python/pycrypto up and going.
     71if sys.platform == "os2knix":
     72        MANIFEST1_HASH_FUNCTIONS = ["MD5"]
     73        MANIFEST2_HASH_FUNCTIONS = ["SHA1"]
     74
    6975# ===========================================================================
    7076# END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANT
  • trunk/essentials/sys-apps/prefix-portage/pym/portage/process.py

    r3488 r3494  
    169169            or not os.access(binary, os.X_OK)):
    170170                binary = path_lookup and find_binary(binary) or None
     171                # bird: try with exe suffix appended
     172                if not binary and sys.platform == "os2knix":
     173                        binary = mycommand[0]+".exe"
     174                        if (not os.path.isabs(binary) or not os.path.isfile(binary)
     175                                or not os.access(binary, os.X_OK)):
     176                                binary = None
    171177                if not binary:
    172178                        raise CommandNotFound(mycommand[0])
     
    334340                pre_exec()
    335341
     342        # bird: hack. OS/2 and kLIBC dislike empty environments. (FIXME)
     343        if len(env) == 0 and sys.platform == "os2knix":
     344                env = os.environ.copy()
     345
    336346        # And switch to the new process.
    337347        os.execve(binary, myargs, env)
     
    346356        @returns: full path to binary or None if the binary could not be located.
    347357        """
    348        
    349         for path in os.getenv("PATH", "").split(":"):
     358
     359        # bird: OS/2 uses ';' not ':'.
     360        sep = "@PATH_SEPARATOR@"
     361        if sep == "@"+"PATH_SEPARATOR"+"@":
     362                sep = ":"
     363
     364        for path in os.getenv("PATH", "").split(sep):
    350365                filename = "%s/%s" % (path, binary)
    351366                if os.access(filename, os.X_OK) and os.path.isfile(filename):
  • trunk/essentials/sys-apps/prefix-portage/pym/portage/util.py

    r3488 r3494  
    3838        We dislike this behavior so we create our own normpath func
    3939        to fix it.
     40        This doesn't apply to OS/2 kNIX where "//foo/bar" differs
     41        from "/foo/bar" in that the former is a UNC path while the
     42        later is a local path.
    4043        """
    41         if mypath.startswith(os.path.sep):
     44        if mypath.startswith(os.path.sep) and sys.platform != "os2knix"::
    4245                # posixpath.normpath collapses 3 or more leading slashes to just 1.
    4346                return os.path.normpath(2*os.path.sep + mypath)
  • trunk/essentials/sys-apps/prefix-portage/src/tbz2tool.c

    r3488 r3494  
    9999               
    100100                /* open datafile for reading */
    101                 if ((datafile=fopen(argv[2],"r"))==NULL) {
     101                if ((datafile=fopen(argv[2],"rb"))==NULL) {
    102102                        free(mybuf);
    103103                        free(mystat);
     
    107107               
    108108                /* open dbfile for reading */
    109                 if ((dbfile=fopen(argv[3],"r"))==NULL) {
     109                if ((dbfile=fopen(argv[3],"rb"))==NULL) {
    110110                        fclose(datafile);
    111111                        free(mybuf);
     
    116116       
    117117                /* open outfile for writing */
    118                 if ((outfile=fopen(argv[4],"a"))==NULL) {
     118                if ((outfile=fopen(argv[4],"ab"))==NULL) {
    119119                        fclose(dbfile);
    120120                        fclose(datafile);
     
    158158       
    159159                /* open infile for reading */
    160                 if ((infile=fopen(argv[2],"r"))==NULL) {
     160                if ((infile=fopen(argv[2],"rb"))==NULL) {
    161161                        free(mybuf);
    162162                        free(mystat);
     
    184184               
    185185                /* open datafile for writing */
    186                 if ((datafile=fopen(argv[3],"a"))==NULL) {
     186                if ((datafile=fopen(argv[3],"ab"))==NULL) {
    187187                        fclose(infile);
    188188                        free(mybuf);
     
    193193       
    194194                /* open dbfile for writing */
    195                 if ((dbfile=fopen(argv[4],"a"))==NULL) {
     195                if ((dbfile=fopen(argv[4],"ab"))==NULL) {
    196196                        fclose(datafile);
    197197                        fclose(infile);
Note: See TracChangeset for help on using the changeset viewer.