#
# cgi_runner.rb -- CGI launcher.
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU YUUZOU
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
#
# $IPR: cgi_runner.rb,v 1.9 2002/09/25 11:33:15 gotoyuzo Exp $
def sysread(io, size)
buf = ""
while size > 0
tmp = io.sysread(size)
buf << tmp
size -= tmp.size
end
return buf
end
STDIN.binmode
buf = ""
len = sysread(STDIN, 8).to_i
out = sysread(STDIN, len)
STDOUT.reopen(open(out, "w"))
len = sysread(STDIN, 8).to_i
err = sysread(STDIN, len)
STDERR.reopen(open(err, "w"))
len = sysread(STDIN, 8).to_i
dump = sysread(STDIN, len)
hash = Marshal.restore(dump)
ENV.keys.each{|name| ENV.delete(name) }
hash.each{|k, v| ENV[k] = v if v }
dir = File::dirname(ENV["SCRIPT_FILENAME"])
Dir::chdir dir
if interpreter = ARGV[0]
exec(interpreter, ENV["SCRIPT_FILENAME"])
# NOTREACHED
end
exec ENV["SCRIPT_FILENAME"]
aconda.git/'>anaconda.git
blob: 2738bf841909f2507e706d8aa6830a774df4118d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# Install method for disk image installs (CD & NFS)
from comps import ComponentSet, HeaderList
import os
import isys
import rpm
import todo
FILENAME = 1000000
class InstallMethod:
def readComps(self, hdlist):
isys.makeDevInode(self.device, '/tmp/' + self.device)
isys.mount('/tmp/' + self.device, "/tmp/hdimage",
fstype = self.fstype);
cs = ComponentSet("/tmp/hdimage/" + self.path +
'/RedHat/base/comps', hdlist)
isys.umount("/tmp/hdimage")
return cs
def getFilename(self, h):
return self.tree + "/RedHat/RPMS/" + self.fnames[h]
def readHeaders(self):
|