18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
-
+
-
+
|
set entity_fieldnames([list package arch]) "Platform"
set entity_fieldnames([list entity]) "What"
# Index all packages
proc teapot_index {srcdir} {
array set pkginfo [list]
foreach pkgdir [glob -directory $srcdir -type d */*/*] {
foreach pkgdir [glob -nocomplain -directory $srcdir -type d */*/*] {
unset -nocomplain currpkginfo
set currpkginfo(pkgdir) $pkgdir
set teapot [file join $pkgdir teapot.txt]
set multifile 1
if {![file exists $teapot]} {
set files [glob -directory $pkgdir *]
set files [glob -nocomplain -directory $pkgdir *]
if {[llength $files] == 1} {
set teapot [lindex $files 0]
set multifile 0
} else {
continue
}
}
|
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
-
+
|
file delete -- $extfile
exec zip -r $extfile . -x build.log
} err]} {
puts "Error while zipping: $err"
}
} else {
set origfile [lindex [glob -directory $pkgdir *] 0]
set origfile [lindex [glob -nocomplain -directory $pkgdir *] 0]
file copy -force -- $origfile $extfile
}
file delete -- $regfile
file link -hard $regfile $extfile
file attributes $regfile -permissions -x
|