Ticket #16765: 0005-Add-a-no-user-cfg-option-to-distutils-to-ignore-a-us.patch

File 0005-Add-a-no-user-cfg-option-to-distutils-to-ignore-a-us.patch, 5.5 KB (added by blb@…, 16 years ago)

0005-Add-a-no-user-cfg-option-to-distutils-to-ignore-a-us.patch

  • Portfile

    diff --git a/Portfile b/Portfile
    index f924b9d..544315a 100644
    a b if {![info exists frameworks_dir]} { 
    3636   set frameworks_dir ${prefix}/Library/Frameworks
    3737}
    3838
    39 patchfiles              patch-setup.py.diff \
     39# patch-Lib-distutils-dist.py.diff comes from
     40# <http://bugs.python.org/issue1180>
     41patchfiles              patch-Makefile.pre.in.diff \
     42                        patch-setup.py.diff \
    4043                        patch-Lib-cgi.py.diff \
     44                        patch-Lib-distutils-dist.py.diff \
    4145                        patch-Mac-IDLE-Makefile.in.diff \
    4246                        patch-Mac-Makefile.in.diff \
    4347                        patch-Mac-PythonLauncher-Makefile.in.diff \
  • new file files/patch-Lib-distutils-dist.py.diff

    diff --git a/files/patch-Lib-distutils-dist.py.diff b/files/patch-Lib-distutils-dist.py.diff
    new file mode 100644
    index 0000000..45276c5
    - +  
     1--- Lib/distutils/dist.py.orig  2008-09-03 05:13:56.000000000 -0600
     2+++ Lib/distutils/dist.py       2008-10-03 18:33:47.000000000 -0600
     3@@ -60,6 +60,7 @@
     4                       ('quiet', 'q', "run quietly (turns verbosity off)"),
     5                       ('dry-run', 'n', "don't actually do anything"),
     6                       ('help', 'h', "show detailed help message"),
     7+                      ('no-user-cfg', None,'ignore pydistutils.cfg in your home directory'),
     8                      ]
     9 
     10     # 'common_usage' is a short (2-3 line) string describing the common
     11@@ -267,6 +268,12 @@
     12                     else:
     13                         sys.stderr.write(msg + "\n")
     14 
     15+        # no-user-cfg is handled before other command line args
     16+        # because other args override the config files, and this
     17+        # one is needed before we can load the config files.
     18+        # If attrs['script_args'] wasn't passed, assume false.
     19+        self.want_user_cfg = '--no-user-cfg' not in (self.script_args or [])
     20+
     21         self.finalize_options()
     22 
     23     # __init__ ()
     24@@ -327,6 +334,9 @@
     25         Distutils __inst__.py file lives), a file in the user's home
     26         directory named .pydistutils.cfg on Unix and pydistutils.cfg
     27         on Windows/Mac, and setup.cfg in the current directory.
     28+
     29+        The file in the user's home directory can be disabled with the
     30+        --no-user-cfg option.
     31         """
     32         files = []
     33         check_environ()
     34@@ -347,7 +357,7 @@
     35 
     36         # And look for the user config file
     37         user_file = os.path.join(os.path.expanduser('~'), user_filename)
     38-        if os.path.isfile(user_file):
     39+        if self.want_user_cfg and os.path.isfile(user_file):
     40             files.append(user_file)
     41 
     42         # All platforms support local setup.cfg
     43@@ -355,6 +365,8 @@
     44         if os.path.isfile(local_file):
     45             files.append(local_file)
     46 
     47+        if DEBUG:
     48+            print "using config files: %s" % ', '.join(files)
     49         return files
     50 
     51     # find_config_files ()
  • files/patch-Makefile.pre.in.diff

    diff --git a/files/patch-Makefile.pre.in.diff b/files/patch-Makefile.pre.in.diff
    index d17e372..60cd697 100644
    a b  
    1 --- Makefile.pre.in.orig        2007-09-29 02:15:52.000000000 +0200
    2 +++ Makefile.pre.in     2007-09-29 02:18:57.000000000 +0200
    3 @@ -373,6 +373,13 @@
    4  libpython$(VERSION).sl: $(LIBRARY_OBJS)
    5         $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
     1--- Makefile.pre.in.orig        2008-06-19 20:47:03.000000000 -0600
     2+++ Makefile.pre.in     2008-07-28 19:57:15.000000000 -0600
     3@@ -394,8 +394,8 @@
     4 # Build the shared modules
     5 sharedmods: $(BUILDPYTHON)
     6        @case $$MAKEFLAGS in \
     7-       *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
     8-       *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
     9+       *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q --no-user-cfg build;; \
     10+       *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py --no-user-cfg build;; \
     11        esac
    612 
    7 +libpython$(VERSION).dylib: $(LIBRARY)
    8 +       /usr/bin/libtool -o $@ -dynamic $(OTHER_LIBTOOL_OPT) \
    9 +               -all_load $(LIBRARY) -single_module \
    10 +               -install_name $(LIBDIR)/$@ \
    11 +               -compatibility_version $(VERSION) \
    12 +               -current_version $(VERSION) -lSystem -lSystemStubs $(LDFLAGS)
    13 +
    14  # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
    15  # minimal framework (not including the Lib directory and such) in the current
    16  # directory.
    17 @@ -675,6 +682,9 @@
    18                         fi \
    19                 fi; \
    20         else    true; \
    21 +       fi; \
    22 +       if test -f libpython$(VERSION).dylib; then \
    23 +               $(INSTALL_SHARED) libpython$(VERSION).dylib $(DESTDIR)$(LIBDIR); \
    24         fi
    25  
    26  # Install the manual page
     13 # Build static library
     14@@ -993,7 +993,7 @@
     15 # Install the dynamically loadable modules
     16 # This goes into $(exec_prefix)
     17 sharedinstall:
     18-       $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
     19+       $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py --no-user-cfg install \
     20                --prefix=$(prefix) \
     21                --install-scripts=$(BINDIR) \
     22                --install-platlib=$(DESTSHARED) \
     23@@ -1073,7 +1073,7 @@
     24 # This installs a few of the useful scripts in Tools/scripts
     25 scriptsinstall:
     26        SRCDIR=$(srcdir) $(RUNSHARED) \
     27-       ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
     28+       ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py --no-user-cfg install \
     29        --prefix=$(prefix) \
     30        --install-scripts=$(BINDIR) \
     31        --root=/$(DESTDIR)