Commit 79ead425 authored by Greg Ward's avatar Greg Ward

Bullet-proofing of 'make_release_tree()':

  - 'mkpath()' the distribution dir in case of empty manifest
  - warn if empty manifest
  - detect, warn about, and skip non-regular files in manifest
parent 1611d401
...@@ -405,9 +405,11 @@ class sdist (Command): ...@@ -405,9 +405,11 @@ class sdist (Command):
to be distributed. to be distributed.
""" """
# Create all the directories under 'base_dir' necessary to # Create all the directories under 'base_dir' necessary to
# put 'files' there. # put 'files' there; the 'mkpath()' is just so we don't die
dir_util.create_tree (base_dir, files, # if the manifest happens to be empty.
verbose=self.verbose, dry_run=self.dry_run) self.mkpath(base_dir)
dir_util.create_tree(base_dir, files,
verbose=self.verbose, dry_run=self.dry_run)
# And walk over the list of files, either making a hard link (if # And walk over the list of files, either making a hard link (if
# os.link exists) to each one that doesn't already exist in its # os.link exists) to each one that doesn't already exist in its
...@@ -423,10 +425,16 @@ class sdist (Command): ...@@ -423,10 +425,16 @@ class sdist (Command):
link = None link = None
msg = "copying files to %s..." % base_dir msg = "copying files to %s..." % base_dir
self.announce (msg) if not files:
self.warn("no files to distribute -- empty manifest?")
else:
self.announce (msg)
for file in files: for file in files:
dest = os.path.join (base_dir, file) if not os.path.isfile(file):
self.copy_file (file, dest, link=link) self.warn("'%s' not a regular file -- skipping" % file)
else:
dest = os.path.join (base_dir, file)
self.copy_file (file, dest, link=link)
# make_release_tree () # make_release_tree ()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment