Skip to content
This repository was archived by the owner on Jun 16, 2022. It is now read-only.

Add deb task configuration allowing the auto-inclusion of resources #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tasks/deb-dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ func debDevBuild(tp TaskParams) error {
build := debgen.NewBuildParams()
build.DestDir = debDir
build.TmpDir = tmpDir
build.Init()
if err = build.Init(); err != nil {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

return err
}
build.IsRmtemp = rmtemp
var ctrl *deb.Control
//Read control data. If control file doesnt exist, use parameters ...
Expand Down
10 changes: 9 additions & 1 deletion tasks/deb-source.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func init() {
},
"rmtemp": true,
"go-sources-dir": ".",
"resources-dir": "",
"other-mappped-files": map[string]interface{}{},
}})
}
Expand Down Expand Up @@ -216,8 +217,15 @@ func debSourceBuild(tp TaskParams) (err error) {
build := debgen.NewBuildParams()
build.DestDir = debDir
build.TmpDir = tmpDir
build.Init()
if err = build.Init(); err != nil {
return err
}
build.IsRmtemp = rmtemp

if resDir := tp.Settings.GetTaskSettingString(TASK_DEB_GEN, "resources-dir"); resDir != "" {
build.ResourcesDir = resDir
}

var ctrl *deb.Control
//Read control data. If control file doesnt exist, use parameters ...
fi, err := os.Open(filepath.Join(build.DebianDir, "control"))
Expand Down
14 changes: 11 additions & 3 deletions tasks/deb.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ func init() {
runTaskDebGen,
map[string]interface{}{
"metadata": map[string]interface{}{
"maintainer": "unknown",
"maintainerEmail": "unknown@example.com",
"maintainer": "unknown",
"maintainer-email": "unknown@example.com",
},
"metadata-deb": map[string]interface{}{"Depends": "",
"Build-Depends": "debhelper (>=4.0.0), golang-go, gcc",
},
"rmtemp": true,
"armarch": "",
"go-sources-dir": ".",
"resources-dir": "",
"other-mappped-files": map[string]interface{}{},
"bin-dir": "/usr/bin",
},
Expand Down Expand Up @@ -204,8 +205,15 @@ func debBuild(dest platforms.Platform, tp TaskParams) error {
build := debgen.NewBuildParams()
build.DestDir = debDir
build.TmpDir = tmpDir
build.Init()
if err = build.Init(); err != nil {
return err
}
build.IsRmtemp = rmtemp

if resDir := tp.Settings.GetTaskSettingString(TASK_DEB_GEN, "resources-dir"); resDir != "" {
build.ResourcesDir = resDir
}

var ctrl *deb.Control
//Read control data. If control file doesnt exist, use parameters ...
fi, err := os.Open(filepath.Join(build.DebianDir, "control"))
Expand Down