[23795] users/jberry/mpwa/app/models/port_pkg.rb

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 9 19:52:18 PDT 2007


Revision: 23795
          http://trac.macosforge.org/projects/macports/changeset/23795
Author:   jberry at macports.org
Date:     2007-04-09 19:52:18 -0700 (Mon, 09 Apr 2007)

Log Message:
-----------
Save expanded pkg files into the database for easy access later.

In addition to the file data, we store:
 * length
 * sha256
 * mime-type (which we always set to text/plain right now)

This should make it easier to later test if files are different between packages, and to gen up diffs for them at runtime.

Modified Paths:
--------------
    users/jberry/mpwa/app/models/port_pkg.rb

Modified: users/jberry/mpwa/app/models/port_pkg.rb
===================================================================
--- users/jberry/mpwa/app/models/port_pkg.rb	2007-04-10 02:51:55 UTC (rev 23794)
+++ users/jberry/mpwa/app/models/port_pkg.rb	2007-04-10 02:52:18 UTC (rev 23795)
@@ -80,9 +80,16 @@
         portPkgFile = PortPkgFile.from_file(file, 'portpkg.xar')        
         port_pkg.files << portPkgFile
         
-        # Save files for from the expanded package
+        # Save files from the expanded package
+        expandedPkgPath.find do |p|
+            if p.file?
+                File.open(p, "r") do |f|
+                    relPath = p.relative_path_from(tempDirPath).to_s
+                    port_pkg.files << PortPkgFile.from_file(f, relPath)
+                end
+            end
+        end
         
-        
         # Save the pkg (maybe we shouldn't?)
         port_pkg.save
         

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070409/35665de7/attachment.html


More information about the macports-changes mailing list