-
Notifications
You must be signed in to change notification settings - Fork 3
/
buildrepo
executable file
·53 lines (35 loc) · 1.19 KB
/
buildrepo
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
#!/usr/bin/python
# Copyright (C) 2011 Javier Palacios
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2
# as published by the Free Software Foundation.
#
# This program 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.
__version__ = "1.0"
__usage__ = """%prog reponame [reponame ...]"""
import sys
import repolib
import optparse
def option_parser () :
version_string = "%%prog %s" % __version__
parser = optparse.OptionParser( usage=__usage__ , version=version_string )
return parser
def main () :
parser = option_parser()
opts , args = parser.parse_args()
if not args :
parser.print_help()
sys.exit(1)
while args :
repo_name = args.pop()
try :
repo = repolib.BuildRepository.new( repo_name )
repo.build()
except Exception , ex :
repolib.logger.critical( "Repo %s : %s" % ( repo_name , ex ) )
if __name__ == "__main__" :
main()