From: Greg Ward Date: Sat, 27 May 2000 03:03:23 +0000 (+0000) Subject: Patch from Andrew Kuchling: prune out the build and source distribution X-Git-Tag: v2.0b1~1650 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5b267ccb63d2f0a0f622693f425d5c9186e2424;p=python Patch from Andrew Kuchling: prune out the build and source distribution directories after all is said and done, so we don't accidentally include those files in the source distribution. (This is the quick and easy way to fix this; Andrew says: "Changing findall() looked like it was going to be messy, so I tried this instead. The only problem is that redundant directory traversals are being done, walking through build/ only to throw out all the files found at the end."). --- diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index 56bc4c9556..0a57ba364f 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -440,6 +440,13 @@ class sdist (Command): # while loop over lines of template file + # Prune away the build and source distribution directories + build = self.find_peer ('build') + exclude_pattern (self.files, None, prefix=build.build_base) + + base_dir = self.distribution.get_fullname() + exclude_pattern (self.files, None, prefix=base_dir) + # read_template ()