diff options
author | Greg Ward <gward@python.net> | 2000-09-06 02:08:24 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-09-06 02:08:24 (GMT) |
commit | d3b76a8fbfc2af2d01ce48c323c9f76c0947af49 (patch) | |
tree | dcd7bdb397d63506bcbcb313f5b3ca285d6d7a6d /Lib/distutils | |
parent | 6a2035d76ba9572ccd2ed61d59df46e2bdcb74ed (diff) | |
download | cpython-d3b76a8fbfc2af2d01ce48c323c9f76c0947af49.zip cpython-d3b76a8fbfc2af2d01ce48c323c9f76c0947af49.tar.gz cpython-d3b76a8fbfc2af2d01ce48c323c9f76c0947af49.tar.bz2 |
Reorganized logic in 'get_file_list()' so it's easier to read, and fixed a
bug to boot: now works even if both MANIFEST and MANIFEST.in don't exist.
Don't hardcode setup.py, use 'self.distribution.script_name'.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/sdist.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index 06c8f1c..1bf297f 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -219,10 +219,14 @@ class sdist (Command): # do nothing (unless --force or --manifest-only) # 4) no manifest, no template: generate w/ warning ("defaults only") - # Regenerate the manifest if necessary (or if explicitly told to) - if ((template_exists and (template_newer or setup_newer)) or - self.force_manifest or self.manifest_only): + manifest_outofdate = (template_exists and + (template_newer or setup_newer)) + force_regen = self.force_manifest or self.manifest_only + manifest_exists = os.path.isfile(self.manifest) + neither_exists = (not template_exists and not manifest_exists) + # Regenerate the manifest if necessary (or if explicitly told to) + if manifest_outofdate or neither_exists or force_regen: if not template_exists: self.warn(("manifest template '%s' does not exist " + "(using default file list)") % @@ -273,10 +277,7 @@ class sdist (Command): else is optional. """ - # XXX name of setup script and config file should be taken - # programmatically from the Distribution object (except - # it doesn't have that capability... yet!) - standards = [('README', 'README.txt'), 'setup.py'] + standards = [('README', 'README.txt'), self.distribution.script_name] for fn in standards: if type (fn) is TupleType: alts = fn |