diff options
author | PJ Eby <distutils-sig@python.org> | 2006-03-29 19:23:55 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2006-03-29 19:23:55 +0000 |
commit | 4da195dc370305433ac4f448c647af8d9fa3691d (patch) | |
tree | 9c9c9f115cb1fc758018537f19289d3ee7f5b412 /setuptools/command/egg_info.py | |
parent | a8ab614c9791958ee84829221fab38c81a01f816 (diff) | |
download | external_python_setuptools-4da195dc370305433ac4f448c647af8d9fa3691d.tar.gz external_python_setuptools-4da195dc370305433ac4f448c647af8d9fa3691d.tar.bz2 external_python_setuptools-4da195dc370305433ac4f448c647af8d9fa3691d.zip |
Implement dependency_links feature, courtesy of Tres Seaver's rough
draft of a patch.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043423
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-x | setuptools/command/egg_info.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 15d8ae19..d9fcd3f0 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -80,19 +80,19 @@ class egg_info(Command): - def write_or_delete_file(self, what, filename, data): + def write_or_delete_file(self, what, filename, data, force=False): """Write `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the - orphaned file. + orphaned file (if `force` is false), or deleted (if `force` is true). """ if data: self.write_file(what, filename, data) elif os.path.exists(filename): - if data is None: + if data is None and not force: log.warn( "%s not set in setup(), but %s exists", what, filename ) @@ -326,12 +326,15 @@ def write_toplevel_names(cmd, basename, filename): -def write_arg(cmd, basename, filename): +def overwrite_arg(cmd, basename, filename): + write_arg(cmd, basename, filename, True) + +def write_arg(cmd, basename, filename, force=False): argname = os.path.splitext(basename)[0] value = getattr(cmd.distribution, argname, None) if value is not None: value = '\n'.join(value)+'\n' - cmd.write_or_delete_file(argname, filename, value) + cmd.write_or_delete_file(argname, filename, value, force) def write_entries(cmd, basename, filename): ep = cmd.distribution.entry_points @@ -347,7 +350,7 @@ def write_entries(cmd, basename, filename): data.append('[%s]\n%s\n\n' % (section,contents)) data = ''.join(data) - cmd.write_or_delete_file('entry points', filename, data) + cmd.write_or_delete_file('entry points', filename, data, True) def get_pkg_info_revision(): # See if we can get a -r### off of PKG-INFO, in case this is an sdist of @@ -364,6 +367,3 @@ def get_pkg_info_revision(): - - - |