mirror of https://github.com/pypa/pip
vendoring: move /etc appdir patch to pip wrapper
This commit is contained in:
parent
35181cdf01
commit
db377cec28
|
@ -33,9 +33,12 @@ def user_data_dir(appname, roaming=False):
|
|||
return _appdirs.user_data_dir(appname, appauthor=False, roaming=roaming)
|
||||
|
||||
|
||||
# for the discussion regarding site_config_dir locations
|
||||
# see <https://github.com/pypa/pip/issues/1733>
|
||||
def site_config_dirs(appname):
|
||||
# type: (str) -> List[str]
|
||||
dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True)
|
||||
if _appdirs.system not in ["win32", "darwin"]:
|
||||
return dirval.split(os.pathsep)
|
||||
# always look in /etc directly as well
|
||||
return dirval.split(os.pathsep) + ['/etc']
|
||||
return [dirval]
|
||||
|
|
|
@ -257,8 +257,6 @@ def site_config_dir(appname=None, appauthor=None, version=None, multipath=False)
|
|||
if version:
|
||||
appname = os.path.join(appname, version)
|
||||
pathlist = [os.path.join(x, appname) for x in pathlist]
|
||||
# always look in /etc directly as well
|
||||
pathlist.append('/etc')
|
||||
|
||||
if multipath:
|
||||
path = os.pathsep.join(pathlist)
|
||||
|
|
|
@ -51,7 +51,7 @@ index ae67001a..3a52b758 100644
|
|||
def site_config_dir(appname=None, appauthor=None, version=None, multipath=False):
|
||||
r"""Return full path to the user-shared data dir for this application.
|
||||
|
||||
@@ -238,14 +248,17 @@ def site_config_dir(appname=None, appauthor=None, version=None, multipath=False)
|
||||
@@ -238,14 +248,15 @@ def site_config_dir(appname=None, appauthor=None, version=None, multipath=False)
|
||||
if appname and version:
|
||||
path = os.path.join(path, version)
|
||||
else:
|
||||
|
@ -68,8 +68,6 @@ index ae67001a..3a52b758 100644
|
|||
appname = os.path.join(appname, version)
|
||||
- pathlist = [os.sep.join([x, appname]) for x in pathlist]
|
||||
+ pathlist = [os.path.join(x, appname) for x in pathlist]
|
||||
+ # always look in /etc directly as well
|
||||
+ pathlist.append('/etc')
|
||||
|
||||
if multipath:
|
||||
path = os.pathsep.join(pathlist)
|
||||
|
|
Loading…
Reference in New Issue