-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAUR.go
42 lines (36 loc) · 1.01 KB
/
AUR.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
package libremotebuild
// AURBuild build an AUR package
type AURBuild struct {
LibRB
args map[string]string
UploadType UploadType
DisableCcache bool
}
// NewAURBuild build an AUR package
func (Librb LibRB) NewAURBuild(packageName string) *AURBuild {
return &AURBuild{
LibRB: Librb,
args: map[string]string{
AURPackage: packageName,
},
}
}
// WithoutCcache disables ccache
func (aurBuild *AURBuild) WithoutCcache() *AURBuild {
aurBuild.DisableCcache = true
return aurBuild
}
// WithDmanager use dmnager for uplaod
func (aurBuild *AURBuild) WithDmanager(username, token, host, namespace string) {
aurBuild.UploadType = DataManagerUploadType
aurBuild.args[DMToken] = token
aurBuild.args[DMUser] = username
aurBuild.args[DMHost] = host
if len(namespace) > 0 {
aurBuild.args[DMNamespace] = namespace
}
}
// CreateJob build AUR package
func (aurBuild *AURBuild) CreateJob() (*AddJobResponse, error) {
return aurBuild.LibRB.AddJob(JobAUR, aurBuild.UploadType, aurBuild.args, aurBuild.DisableCcache)
}