Ticket #29707: extract.patch

File extract.patch, 3.2 KB (added by mtalexander (Mike Alexander), 13 years ago)

Patch to set all the extract.? variables whenever use_? is specified in a port file

  • base/src/port1.0/portfetch.tcl

     
    120120default global_mirror_site "macports_distfiles"
    121121default mirror_sites.listfile {"mirror_sites.tcl"}
    122122default mirror_sites.listpath {"port1.0/fetch"}
     123default extract.cmd {[findBinary gzip ${portutil::autoconf::gzip_path}]}
     124default extract.pre_args -dc
     125default extract.post_args {"| ${portutil::autoconf::tar_command} -xf -"}
    123126
    124127# Deprecation
    125128option_deprecate svn.tag svn.revision
     
    135138option_proc fetch.type portfetch::set_fetch_type
    136139
    137140proc portfetch::set_extract_type {option action args} {
    138     global extract.suffix
     141    global extract.suffix extract.cmd extract.pre_args extract.post_args
    139142    if {[string equal ${action} "set"] && [tbool args]} {
    140143        switch $option {
    141144            use_bzip2 {
    142145                set extract.suffix .tar.bz2
     146                set extract.cmd [findBinary bzip2 ${portutil::autoconf::bzip2_path}]
    143147            }
    144148            use_lzma {
    145149                set extract.suffix .tar.lzma
     150                set extract.cmd [binaryInPath "lzma"]
    146151                depends_extract-append bin:lzma:xz
    147152            }
    148153            use_xz {
    149154                set extract.suffix .tar.xz
     155                set extract.cmd [binaryInPath "xz"]
    150156                depends_extract-append bin:xz:xz
    151157            }
    152158            use_zip {
    153159                set extract.suffix .zip
     160                set extract.cmd [findBinary unzip ${portutil::autoconf::unzip_path}]
     161                set extract.pre_args -q
     162                set extract.post_args "-d ${extract.dir}"
    154163                depends_extract-append bin:unzip:unzip
    155164            }
    156165            use_7z {
    157166                set extract.suffix .7z
     167                set extract.cmd [binaryInPath "7za"]
     168                set extract.pre_args x
     169                set extract.post_args ""
    158170                depends_extract-append bin:7za:p7zip
    159171            }
    160172            use_dmg {
    161173                set extract.suffix .dmg
     174                global distname
     175                set dmg_mount [mkdtemp "/tmp/mports.XXXXXXXX"]
     176                set extract.cmd [findBinary hdiutil ${portutil::autoconf::hdiutil_path}]
     177                set extract.pre_args attach
     178                set extract.post_args "-private -readonly -nobrowse -mountpoint \\\"${dmg_mount}\\\" && [findBinary cp ${portutil::autoconf::cp_path}] -Rp \\\"${dmg_mount}\\\" \\\"${extract.dir}/${distname}\\\" && ${extract.cmd} detach \\\"${dmg_mount}\\\" && [findBinary rmdir ${portutil::autoconf::rmdir_path}] \\\"${dmg_mount}\\\""
    162179            }
    163180        }
    164181    }
  • base/src/port1.0/portextract.tcl

     
    5353default extract.only {[portextract::disttagclean $distfiles]}
    5454
    5555default extract.dir {${workpath}}
    56 default extract.cmd {[findBinary gzip ${portutil::autoconf::gzip_path}]}
    57 default extract.pre_args -dc
    58 default extract.post_args {"| ${portutil::autoconf::tar_command} -xf -"}
    5956default extract.mkdir no
    6057
    6158set_ui_prefix