]> git.ipfire.org Git - pakfire.git/blob - python/pakfire/api.py
Rewrite the buildsystem of this package.
[pakfire.git] / python / pakfire / api.py
1 #!/usr/bin/python
2 ###############################################################################
3 # #
4 # Pakfire - The IPFire package management system #
5 # Copyright (C) 2011 Pakfire development team #
6 # #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
11 # #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
16 # #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 # #
20 ###############################################################################
21
22 import base
23
24 from errors import *
25
26 Pakfire = base.Pakfire
27
28 def install(requires, **pakfire_args):
29 pakfire = Pakfire(**pakfire_args)
30
31 return pakfire.install(requires)
32
33 def resolvdep(requires, **pakfire_args):
34 pakfire = Pakfire(**pakfire_args)
35
36 return pakfire.resolvdep(requires)
37
38 def localinstall(files, **pakfire_args):
39 pakfire = Pakfire(**pakfire_args)
40
41 return pakfire.localinstall(files)
42
43 def remove(what, **pakfire_args):
44 pakfire = Pakfire(**pakfire_args)
45
46 return pakfire.remove(what)
47
48 def update(pkgs, check=False, **pakfire_args):
49 pakfire = Pakfire(**pakfire_args)
50
51 return pakfire.update(pkgs, check=check)
52
53 def info(patterns, **pakfire_args):
54 # Create pakfire instance.
55 pakfire = Pakfire(**pakfire_args)
56
57 return pakfire.info(patterns)
58
59 def search(pattern, **pakfire_args):
60 # Create pakfire instance.
61 pakfire = Pakfire(**pakfire_args)
62
63 return pakfire.search(pattern)
64
65 def groupinstall(group, **pakfire_args):
66 pakfire = Pakfire(**pakfire_args)
67
68 return pakfire.groupinstall(group)
69
70 def grouplist(group, **pakfire_args):
71 pakfire = Pakfire(**pakfire_args)
72
73 return pakfire.grouplist(group)
74
75 def _build(pkg, resultdir, **kwargs):
76 pakfire = Pakfire(**kwargs)
77
78 return pakfire._build(pkg, resultdir, **kwargs)
79
80 def build(pkg, **kwargs):
81 return Pakfire.build(pkg, **kwargs)
82
83 def shell(pkg, **kwargs):
84 return Pakfire.shell(pkg, **kwargs)
85
86 def dist(pkgs, resultdirs=None, **pakfire_args):
87 pakfire = Pakfire(**pakfire_args)
88
89 return pakfire.dist(pkgs, resultdirs=resultdirs)
90
91 def provides(patterns, **pakfire_args):
92 # Create pakfire instance.
93 pakfire = Pakfire(**pakfire_args)
94
95 return pakfire.provides(patterns)
96
97 def requires(patterns, **pakfire_args):
98 # Create pakfire instance.
99 pakfire = Pakfire(**pakfire_args)
100
101 return pakfire.requires(requires)
102
103 def repo_create(path, input_paths, type="binary", **pakfire_args):
104 pakfire = Pakfire(**pakfire_args)
105
106 return pakfire.repo_create(path, input_paths, type=type)
107
108 def repo_list(**pakfire_args):
109 pakfire = Pakfire(**pakfire_args)
110
111 return pakfire.repo_list()
112
113 def clean_all(**pakfire_args):
114 pakfire = Pakfire(**pakfire_args)
115
116 return pakfire.clean_all()
117
118 def check(**pakfire_args):
119 pakfire = Pakfire(**pakfire_args)
120
121 return pakfire.check()