]>
git.ipfire.org Git - pakfire.git/blob - python/pakfire/api.py
2 ###############################################################################
4 # Pakfire - The IPFire package management system #
5 # Copyright (C) 2011 Pakfire development team #
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. #
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. #
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/>. #
20 ###############################################################################
27 Pakfire
= base
.Pakfire
29 def install(requires
, **pakfire_args
):
30 pakfire
= Pakfire(**pakfire_args
)
32 return pakfire
.install(requires
)
34 def resolvdep(pkgs
, **pakfire_args
):
35 pakfire
= Pakfire(**pakfire_args
)
37 return pakfire
.resolvdep(pkgs
)
39 def localinstall(files
, **pakfire_args
):
40 pakfire
= Pakfire(**pakfire_args
)
42 return pakfire
.localinstall(files
)
44 def reinstall(pkgs
, **pakfire_args
):
45 pakfire
= Pakfire(**pakfire_args
)
47 return pakfire
.reinstall(pkgs
)
49 def remove(what
, **pakfire_args
):
50 pakfire
= Pakfire(**pakfire_args
)
52 return pakfire
.remove(what
)
54 def update(pkgs
, check
=False, excludes
=None, allow_vendorchange
=False, allow_archchange
=False, **pakfire_args
):
55 pakfire
= Pakfire(**pakfire_args
)
57 return pakfire
.update(pkgs
, check
=check
, excludes
=excludes
,
58 allow_vendorchange
=allow_vendorchange
, allow_archchange
=allow_archchange
)
60 def downgrade(pkgs
, allow_vendorchange
=False, allow_archchange
=False, **pakfire_args
):
61 pakfire
= Pakfire(**pakfire_args
)
63 return pakfire
.downgrade(pkgs
,
64 allow_vendorchange
=allow_vendorchange
, allow_archchange
=allow_archchange
)
66 def info(patterns
, **pakfire_args
):
67 # Create pakfire instance.
68 pakfire
= Pakfire(**pakfire_args
)
70 return pakfire
.info(patterns
)
72 def search(pattern
, **pakfire_args
):
73 # Create pakfire instance.
74 pakfire
= Pakfire(**pakfire_args
)
76 return pakfire
.search(pattern
)
78 def groupinstall(group
, **pakfire_args
):
79 pakfire
= Pakfire(**pakfire_args
)
81 return pakfire
.groupinstall(group
)
83 def grouplist(group
, **pakfire_args
):
84 pakfire
= Pakfire(**pakfire_args
)
86 return pakfire
.grouplist(group
)
88 def _build(pkg
, resultdir
, **kwargs
):
89 pakfire
= Pakfire(mode
="builder", **kwargs
)
91 return pakfire
._build
(pkg
, resultdir
, **kwargs
)
93 def build(pkg
, **kwargs
):
94 return Pakfire
.build(pkg
, **kwargs
)
96 def shell(pkg
, **kwargs
):
97 return Pakfire
.shell(pkg
, **kwargs
)
99 def dist(pkg
, resultdir
, **pakfire_args
):
100 pakfire
= Pakfire(**pakfire_args
)
102 return pakfire
.dist(pkg
, resultdir
)
104 def provides(patterns
, **pakfire_args
):
105 # Create pakfire instance.
106 pakfire
= Pakfire(**pakfire_args
)
108 return pakfire
.provides(patterns
)
110 def requires(patterns
, **pakfire_args
):
111 # Create pakfire instance.
112 pakfire
= Pakfire(**pakfire_args
)
114 return pakfire
.requires(requires
)
116 def repo_create(path
, input_paths
, key_id
=None, type="binary", **pakfire_args
):
117 pakfire
= Pakfire(**pakfire_args
)
119 return pakfire
.repo_create(path
, input_paths
, key_id
=key_id
, type=type)
121 def repo_list(**pakfire_args
):
122 pakfire
= Pakfire(**pakfire_args
)
124 return pakfire
.repo_list()
126 def clean_all(**pakfire_args
):
127 pakfire
= Pakfire(**pakfire_args
)
129 return pakfire
.clean_all()
131 def check(**pakfire_args
):
132 pakfire
= Pakfire(**pakfire_args
)
134 return pakfire
.check()
137 def cache_create(**pakfire_args
):
138 return Pakfire
.cache_create(**pakfire_args
)
143 def key_init(**pakfire_args
):
144 pakfire
= Pakfire(**pakfire_args
)
146 return pakfire
.keyring
.init()
148 def key_generate(realname
, email
, **pakfire_args
):
149 pakfire
= Pakfire(**pakfire_args
)
151 return pakfire
.keyring
.gen_key(realname
, email
)
153 def key_import(keyfile
, **pakfire_args
):
154 pakfire
= Pakfire(**pakfire_args
)
156 return pakfire
.keyring
.import_key(keyfile
)
158 def key_export(keyid
, keyfile
, **pakfire_args
):
159 pakfire
= Pakfire(**pakfire_args
)
161 return pakfire
.keyring
.export_key(keyid
, keyfile
)
163 def key_delete(keyid
, **pakfire_args
):
164 pakfire
= Pakfire(**pakfire_args
)
166 return pakfire
.keyring
.delete_key(keyid
)
168 def key_list(**pakfire_args
):
169 pakfire
= Pakfire(**pakfire_args
)
171 return pakfire
.keyring
.list_keys()