-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjurt-build
More file actions
executable file
·45 lines (36 loc) · 1.57 KB
/
Copy pathjurt-build
File metadata and controls
executable file
·45 lines (36 loc) · 1.57 KB
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
#!/usr/bin/python
import sys
from jurtlib.command import JurtCommand, CliError
DESCR = """Builds a set of packages
To list the targets, use jurt-list-targets.
To see the configuration used by jurt, use jurt-showrc.
Also, jurt-root-command should be able to use sudo for running commands as
root. Run jurt-test-sudo for checking whether it is properly configured.
"""
class Build(JurtCommand):
usage = "%prog -t TARGET file.src.rpm..."
descr = DESCR
def init_parser(self, parser):
JurtCommand.init_parser(self, parser)
parser.add_option("-t", "--target", type="string",
help="Target packages are built for")
parser.add_option("-b", "--stop", default=None, metavar="STAGE",
help="Stop at build stage STAGE and drops into a shell")
parser.add_option("-l", "--showlog",
action="store_true", default=False,
help="Show the (also logged) output of build process")
parser.add_option("-d", "--duration", default=None, type="int",
metavar="SECS",
help=("Limit in seconds of build time (when exceeded the "
"build task is killed with SIGTERM)"))
def run(self):
if not self.args:
raise CliError, "no source packages provided (--help?)"
if self.opts.showlog:
outputfile = sys.stdout
else:
outputfile = None
self.jurt.build(self.args, self.opts.target,
timeout=self.opts.duration, stage=self.opts.stop,
outputfile=outputfile)
Build().main()