* [gentoo-portage-dev] Deprecate portage.abssymlink
@ 2009-03-10 12:38 Douglas Anderson
0 siblings, 0 replies; only message in thread
From: Douglas Anderson @ 2009-03-10 12:38 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 357 bytes --]
I can't make out the different between portage.abssymlink and
os.path.realpath, besides that realpath is used a LOT more in portage
and abssympath dies if it gets passed something that's not a symlink.
Let's get rid of it!
1st patch is for trunk/pym/__init__.py
2nd patch is for trunk/pym/dbapi/vartree.py (only actual instance of
abssymlink left)
-Doug
[-- Attachment #2: init_deprecate_abssymlink.patch --]
[-- Type: text/x-patch, Size: 630 bytes --]
--- __init__.py.old 2009-03-10 21:07:06.000000000 +0900
+++ __init__.py 2009-03-10 21:20:34.000000000 +0900
@@ -180,12 +180,10 @@ def getcwd():
getcwd()
def abssymlink(symlink):
- "This reads symlinks, resolving the relative symlinks, and returning the absolute."
- mylink=os.readlink(symlink)
- if mylink[0] != '/':
- mydir=os.path.dirname(symlink)
- mylink=mydir+"/"+mylink
- return os.path.normpath(mylink)
+ "Not currently used by Portage (DEPRECATED 03/2009)"
+ writemsg("DEPRECATED: portage.abssymlink: use os.path.realpath instead\n",
+ noiselevel=-1)
+ return os.path.realpath(symlink)
dircache = {}
cacheHit=0
[-- Attachment #3: vartree_sans_abssymlink.patch --]
[-- Type: text/x-patch, Size: 1563 bytes --]
--- vartree.py.old 2009-03-10 21:14:12.000000000 +0900
+++ vartree.py 2009-03-10 21:16:07.000000000 +0900
@@ -3,8 +3,18 @@
# $Id$
__all__ = ["PreservedLibsRegistry", "LinkageMap",
- "vardbapi", "vartree", "dblink"] + \
- ["write_contents", "tar_contents"]
+ "vardbapi", "vartree", "dblink", "write_contents", "tar_contents"]
+
+import os, re, shutil, stat, errno, copy, subprocess
+import logging
+import shlex
+import sys
+from itertools import izip
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
import portage
portage.proxy.lazyimport.lazyimport(globals(),
@@ -32,20 +42,10 @@ from portage.exception import CommandNot
from portage import listdir, dep_expand, digraph, flatten, key_expand, \
doebuild_environment, doebuild, env_update, prepare_build_dirs, \
- abssymlink, movefile, _movefile, bsd_chflags, cpv_getkey
+ movefile, _movefile, bsd_chflags, cpv_getkey
from portage.cache.mappings import slot_dict_class
-import os, re, shutil, stat, errno, copy, subprocess
-import logging
-import shlex
-import sys
-from itertools import izip
-
-try:
- import cPickle as pickle
-except ImportError:
- import pickle
class PreservedLibsRegistry(object):
""" This class handles the tracking of preserved library objects """
@@ -3649,7 +3649,7 @@ class dblink(object):
if stat.S_ISLNK(mymode):
# we are merging a symbolic link
- myabsto = abssymlink(mysrc)
+ myabsto = os.path.realpath(mysrc)
if myabsto.startswith(srcroot):
myabsto = myabsto[len(srcroot):]
myabsto = myabsto.lstrip(sep)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-10 12:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-10 12:38 [gentoo-portage-dev] Deprecate portage.abssymlink Douglas Anderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox