[26464] users/pipping/merge.rb

source_changes at macosforge.org source_changes at macosforge.org
Sun Jun 24 12:47:32 PDT 2007


Revision: 26464
          http://trac.macosforge.org/projects/macports/changeset/26464
Author:   pipping at macports.org
Date:     2007-06-24 12:47:32 -0700 (Sun, 24 Jun 2007)

Log Message:
-----------
enable option --output

Modified Paths:
--------------
    users/pipping/merge.rb

Modified: users/pipping/merge.rb
===================================================================
--- users/pipping/merge.rb	2007-06-24 19:45:27 UTC (rev 26463)
+++ users/pipping/merge.rb	2007-06-24 19:47:32 UTC (rev 26464)
@@ -44,6 +44,7 @@
     self[:verbose] = false
 
     self[:exclude] = Set.new << '.svn' << 'CVS'
+    self[:output]  = File.join(Dir.pwd,'out')
     self[:root]    = Dir.pwd
 
     opts = OptionParser.new do |opts|
@@ -53,9 +54,9 @@
         self[:root] = root || Dir.pwd
       end
 
-#     opts.on('-o', '--output DIRECTORY', 'specify output directory') do |out|
-#       self[:output] = File.expand_path(out) || File.join(self[:root], 'out')
-#     end
+      opts.on('-o', '--output DIRECTORY', 'specify output directory') do |out|
+        self[:output] = File.expand_path(out)
+      end
 
       opts.on('-e', '--exclude NAMES', 'specify names of files/directories to exclude') do |exclude|
         self[:exclude] = Set.new
@@ -105,7 +106,7 @@
       args[:root], arch, filepath
     ))
   }
-  lipotarget=File.join(args[:root], 'out', filepath)
+  lipotarget=File.join(args[:output], filepath)
   lipocmd = sprintf(
     'lipo %s -create -o %s',
     lipoargs.join(' '),
@@ -135,7 +136,7 @@
           Find.prune if File.basename(path) == exclude_me
         }
         unless processed.include? path
-          my_dir=File.dirname(File.join(arguments[:root], 'out', path))
+          my_dir=File.dirname(File.join(arguments[:output], path))
           # TODO: what if ppc/foo is a dir and i386/foo is a file (symlink)? (1)
           unless File.exist? my_dir
             FileUtils.mkdir_p(
@@ -157,7 +158,7 @@
                   File.join(arguments[:root], ARGS[0], path)
                 )
               }
-                copytarget=File.join(arguments[:root],'out',path)
+                copytarget=File.join(arguments[:output],path)
                 if !File.exist?(copytarget) or arguments[:force]
                   FileUtils.cp(
                     File.join(arguments[:root],ARGS[0],path),

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070624/6bfc94a9/attachment.html


More information about the macports-changes mailing list