[123705] branches/gsoc14-pip2port/pypi2port

gaurav at macports.org gaurav at macports.org
Wed Aug 13 02:37:54 PDT 2014


Revision: 123705
          https://trac.macports.org/changeset/123705
Author:   gaurav at macports.org
Date:     2014-08-13 02:37:54 -0700 (Wed, 13 Aug 2014)
Log Message:
-----------
Updated executable

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

Modified: branches/gsoc14-pip2port/pypi2port
===================================================================
--- branches/gsoc14-pip2port/pypi2port	2014-08-13 09:37:22 UTC (rev 123704)
+++ branches/gsoc14-pip2port/pypi2port	2014-08-13 09:37:54 UTC (rev 123705)
@@ -176,8 +176,12 @@
 
 
 def create_diff(old_file, new_file, diff_file):
-    a = open(old_file).readlines()
-    b = open(new_file).readlines()
+    with open(old_file) as f:
+        a = f.readlines()
+#    a = open(old_file).readlines()
+    with open(new_file) as f:
+        b = f.readlines()
+#    b = open(new_file).readlines()
     diff_string = difflib.unified_diff(a, b, "Portfile.orig", "Portfile")
     with open(diff_file, 'w') as d:
         try:
@@ -548,6 +552,12 @@
     home_dir = os.path.join(port_dir, 'py-'+pkg_name)
     if not os.path.exists(root_dir):
         os.makedirs(root_dir)
+        try:
+            command = 'portindex dports/'
+            command = command.split()
+            subprocess.call(command,stderr=subprocess.STDOUT)
+        except:
+            pass
     if not os.path.exists(port_dir):
         os.makedirs(port_dir)
     if not os.path.exists(home_dir):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140813/2f299bbf/attachment.html>


More information about the macports-changes mailing list