From: Daira Hopwood <daira@jacaranda.org>
Date: Thu, 5 Sep 2013 18:08:38 +0000 (+0100)
Subject: Wed Nov  9 18:36:32 GMT 2011  Brian Warner <warner@lothar.com>
X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/simplejson/cyclelanguage?a=commitdiff_plain;h=4103386495c935ab709ad1cc2f6528616e84b614;p=tahoe-lafs%2Ftahoe-lafs.git

Wed Nov  9 18:36:32 GMT 2011  Brian Warner <warner@lothar.com>
  * setup.py: umask=022 for 'sdist', to avoid depending on environment

  The new tarball-building buildslave had a bogus umask set, causing the 1.9.0
  tarballs to be non-other-user-readable (go-rwx), which is a hassle for
  packaging. (The umask was correct on the old buildslave, but it was moved to
  a new host shortly before the release). This should make sure tarballs are
  correct despite the host's setting.

  Note to others: processes run under twistd get umask=077 unless you arrange
  otherwise.
---

diff --git a/setup.py b/setup.py
index 3d2671b8..75f83ea6 100644
--- a/setup.py
+++ b/setup.py
@@ -431,7 +431,11 @@ class MySdist(sdist.sdist):
                 return fullname + "-SUMO"
             self.distribution.get_fullname = get_fullname
 
-        return sdist.sdist.make_distribution(self)
+        try:
+            old_mask = os.umask(int("022", 8))
+            return sdist.sdist.make_distribution(self)
+        finally:
+            os.umask(old_mask)
 
 
 setup_args = {}