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

Last change on this file since 221 was 221, checked in by jkh, 18 years ago

Add more appropriate types and grades of verbosity.

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