[Python-checkins] distutils2: removed --force-manifest in sdist command
tarek.ziade
python-checkins at python.org
Mon May 17 13:08:43 CEST 2010
tarek.ziade pushed 541f90ef0636 to distutils2:
http://hg.python.org/distutils2/rev/541f90ef0636
changeset: 153:541f90ef0636
tag: tip
user: Tarek Ziade <tarek at ziade.org>
date: Mon May 17 13:08:36 2010 +0200
summary: removed --force-manifest in sdist command
files: src/distutils2/command/sdist.py
diff --git a/src/distutils2/command/sdist.py b/src/distutils2/command/sdist.py
--- a/src/distutils2/command/sdist.py
+++ b/src/distutils2/command/sdist.py
@@ -68,10 +68,7 @@
('no-prune', None,
"don't automatically exclude anything"),
('manifest-only', 'o',
- "just regenerate the manifest and then stop "
- "(implies --force-manifest)"),
- ('force-manifest', 'f',
- "forcibly regenerate the manifest and carry on as usual"),
+ "just regenerate the manifest and then stop "),
('formats=', None,
"formats for source distribution (comma-separated list)"),
('keep-temp', 'k',
@@ -90,8 +87,7 @@
]
boolean_options = ['use-defaults', 'prune',
- 'manifest-only', 'force-manifest',
- 'keep-temp', 'metadata-check']
+ 'manifest-only', 'keep-temp', 'metadata-check']
help_options = [
('help-formats', None,
@@ -116,10 +112,7 @@
# in the manifest
self.use_defaults = 1
self.prune = 1
-
self.manifest_only = 0
- self.force_manifest = 0
-
self.formats = None
self.keep_temp = 0
self.dist_dir = None
@@ -194,63 +187,24 @@
distribution, and put it in 'self.filelist'. This might involve
reading the manifest template (and writing the manifest), or just
reading the manifest, or just using the default file set -- it all
- depends on the user's options and the state of the filesystem.
+ depends on the user's options.
"""
- # If we have a manifest template, see if it's newer than the
- # manifest; if so, we'll regenerate the manifest.
template_exists = os.path.isfile(self.template)
+ if not template_exists:
+ self.warn(("manifest template '%s' does not exist " +
+ "(using default file list)") %
+ self.template)
+
+ self.filelist.findall()
+
+ if self.use_defaults:
+ self.add_defaults()
if template_exists:
- template_newer = newer(self.template, self.manifest)
+ self.read_template()
+ if self.prune:
+ self.prune_file_list()
- # The contents of the manifest file almost certainly depend on the
- # setup script as well as the manifest template -- so if the setup
- # script is newer than the manifest, we'll regenerate the manifest
- # from the template. (Well, not quite: if we already have a
- # manifest, but there's no template -- which will happen if the
- # developer elects to generate a manifest some other way -- then we
- # can't regenerate the manifest, so we don't.)
- setup_newer = newer(self.distribution.script_name,
- self.manifest)
-
- # cases:
- # 1) no manifest, template exists: generate manifest
- # (covered by 2a: no manifest == template newer)
- # 2) manifest & template exist:
- # 2a) template or setup script newer than manifest:
- # regenerate manifest
- # 2b) manifest newer than both:
- # do nothing (unless --force or --manifest-only)
- # 3) manifest exists, no template:
- # do nothing (unless --force or --manifest-only)
- # 4) no manifest, no template: generate w/ warning ("defaults 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)") %
- self.template)
- self.filelist.findall()
-
- if self.use_defaults:
- self.add_defaults()
- if template_exists:
- self.read_template()
- if self.prune:
- self.prune_file_list()
-
- self.filelist.write(self.manifest)
-
- # Don't regenerate the manifest, just read it in.
- else:
- self.filelist.read(self.manifest)
+ self.filelist.write(self.manifest)
def add_defaults(self):
"""Add all the default files to self.filelist:
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list