source: trunk/base/src/port1.0/portpatch.tcl @ 218

Last change on this file since 218 was 218, checked in by landonf (Landon Fuller), 18 years ago

New dependencies

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.0 KB
Line 
1# ex:ts=4
2#
3# Insert some license text here at some point soon.
4#
5
6package provide portpatch 1.0
7package require portutil 1.0
8
9register com.apple.patch target build patch_main
10register com.apple.patch provides patch
11register com.apple.patch requires main fetch checksum extract
12register com.apple.patch swdep build depends_build
13
14proc patch_main {args} {
15    global portname patchfiles distpath filedir workdir portpath
16
17    if ![info exists patchfiles] {
18        return 0
19    }
20    foreach patch $patchfiles {
21        if [file exists $portpath/$filedir/$patch] {
22            lappend patchlist $portpath/$filedir/$patch
23        } elseif [file exists $distpath/$patch] {
24            lappend patchlist $distpath/$patch
25        }
26    }
27    if ![info exists patchlist] {
28        return -code error "Patch files missing"
29    }
30    cd $portpath/$workdir
31    foreach patch $patchlist {
32        switch -glob -- [file tail $patch] {
33            *.Z -
34            *.gz {system "gzcat $patch | patch -p0"}
35            *.bz2 {system "bzcat $patch | patch -p0"}
36            default {system "patch -p0 < $patch"}
37        }
38    }
39    return 0
40}
41
Note: See TracBrowser for help on using the repository browser.