[haiku-bugs] Re: [Haiku] #5454: [patch] added rule UntarArchive

  • From: "mmadia" <trac@xxxxxxxxxxxx>
  • Date: Wed, 24 Feb 2010 16:01:28 -0000

#5454: [patch] added rule UntarArchive
--------------------------+-------------------------------------------------
 Reporter:  mmadia        |       Owner:  bonefish      
     Type:  enhancement   |      Status:  new           
 Priority:  normal        |   Milestone:  R1            
Component:  Build System  |     Version:  R1/Development
 Keywords:                |   Blockedby:                
 Platform:  All           |    Blocking:  5457          
--------------------------+-------------------------------------------------

Comment(by mmadia):

 How could I sniff the archive file extension?

 Do you mean something along these lines?

 {{{
 rule UnArchive directory : entries : archiveFile : archiveType : grist
 {
         # UnArchive <directory> : <entries> : <archiveFile> :
 <archiveType> : [ : <grist> ]
 ....
         # one-time initialization for the main target (the directory)
         if ! [ on $(directory) return $(INITIALIZED) ] {
                 # make sure the parent dir exists
                 local parentDir = $(directory:PG=dir) ;
                 Depends $(directory) : $(parentDir) ;
                 MkDir $(parentDir) ;

                 NoUpdate $(directory) ;
                 Depends $(directory) : $(archiveFile) ;
                 if [ $(archiveType) == zip ] {
                         UnzipArchive1 $(directory) : $(archiveFile) ;
                 } else if [ $(archiveType) == tgz ] {
                         UntarArchive1 $(directory) : $(archiveFile) ;
                 } else {
                         Exit "Missing paramters in UnArchive. Need to
 specify archive type." ;
                 }
                 INITIALIZED on $(directory) = 1 ;
         }
 ...

 }}}

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5454#comment:4>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: