]> git.ipfire.org Git - pakfire.git/blob - python/pakfire/api.py
Add support for --allow-{arch,vendor}change on updates.
[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, excludes=None, allow_vendorchange=False, allow_archchange=False, **pakfire_args):
49 pakfire = Pakfire(**pakfire_args)
50
51 return pakfire.update(pkgs, check=check, excludes=excludes,
52 allow_vendorchange=allow_vendorchange, allow_archchange=allow_archchange)
53
54 def info(patterns, **pakfire_args):
55 # Create pakfire instance.
56 pakfire = Pakfire(**pakfire_args)
57
58 return pakfire.info(patterns)
59
60 def search(pattern, **pakfire_args):
61 # Create pakfire instance.
62 pakfire = Pakfire(**pakfire_args)
63
64 return pakfire.search(pattern)
65
66 def groupinstall(group, **pakfire_args):
67 pakfire = Pakfire(**pakfire_args)
68
69 return pakfire.groupinstall(group)
70
71 def grouplist(group, **pakfire_args):
72 pakfire = Pakfire(**pakfire_args)
73
74 return pakfire.grouplist(group)
75
76 def _build(pkg, resultdir, **kwargs):
77 pakfire = Pakfire(**kwargs)
78
79 return pakfire._build(pkg, resultdir, **kwargs)
80
81 def build(pkg, **kwargs):
82 return Pakfire.build(pkg, **kwargs)
83
84 def shell(pkg, **kwargs):
85 return Pakfire.shell(pkg, **kwargs)
86
87 def dist(pkgs, resultdirs=None, **pakfire_args):
88 pakfire = Pakfire(**pakfire_args)
89
90 return pakfire.dist(pkgs, resultdirs=resultdirs)
91
92 def provides(patterns, **pakfire_args):
93 # Create pakfire instance.
94 pakfire = Pakfire(**pakfire_args)
95
96 return pakfire.provides(patterns)
97
98 def requires(patterns, **pakfire_args):
99 # Create pakfire instance.
100 pakfire = Pakfire(**pakfire_args)
101
102 return pakfire.requires(requires)
103
104 def repo_create(path, input_paths, type="binary", **pakfire_args):
105 pakfire = Pakfire(**pakfire_args)
106
107 return pakfire.repo_create(path, input_paths, type=type)
108
109 def repo_list(**pakfire_args):
110 pakfire = Pakfire(**pakfire_args)
111
112 return pakfire.repo_list()
113
114 def clean_all(**pakfire_args):
115 pakfire = Pakfire(**pakfire_args)
116
117 return pakfire.clean_all()
118
119 def check(**pakfire_args):
120 pakfire = Pakfire(**pakfire_args)
121
122 return pakfire.check()