[122512] branches/gsoc14-pip2port/pypi2port.py

gaurav at macports.org gaurav at macports.org
Wed Jul 23 06:52:37 PDT 2014


Revision: 122512
          https://trac.macports.org/changeset/122512
Author:   gaurav at macports.org
Date:     2014-07-23 06:52:37 -0700 (Wed, 23 Jul 2014)
Log Message:
-----------
Changed name to py-name

Modified Paths:
--------------
    branches/gsoc14-pip2port/pypi2port.py

Modified: branches/gsoc14-pip2port/pypi2port.py
===================================================================
--- branches/gsoc14-pip2port/pypi2port.py	2014-07-23 13:31:03 UTC (rev 122511)
+++ branches/gsoc14-pip2port/pypi2port.py	2014-07-23 13:52:37 UTC (rev 122512)
@@ -63,7 +63,7 @@
     checksum_md5 = dict['md5_digest']
     parent_dir = './sources'
     home_dir = parent_dir + '/' + 'python'
-    src_dir = home_dir + '/' + pkg_name
+    src_dir = home_dir + '/py-' + pkg_name
     if not os.path.exists(parent_dir):
         os.makedirs(parent_dir)
     if not os.path.exists(home_dir):
@@ -141,21 +141,21 @@
         if not value['filename'].split('.')[-1] == 'gz':
             fetch(pkg_name, value)
     try:
-        with open('./sources/python/' + pkg_name + '/EGG-INFO/requires.txt') as f:
+        with open('./sources/python/py-' + pkg_name + '/EGG-INFO/requires.txt') as f:
             list = f.readlines()
             list = [x.strip('\n') for x in list]
         f.close()
         try:
             if flag:
-                shutil.rmtree('./sources/python/' + pkg_name + '/EGG-INFO',
+                shutil.rmtree('./sources/python/py-' + pkg_name + '/EGG-INFO',
                               ignore_errors=True)
-                items = os.listdir('./sources/python/' + pkg_name)
+                items = os.listdir('./sources/python/py-' + pkg_name)
                 for item in items[:]:
                     if not item.split('.')[-1] == 'gz':
-                        os.remove('./sources/python/' + pkg_name + '/' + item)
+                        os.remove('./sources/python/py-' + pkg_name + '/' + item)
                         items.remove(item)
                 if not items:
-                    os.rmdir('./sources/python/' + pkg_name)
+                    os.rmdir('./sources/python/py-' + pkg_name)
             print ""
         except:
             print ""
@@ -163,15 +163,15 @@
     except:
         try:
             if flag:
-                shutil.rmtree('./sources/python/'+pkg_name+'/EGG-INFO',
+                shutil.rmtree('./sources/python/py-'+pkg_name+'/EGG-INFO',
                               ignore_errors=True)
-                items = os.listdir('./sources/python/'+pkg_name)
+                items = os.listdir('./sources/python/py-'+pkg_name)
                 for item in items[:]:
                     if not item.split('.')[-1] == 'gz':
-                        os.remove('./sources/python/'+pkg_name+'/'+item)
+                        os.remove('./sources/python/py-'+pkg_name+'/'+item)
                         items.remove(item)
                 if not items:
-                    os.rmdir('./sources/python/'+pkg_name)
+                    os.rmdir('./sources/python/py-'+pkg_name)
             print ""
         except:
             print ""
@@ -240,7 +240,7 @@
         file.write('PortSystem          1.0\n')
         file.write('PortGroup           python 1.0\n\n')
 
-        file.write('name                {0}\n'.format(dict['name']))
+        file.write('name                py-{0}\n'.format(dict['name']))
         file.write('version             {0}\n'.format(dict['version']))
 
         file.write('platforms           darwin\n')
@@ -374,7 +374,7 @@
     print "\n"
     root_dir = os.path.abspath("./dports")
     port_dir = os.path.join(root_dir, 'python')
-    home_dir = os.path.join(port_dir, pkg_name)
+    home_dir = os.path.join(port_dir, 'py-'+pkg_name)
     if not os.path.exists(root_dir):
         os.makedirs(root_dir)
     if not os.path.exists(port_dir):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140723/d2c9ddc0/attachment-0001.html>


More information about the macports-changes mailing list