Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2007 10:20:11 +0100
From:      Pav Lucistnik <pav@FreeBSD.org>
To:        Hye-Shik Chang <perky@FreeBSD.org>
Cc:        python@FreeBSD.org
Subject:   Re: [Fwd: py25-TurboKid-1.0.1 pkg-plist errors on amd64 5]
Message-ID:  <1193649611.58220.16.camel@pav.hide.vol.cz>
In-Reply-To: <20071029011436.GA4293@FreeBSD.org>
References:  <1193387022.70430.11.camel@pav.hide.vol.cz> <20071029011436.GA4293@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-R9diglVbgVH8IlYd/Bmj
Content-Type: text/plain; charset=ISO8859-2
Content-Transfer-Encoding: quoted-printable

Hye-Shik Chang p=ED=B9e v po 29. 10. 2007 v 10:14 +0900:
> On Fri, Oct 26, 2007 at 10:23:42AM +0200, Pav Lucistnik wrote:
> > Still have plist problem after your recent bsd.python.mk changes
> >=20
>=20
> Hmm.  The problem doesn't happen on my machine.  Can I see the
> content of site.py that the port leaked?

I have no trouble reproducing it with marcuscom's Tinderbox.
site.py content follows:


def __boot():
    import sys, imp, os, os.path  =20
    PYTHONPATH =3D os.environ.get('PYTHONPATH')
    if PYTHONPATH is None or (sys.platform=3D=3D'win32' and not PYTHONPATH)=
:
        PYTHONPATH =3D []
    else:
        PYTHONPATH =3D PYTHONPATH.split(os.pathsep)

    pic =3D getattr(sys,'path_importer_cache',{})
    stdpath =3D sys.path[len(PYTHONPATH):]
    mydir =3D os.path.dirname(__file__)
    #print "searching",stdpath,sys.path

    for item in stdpath:
        if item=3D=3Dmydir or not item:
            continue    # skip if current dir. on Windows, or my own direct=
ory
        importer =3D pic.get(item)
        if importer is not None:
            loader =3D importer.find_module('site')
            if loader is not None:
                # This should actually reload the current module
                loader.load_module('site')
                break
        else:
            try:
                stream, path, descr =3D imp.find_module('site',[item])
            except ImportError:
                continue
            if stream is None:
                continue
            try:
                # This should actually reload the current module
                imp.load_module('site',stream,path,descr)
            finally:
                stream.close()
            break
    else:
        raise ImportError("Couldn't find the real 'site' module")

    #print "loaded", __file__

    known_paths =3D dict([(makepath(item)[1],1) for item in sys.path]) # 2.=
2 comp

    oldpos =3D getattr(sys,'__egginsert',0)   # save old insertion position
    sys.__egginsert =3D 0                     # and reset the current one

    for item in PYTHONPATH:
        addsitedir(item)

    sys.__egginsert +=3D oldpos           # restore effective old position
   =20
    d,nd =3D makepath(stdpath[0])
    insert_at =3D None
    new_path =3D []

    for item in sys.path:
        p,np =3D makepath(item)

        if np=3D=3Dnd and insert_at is None:
            # We've hit the first 'system' path entry, so added entries go =
here
            insert_at =3D len(new_path)

        if np in known_paths or insert_at is None:
            new_path.append(item)
        else:
            # new path after the insert point, back-insert it
            new_path.insert(insert_at, item)
            insert_at +=3D 1
           =20
    sys.path[:] =3D new_path

if __name__=3D=3D'site':   =20
    __boot()
    del __boot
   =20





--=20
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

Oh, no! Aaargh! It is the most unnatural, most disgusting
creature imaginable: a two-eyed cyclops!

--=-R9diglVbgVH8IlYd/Bmj
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Toto je =?UTF-8?Q?digit=C3=A1ln=C4=9B?=
	=?ISO-8859-1?Q?_podepsan=E1?= =?UTF-8?Q?_=C4=8D=C3=A1st?=
	=?ISO-8859-1?Q?_zpr=E1vy?=

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQBHJaXLntdYP8FOsoIRAvslAJ0cTT9u7qEBpw4MM0MMBZ9duIElSgCfX43e
h15qZmAy60fB2YnRwNQrkjw=
=5NXn
-----END PGP SIGNATURE-----

--=-R9diglVbgVH8IlYd/Bmj--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1193649611.58220.16.camel>