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

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


Revision: 123704
          https://trac.macports.org/changeset/123704
Author:   gaurav at macports.org
Date:     2014-08-13 02:37:22 -0700 (Wed, 13 Aug 2014)
Log Message:
-----------
portindex on dports after creating directory

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

Modified: branches/gsoc14-pip2port/pypi2port.py
===================================================================
--- branches/gsoc14-pip2port/pypi2port.py	2014-08-13 08:55:00 UTC (rev 123703)
+++ branches/gsoc14-pip2port/pypi2port.py	2014-08-13 09:37:22 UTC (rev 123704)
@@ -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/a99842f8/attachment-0001.html>


More information about the macports-changes mailing list