[24686] users/jberry/mpwa/app/controllers/port_pkg_controller.rb

source_changes at macosforge.org source_changes at macosforge.org
Sun Apr 29 21:22:42 PDT 2007


Revision: 24686
          http://trac.macosforge.org/projects/macports/changeset/24686
Author:   jberry at macports.org
Date:     2007-04-29 21:22:42 -0700 (Sun, 29 Apr 2007)

Log Message:
-----------
mpwa: return not just the download url for a submitted port_pkg, but the human_readable url as well.

Modified Paths:
--------------
    users/jberry/mpwa/app/controllers/port_pkg_controller.rb

Modified: users/jberry/mpwa/app/controllers/port_pkg_controller.rb
===================================================================
--- users/jberry/mpwa/app/controllers/port_pkg_controller.rb	2007-04-30 04:06:10 UTC (rev 24685)
+++ users/jberry/mpwa/app/controllers/port_pkg_controller.rb	2007-04-30 04:22:42 UTC (rev 24686)
@@ -61,10 +61,15 @@
         # Create a package from the file
         @port_pkg = PortPkg.create_from_file(portpkg)
         
-        url = portpkg_url(:id => @port_pkg)
-        render :text => "STATUS: 0\nMESSAGE: PortPkg submitted successfully\nURL: #{url}"
+        download_url = portpkg_url(:id => @port_pkg)
+        human_url = url_for(:controller => "port_pkg", :action => "show", :id => @port_pkg)
+        render :text => "STATUS: 0\n" +
+            "MESSAGE: PortPkg submitted successfully\n" +
+            "DOWNLOAD_URL: #{download_url}\n" +
+            "HUMAN_URL: #{human_url}\n"
     rescue PortPkgException => ex
-        render :text => "STATUS: 1\nMESSAGE: Error during submit: #{ex}", :status => 400
+        render :text => "STATUS: 1\n" +
+            "MESSAGE: Error during submit: #{ex}\n", :status => 400
     end
   end
   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070429/209fdd66/attachment.html


More information about the macports-changes mailing list