-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg_ebuild.go
115 lines (96 loc) · 3.09 KB
/
pkg_ebuild.go
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package pkgcraft
// #cgo pkg-config: pkgcraft
// #include <pkgcraft.h>
import "C"
type EbuildPkg struct {
*BasePkg
}
// Return a package's repo.
func (self *EbuildPkg) Repo() *EbuildRepo {
base := &BaseRepo{C.pkgcraft_pkg_repo(self.ptr), RepoFormatEbuild}
return &EbuildRepo{base, nil}
}
// Return a package's path.
func (self *EbuildPkg) Path() string {
s := C.pkgcraft_pkg_ebuild_path(self.ptr)
defer C.pkgcraft_str_free(s)
return C.GoString(s)
}
// Return a package's ebuild file content.
func (self *EbuildPkg) Ebuild() (string, error) {
s := C.pkgcraft_pkg_ebuild_ebuild(self.ptr)
if s != nil {
defer C.pkgcraft_str_free(s)
return C.GoString(s), nil
} else {
return "", newPkgcraftError()
}
}
// Return a package's description.
func (self *EbuildPkg) Description() string {
s := C.pkgcraft_pkg_ebuild_description(self.ptr)
defer C.pkgcraft_str_free(s)
return C.GoString(s)
}
// Return a package's slot.
func (self *EbuildPkg) Slot() string {
s := C.pkgcraft_pkg_ebuild_slot(self.ptr)
defer C.pkgcraft_str_free(s)
return C.GoString(s)
}
// Return a package's subslot.
func (self *EbuildPkg) Subslot() string {
s := C.pkgcraft_pkg_ebuild_subslot(self.ptr)
defer C.pkgcraft_str_free(s)
return C.GoString(s)
}
// Return a package's dependencies for the given descriptors.
func (self *EbuildPkg) Dependencies(keys []string) (*DependencySet, error) {
c_keys, c_len := sliceToCharArray(keys)
ptr := C.pkgcraft_pkg_ebuild_dependencies(self.ptr, c_keys, c_len)
if ptr != nil {
return dependencySetFromPtr(ptr), nil
} else {
return nil, newPkgcraftError()
}
}
// Return a package's DEPEND.
func (self *EbuildPkg) Depend() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_depend(self.ptr))
}
// Return a package's BDEPEND.
func (self *EbuildPkg) Bdepend() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_bdepend(self.ptr))
}
// Return a package's IDEPEND.
func (self *EbuildPkg) Idepend() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_idepend(self.ptr))
}
// Return a package's PDEPEND.
func (self *EbuildPkg) Pdepend() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_pdepend(self.ptr))
}
// Return a package's RDEPEND.
func (self *EbuildPkg) Rdepend() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_rdepend(self.ptr))
}
// Return a package's LICENSE.
func (self *EbuildPkg) License() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_license(self.ptr))
}
// Return a package's PROPERTIES.
func (self *EbuildPkg) Properties() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_properties(self.ptr))
}
// Return a package's REQUIRED_USE.
func (self *EbuildPkg) RequiredUse() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_required_use(self.ptr))
}
// Return a package's Restrict.
func (self *EbuildPkg) Restrict() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_restrict(self.ptr))
}
// Return a package's SRC_URI.
func (self *EbuildPkg) SrcUri() *DependencySet {
return dependencySetFromPtr(C.pkgcraft_pkg_ebuild_src_uri(self.ptr))
}