Repository: goreleaser/nfpm
Pull request #438 (2022-01-31 18:33:48)

fix: deb multilines should have 1 space prefix
refs https://github.com/goreleaser/goreleaser/issues/2861

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/nfpm/pull/438?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#438](https://codecov.io/gh/goreleaser/nfpm/pull/438?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (b285979) into [main](https://codecov.io/gh/goreleaser/nfpm/commit/d16adac8c351645d6fb0fee0e44d5012b7e529f0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (d16adac) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/nfpm/pull/438/graphs/tree.svg?width=650&height=150&src=pr&token=9QKGIxn7wg&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)](https://codecov.io/gh/goreleaser/nfpm/pull/438?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)

```diff
@@           Coverage Diff           @@
##             main     #438   +/-   ##
=======================================
  Coverage   66.52%   66.52%           
=======================================
  Files          15       15           
  Lines        1882     1882           
=======================================
  Hits         1252     1252           
  Misses        491      491           
  Partials      139      139           
```


| [Impacted Files](https://codecov.io/gh/goreleaser/nfpm/pull/438?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | Coverage Δ | |
|---|---|---|
| [deb/deb.go](https://codecov.io/gh/goreleaser/nfpm/pull/438/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-ZGViL2RlYi5nbw==) | `70.16% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/nfpm/pull/438?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/nfpm/pull/438?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [d16adac...b285979](https://codecov.io/gh/goreleaser/nfpm/pull/438?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).


Patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f719c3e..8a2f07a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -104,7 +104,7 @@ jobs:
           key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
           restore-keys: |
             ${{ runner.os }}-go-
-      - uses: sigstore/cosign-installer@v1.4.1
+      - uses: sigstore/cosign-installer@v2.0.0
       - uses: anchore/sbom-action/download-syft@v0.6.0
       - uses: docker/setup-qemu-action@v1
       - uses: docker/setup-buildx-action@v1
diff --git a/deb/deb.go b/deb/deb.go
index 93309b6..469f8e7 100644
--- a/deb/deb.go
+++ b/deb/deb.go
@@ -732,7 +732,7 @@ func writeControl(w io.Writer, data controlData) error {
 			return strings.Trim(strings.Join(strs, ", "), " ")
 		},
 		"multiline": func(strs string) string {
-			ret := strings.ReplaceAll(strs, "\n", "\n  ")
+			ret := strings.ReplaceAll(strs, "\n", "\n ")
 			return strings.Trim(ret, " \n")
 		},
 	})


Test patch:
diff --git a/deb/testdata/multiline.golden b/deb/testdata/multiline.golden
index 4d29e36..2e8dde1 100644
--- a/deb/testdata/multiline.golden
+++ b/deb/testdata/multiline.golden
@@ -5,5 +5,5 @@ Priority: extra
 Architecture: riscv64
 Installed-Size: 0
 Description: This field is a
-  multiline field
-  that should work.
+ multiline field
+ that should work.