Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for deb's config maintenance script #317

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 4 additions & 0 deletions deb/deb.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ func createControl(instSize int64, md5sums []byte, info *nfpm.Info) (controlTarG
fileName: "templates",
mode: 0o644,
}
specialFiles[info.Overridables.Deb.Scripts.Config] = &fileAndMode{
fileName: "config",
mode: 0o755,
}

for path, destMode := range specialFiles {
if path != "" {
Expand Down
1 change: 1 addition & 0 deletions nfpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ type DebTriggers struct {
type DebScripts struct {
Rules string `yaml:"rules,omitempty"`
Templates string `yaml:"templates,omitempty"`
Config string `yaml:"config,omitempty"`
}

// Scripts contains information about maintainer scripts for packages.
Expand Down
2 changes: 2 additions & 0 deletions testdata/acceptance/rules.deb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ contents:
deb:
scripts:
rules: ./testdata/acceptance/scripts/rules.sh
templates: ./testdata/acceptance/scripts/templates
config: ./testdata/acceptance/scripts/config
4 changes: 4 additions & 0 deletions testdata/acceptance/scripts/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

echo "Ok" > /tmp/config-proof

3 changes: 3 additions & 0 deletions testdata/acceptance/scripts/templates
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Template: templates/acceptance
Type: string
Description: A setting for acceptance tests