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

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

Merge in "bigmove" reorg branch. System now requires bsdmake && bsdmake install
and installs itself and its TCL libraries in /usr/local/share , /System/Library/Tcl/8.3, and /usr/local/bin

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 989 bytes
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
12
13proc patch_main {args} {
14    global portname patchfiles distpath filedir workdir portpath
15
16    if ![info exists patchfiles] {
17        return 0
18    }
19    foreach patch $patchfiles {
20        if [file exists $portpath/$filedir/$patch] {
21            lappend patchlist $portpath/$filedir/$patch
22        } elseif [file exists $distpath/$patch] {
23            lappend patchlist $distpath/$patch
24        }
25    }
26    if ![info exists patchlist] {
27        return -code error "Patch files missing"
28    }
29    cd $portpath/$workdir
30    foreach patch $patchlist {
31        switch -glob -- [file tail $patch] {
32            *.Z -
33            *.gz {system "gzcat $patch | patch -p0"}
34            *.bz2 {system "bzcat $patch | patch -p0"}
35            default {system "patch -p0 < $patch"}
36        }
37    }
38    return 0
39}
40
Note: See TracBrowser for help on using the repository browser.