aboutsummaryrefslogtreecommitdiff
path: root/ipsbuild.py
blob: 3b649a72709f03945ba3017780fa618160637f7e (plain) (blame)
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
#!/usr/bin/env python
# This file is part of ipsutils.

# ipsutils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ipsutils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ipsutils.  If not, see <http://www.gnu.org/licenses/>.
import ipsutils
import argparse
import os


# Initialize argument parser
parser = argparse.ArgumentParser(description='Build Solaris 11 packages from .ips spec files')
parser.add_argument('--version', nargs='?', metavar='-V', help='Show version information')
parser.add_argument('--verbose', nargs='?', metavar='-v', help='Increased verbosity')
parser.add_argument('spec', nargs='+', help='An ipsutils spec file')
args = parser.parse_args()

# Record current path, because we change directories from within the class
# This way all spec files will be read
cwd = os.path.abspath(os.curdir)
if args.spec:
    for spec in args.spec:
        build = ipsutils.build.Build(spec)
        build.show_summary()
        build.controller.do_tasks()
        os.chdir(cwd)