patches/python-vobject-01-ez_setup.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 985 b32e11eeb840
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
985
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     1
--- ez_setup/__init__.py.orig	2008-03-17 17:17:55.718936000 +0800
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     2
+++ ez_setup/__init__.py	2008-03-17 17:19:48.463046000 +0800
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     3
@@ -80,31 +80,31 @@
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     4
     this routine will print a message to ``sys.stderr`` and raise SystemExit in
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     5
     an attempt to abort the calling script.
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     6
     """
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     7
-    was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     8
-    def do_download():
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
     9
+    try:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    10
+        import setuptools
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    11
+        if setuptools.__version__ == '0.0.1':
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    12
+            print >>sys.stderr, (
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    13
+            "You have an obsolete version of setuptools installed.  Please\n"
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    14
+            "remove it from your system entirely before rerunning this script."
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    15
+            )
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    16
+            sys.exit(2)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    17
+    except ImportError:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    18
         egg = download_setuptools(version, download_base, to_dir, download_delay)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    19
         sys.path.insert(0, egg)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    20
         import setuptools; setuptools.bootstrap_install_from = egg
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    21
+
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    22
+    import pkg_resources
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    23
     try:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    24
-        import pkg_resources
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    25
-    except ImportError:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    26
-        return do_download()       
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    27
-    try:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    28
-        pkg_resources.require("setuptools>="+version); return
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    29
+        pkg_resources.require("setuptools>="+version)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    30
+
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    31
     except pkg_resources.VersionConflict, e:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    32
-        if was_imported:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    33
-            print >>sys.stderr, (
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    34
+        # XXX could we install in a subprocess here?
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    35
+        print >>sys.stderr, (
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    36
             "The required version of setuptools (>=%s) is not available, and\n"
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    37
             "can't be installed while this script is running. Please install\n"
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    38
-            " a more recent version first, using 'easy_install -U setuptools'."
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    39
-            "\n\n(Currently using %r)"
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    40
-            ) % (version, e.args[0])
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    41
-            sys.exit(2)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    42
-        else:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    43
-            del pkg_resources, sys.modules['pkg_resources']    # reload ok
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    44
-            return do_download()
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    45
-    except pkg_resources.DistributionNotFound:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    46
-        return do_download()
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    47
+            " a more recent version first.\n\n(Currently using %r)"
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    48
+        ) % (version, e.args[0])
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    49
+        sys.exit(2)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    50
 
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    51
 def download_setuptools(
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    52
     version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    53
@@ -153,43 +153,9 @@
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    54
             if dst: dst.close()
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    55
     return os.path.realpath(saveto)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    56
 
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    57
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    58
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    59
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    60
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    61
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    62
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    63
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    64
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    65
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    66
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    67
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    68
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    69
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    70
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    71
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    72
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    73
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    74
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    75
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    76
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    77
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    78
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    79
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    80
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    81
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    82
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    83
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    84
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    85
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    86
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    87
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    88
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    89
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    90
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    91
-
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    92
 def main(argv, version=DEFAULT_VERSION):
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    93
     """Install or upgrade setuptools and EasyInstall"""
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    94
+
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    95
     try:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    96
         import setuptools
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    97
     except ImportError:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    98
@@ -204,11 +170,8 @@
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
    99
                 os.unlink(egg)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   100
     else:
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   101
         if setuptools.__version__ == '0.0.1':
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   102
-            print >>sys.stderr, (
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   103
-            "You have an obsolete version of setuptools installed.  Please\n"
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   104
-            "remove it from your system entirely before rerunning this script."
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   105
-            )
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   106
-            sys.exit(2)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   107
+            # tell the user to uninstall obsolete version
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   108
+            use_setuptools(version)
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   109
 
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   110
     req = "setuptools>="+version
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   111
     import pkg_resources
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   112
@@ -229,6 +192,8 @@
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   113
             print "Setuptools version",version,"or greater has been installed."
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   114
             print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   115
 
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   116
+
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   117
+
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   118
 def update_md5(filenames):
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   119
     """Update our built-in md5 registry"""
b32e11eeb840 * SFEpython-vojbect.spec: bump to 0.6.0, add a patch.
jerryyu
parents:
diff changeset
   120