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

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

dependency system revamp

  • 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 patch_main
10register com.apple.patch provides patch
11register com.apple.patch requires main fetch checksum extract depends_build depends_lib
12
13set UI_PREFIX "---> "
14
15proc patch_main {args} {
16    global portname patchfiles distpath filedir workdir portpath UI_PREFIX
17
18    if ![info exists patchfiles] {
19        return 0
20    }
21    foreach patch $patchfiles {
22        if [file exists $portpath/$filedir/$patch] {
23            lappend patchlist $portpath/$filedir/$patch
24        } elseif [file exists $distpath/$patch] {
25            lappend patchlist $distpath/$patch
26        }
27    }
28    if ![info exists patchlist] {
29        return -code error "Patch files missing"
30    }
31    cd $portpath/$workdir
32    foreach patch $patchlist {
33        ui_info "$UI_PREFIX Applying $patch"
34        switch -glob -- [file tail $patch] {
35            *.Z -
36            *.gz {system "gzcat $patch | patch -p0"}
37            *.bz2 {system "bzcat $patch | patch -p0"}
38            default {system "patch -p0 < $patch"}
39        }
40    }
41    return 0
42}
43
Note: See TracBrowser for help on using the repository browser.