Repository: goreleaser/nfpm
Pull request #935 (2025-06-07 02:46:15)

feat: srpm
this adds a `src.rpm` packager.

refs https://github.com/goreleaser/goreleaser/pull/3412

cloudflare-workers-and-pages[bot]: ## Deploying nfpm with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages

<table><tr><td><strong>Latest commit:</strong> </td><td>
<code>e360bf9</code>
</td></tr>
<tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr>
<tr><td><strong>Preview URL:</strong></td><td>
<a href='https://72b624b9.nfpm.pages.dev'>https://72b624b9.nfpm.pages.dev</a>
</td></tr>
<tr><td><strong>Branch Preview URL:</strong></td><td>
<a href='https://srpm.nfpm.pages.dev'>https://srpm.nfpm.pages.dev</a>
</td></tr>
</table>

[View logs](https://dash.cloudflare.com/38902619da36c01ecbe504368d4ed023/pages/view/nfpm/72b624b9-a557-43a2-9522-9f7cc649014e)

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/goreleaser/nfpm/pull/935?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
Attention: Patch coverage is `73.33333%` with `4 lines` in your changes missing coverage. Please review.
> Project coverage is 69.27%. Comparing base [(`9f029a4`)](https://app.codecov.io/gh/goreleaser/nfpm/commit/9f029a49563c197ac1f83795a816afaae977b068?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) to head [(`e360bf9`)](https://app.codecov.io/gh/goreleaser/nfpm/commit/e360bf9c82943c78cca52773f2b9ca2abb80003f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> Report is 3 commits behind head on main.

| [Files with missing lines](https://app.codecov.io/gh/goreleaser/nfpm/pull/935?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | Patch % | Lines |
|---|---|---|
| [rpm/rpm.go](https://app.codecov.io/gh/goreleaser/nfpm/pull/935?src=pr&el=tree&filepath=rpm%2Frpm.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-cnBtL3JwbS5nbw==) | 73.33% | [2 Missing and 2 partials :warning: ](https://app.codecov.io/gh/goreleaser/nfpm/pull/935?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) |

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main     #935      +/-   ##
==========================================
- Coverage   69.29%   69.27%   -0.02%     
==========================================
  Files          22       22              
  Lines        3120     3128       +8     
==========================================
+ Hits         2162     2167       +5     
- Misses        745      747       +2     
- Partials      213      214       +1     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/goreleaser/nfpm/pull/935?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
twpayne: LGTM

Patch:
diff --git a/rpm/rpm.go b/rpm/rpm.go
index c983516..a3e0d2d 100644
--- a/rpm/rpm.go
+++ b/rpm/rpm.go
@@ -26,6 +26,8 @@ const (
 	tagChangelogName = 1081
 	// https://github.com/rpm-software-management/rpm/blob/master/lib/rpmtag.h#L154
 	tagChangelogText = 1082
+	// https://github.com/rpm-software-management/rpm/blob/master/include/rpm/rpmtag.h#L183
+	tagSourcePackage = 1106
 
 	// Symbolic link
 	tagLink = 0o120000
@@ -40,19 +42,34 @@ const (
 {{- end}}{{- end}}`
 )
 
-const packagerName = "rpm"
-
 // nolint: gochecknoinits
 func init() {
-	nfpm.RegisterPackager(packagerName, Default)
+	nfpm.RegisterPackager(formatRPM.String(), DefaultRPM)
+	nfpm.RegisterPackager(formatSRPM.String(), DefaultSRPM)
 }
 
-// Default RPM packager.
+// DefaultRPM RPM packager.
+// nolint: gochecknoglobals
+var DefaultRPM = &RPM{formatRPM}
+
+// DefaultRPM RPM packager.
 // nolint: gochecknoglobals
-var Default = &RPM{}
+var DefaultSRPM = &RPM{formatSRPM}
+
+type format uint
+
+const (
+	formatRPM format = iota
+	formatSRPM
+)
+
+// String implements fmt.Stringer.
+func (f format) String() string { return [2]string{"rpm", "srpm"}[f] }
 
 // RPM is a RPM packager implementation.
-type RPM struct{}
+type RPM struct {
+	format format
+}
 
 // https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch01s03.html
 // nolint: gochecknoglobals
@@ -85,33 +102,37 @@ func setDefaults(info *nfpm.Info) *nfpm.Info {
 // ConventionalFileName returns a file name according
 // to the conventions for RPM packages. See:
 // http://ftp.rpm.org/max-rpm/ch-rpm-file-format.html
-func (*RPM) ConventionalFileName(info *nfpm.Info) string {
+func (r *RPM) ConventionalFileName(info *nfpm.Info) string {
 	info = setDefaults(info)
 
 	// name-version-release.architecture.rpm
 	return fmt.Sprintf(
-		"%s-%s-%s.%s.rpm",
+		"%s-%s-%s.%s%s",
 		info.Name,
 		formatVersion(info),
 		defaultTo(info.Release, "1"),
 		info.Arch,
+		r.ConventionalExtension(),
 	)
 }
 
 // ConventionalExtension returns the file name conventionally used for RPM packages
-func (*RPM) ConventionalExtension() string {
+func (r *RPM) ConventionalExtension() string {
+	if r.format == formatSRPM {
+		return ".src.rpm"
+	}
 	return ".rpm"
 }
 
 // Package writes a new RPM package to the given writer using the given info.
-func (*RPM) Package(info *nfpm.Info, w io.Writer) (err error) {
+func (r *RPM) Package(info *nfpm.Info, w io.Writer) (err error) {
 	var (
 		meta *rpmpack.RPMMetaData
 		rpm  *rpmpack.RPM
 	)
 	info = setDefaults(info)
 
-	err = nfpm.PrepareForPackager(info, packagerName)
+	err = nfpm.PrepareForPackager(info, "rpm")
 	if err != nil {
 		return err
 	}
@@ -123,6 +144,10 @@ func (*RPM) Package(info *nfpm.Info, w io.Writer) (err error) {
 		return err
 	}
 
+	if r.format == formatSRPM {
+		rpm.AddCustomTag(tagSourcePackage, rpmpack.EntryUint32([]uint32{1}))
+	}
+
 	if info.RPM.Signature.KeyFile != "" {
 		rpm.SetPGPSigner(sign.PGPSignerWithKeyID(
 			info.RPM.Signature.KeyFile,
@@ -365,7 +390,7 @@ func addScriptFiles(info *nfpm.Info, rpm *rpmpack.RPM) error {
 func createFilesInsideRPM(info *nfpm.Info, rpm *rpmpack.RPM) (err error) {
 	mtime := modtime.Get(info.MTime)
 	for _, content := range info.Contents {
-		if content.Packager != "" && content.Packager != packagerName {
+		if content.Packager != "" && content.Packager != "rpm" {
 			continue
 		}
 


Test patch:
diff --git a/rpm/rpm_test.go b/rpm/rpm_test.go
index 370eeaa..46d8e4d 100644
--- a/rpm/rpm_test.go
+++ b/rpm/rpm_test.go
@@ -94,13 +94,13 @@ func exampleInfo() *nfpm.Info {
 }
 
 func TestConventionalExtension(t *testing.T) {
-	require.Equal(t, ".rpm", Default.ConventionalExtension())
+	require.Equal(t, ".rpm", DefaultRPM.ConventionalExtension())
 }
 
 func TestRPM(t *testing.T) {
 	f, err := os.CreateTemp(t.TempDir(), "test.rpm")
 	require.NoError(t, err)
-	require.NoError(t, Default.Package(exampleInfo(), f))
+	require.NoError(t, DefaultRPM.Package(exampleInfo(), f))
 
 	file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
 	require.NoError(t, err)
@@ -153,10 +153,70 @@ func TestRPM(t *testing.T) {
 	require.Equal(t, "Foo does things", description)
 }
 
+func TestSRPM(t *testing.T) {
+	f, err := os.CreateTemp(t.TempDir(), "test.rpm")
+	require.NoError(t, err)
+	require.NoError(t, DefaultSRPM.Package(exampleInfo(), f))
+
+	file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
+	require.NoError(t, err)
+	defer func() {
+		f.Close()
+		file.Close()
+		err = os.Remove(file.Name())
+		require.NoError(t, err)
+	}()
+	rpm, err := rpmutils.ReadRpm(file)
+	require.NoError(t, err)
+
+	os, err := rpm.Header.GetString(rpmutils.OS)
+	require.NoError(t, err)
+	require.Equal(t, "linux", os)
+
+	arch, err := rpm.Header.GetString(rpmutils.ARCH)
+	require.NoError(t, err)
+	require.Equal(t, archToRPM["amd64"], arch)
+
+	version, err := rpm.Header.GetString(rpmutils.VERSION)
+	require.NoError(t, err)
+	require.Equal(t, "1.0.0", version)
+
+	release, err := rpm.Header.GetString(rpmutils.RELEASE)
+	require.NoError(t, err)
+	require.Equal(t, "1", release)
+
+	epoch, err := rpm.Header.Get(rpmutils.EPOCH)
+	require.NoError(t, err)
+	epochUint32, ok := epoch.([]uint32)
+	require.True(t, ok)
+	require.Len(t, epochUint32, 1)
+	require.Equal(t, uint32(0), epochUint32[0])
+
+	group, err := rpm.Header.GetString(rpmutils.GROUP)
+	require.NoError(t, err)
+	require.Equal(t, "foo", group)
+
+	buildhost, err := rpm.Header.GetString(rpmutils.BUILDHOST)
+	require.NoError(t, err)
+	require.Equal(t, "barhost", buildhost)
+
+	summary, err := rpm.Header.GetString(rpmutils.SUMMARY)
+	require.NoError(t, err)
+	require.Equal(t, "Foo does things", summary)
+
+	description, err := rpm.Header.GetString(rpmutils.DESCRIPTION)
+	require.NoError(t, err)
+	require.Equal(t, "Foo does things", description)
+
+	bts, err := rpm.Header.GetUint32s(tagSourcePackage)
+	require.NoError(t, err)
+	require.Equal(t, []uint32{1}, bts)
+}
+
 func TestRPMMandatoryFieldsOnly(t *testing.T) {
 	f, err := os.CreateTemp(t.TempDir(), "test.rpm")
 	require.NoError(t, err)
-	require.NoError(t, Default.Package(&nfpm.Info{
+	require.NoError(t, DefaultRPM.Package(&nfpm.Info{
 		Name:        "foo",
 		Arch:        "amd64",
 		Version:     "1.2",
@@ -213,7 +273,7 @@ func TestRPMPlatform(t *testing.T) {
 	t.Cleanup(func() { require.NoError(t, f.Close()) })
 	info := exampleInfo()
 	info.Platform = "darwin"
-	require.NoError(t, Default.Package(info, f))
+	require.NoError(t, DefaultRPM.Package(info, f))
 }
 
 func TestRPMGroup(t *testing.T) {
@@ -221,7 +281,7 @@ func TestRPMGroup(t *testing.T) {
 	require.NoError(t, err)
 	info := exampleInfo()
 	info.RPM.Group = "Unspecified"
-	require.NoError(t, Default.Package(info, f))
+	require.NoError(t, DefaultRPM.Package(info, f))
 
 	file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
 	require.NoError(t, err)
@@ -257,7 +317,7 @@ func TestRPMCompression(t *testing.T) {
 				info := exampleInfo()
 				info.RPM.Compression = compLevel
 
-				require.NoError(t, Default.Package(info, f))
+				require.NoError(t, DefaultRPM.Package(info, f))
 				file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
 				require.NoError(t, err)
 				defer func() {
@@ -289,7 +349,7 @@ func TestRPMSummary(t *testing.T) {
 	info.RPM.Group = "Unspecified"
 	info.RPM.Summary = customSummary
 
-	require.NoError(t, Default.Package(info, f))
+	require.NoError(t, DefaultRPM.Package(info, f))
 
 	file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
 	require.NoError(t, err)
@@ -316,7 +376,7 @@ func TestRPMPackager(t *testing.T) {
 	info.RPM.Group = "Unspecified"
 	info.RPM.Packager = customPackager
 
-	require.NoError(t, Default.Package(info, f))
+	require.NoError(t, DefaultRPM.Package(info, f))
 
 	file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
 	require.NoError(t, err)
@@ -345,7 +405,7 @@ func TestWithRPMTags(t *testing.T) {
 		Group: "default",
 	}
 	info.Description = "first line\nsecond line\nthird line"
-	require.NoError(t, Default.Package(info, f))
+	require.NoError(t, DefaultRPM.Package(info, f))
 
 	file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
 	require.NoError(t, err)
@@ -491,14 +551,14 @@ func TestWithInvalidEpoch(t *testing.T) {
 		Group: "default",
 	}
 	info.Description = "first line\nsecond line\nthird line"
-	require.Error(t, Default.Package(info, f))
+	require.Error(t, DefaultRPM.Package(info, f))
 }
 
 func TestRPMScripts(t *testing.T) {
 	info := exampleInfo()
 	f, err := os.CreateTemp(t.TempDir(), fmt.Sprintf("%s-%s-*.rpm", info.Name, info.Version))
 	require.NoError(t, err)
-	err = Default.Package(info, f)
+	err = DefaultRPM.Package(info, f)
 	require.NoError(t, err)
 	file, err := os.OpenFile(f.Name(), os.O_RDONLY, 0o600) //nolint:gosec
 	require.NoError(t, err)
@@ -578,7 +638,7 @@ func TestRPMFileDoesNotExist(t *testing.T) {
 	}
 	abs, err := filepath.Abs("../testdata/whatever.confzzz")
 	require.NoError(t, err)
-	err = Default.Package(info, io.Discard)
+	err = DefaultRPM.Package(info, io.Discard)
 	require.EqualError(t, err, fmt.Sprintf("matching \"%s\": file does not exist", filepath.ToSlash(abs)))
 }
 
@@ -624,7 +684,7 @@ func TestConfigMissingOK(t *testing.T) {
 	}
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	expectedConfigContent, err := os.ReadFile(buildConfigFile)
@@ -660,7 +720,7 @@ func TestConfigNoReplace(t *testing.T) {
 	}
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	expectedConfigContent, err := os.ReadFile(buildConfigFile)
@@ -714,7 +774,7 @@ func TestRPMConventionalFileName(t *testing.T) {
 		info.Prerelease = testCase.Prerelease
 		info.VersionMetadata = testCase.Metadata
 
-		require.Equal(t, testCase.Expected, Default.ConventionalFileName(info))
+		require.Equal(t, testCase.Expected, DefaultRPM.ConventionalFileName(info))
 	}
 }
 
@@ -723,7 +783,7 @@ func TestRPMChangelog(t *testing.T) {
 	info.Changelog = "../testdata/changelog.yaml"
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	rpm, err := rpmutils.ReadRpm(bytes.NewReader(rpmFileBuffer.Bytes()))
@@ -770,7 +830,7 @@ func TestRPMNoChangelogTagsWithoutChangelogConfigured(t *testing.T) {
 	info := exampleInfo()
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	rpm, err := rpmutils.ReadRpm(bytes.NewReader(rpmFileBuffer.Bytes()))
@@ -815,7 +875,7 @@ func TestSymlink(t *testing.T) {
 	}
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	packagedSymlinkHeader, err := extractFileHeaderFromRpm(rpmFileBuffer.Bytes(), symlink)
@@ -842,7 +902,7 @@ func TestRPMSignature(t *testing.T) {
 	require.NotNil(t, keyring, "cannot verify sigs with an empty keyring")
 
 	var rpmBuffer bytes.Buffer
-	err = Default.Package(info, &rpmBuffer)
+	err = DefaultRPM.Package(info, &rpmBuffer)
 	require.NoError(t, err)
 
 	_, sigs, err := rpmutils.Verify(bytes.NewReader(rpmBuffer.Bytes()), keyring)
@@ -856,7 +916,7 @@ func TestRPMSignatureError(t *testing.T) {
 	info.RPM.Signature.KeyPassphrase = "wrongpass"
 
 	var rpmBuffer bytes.Buffer
-	err := Default.Package(info, &rpmBuffer)
+	err := DefaultRPM.Package(info, &rpmBuffer)
 	require.Error(t, err)
 
 	var expectedError *nfpm.ErrSigningFailure
@@ -881,7 +941,7 @@ func TestRPMSignatureCallback(t *testing.T) {
 	require.NotNil(t, keyring, "cannot verify sigs with an empty keyring")
 
 	var rpmBuffer bytes.Buffer
-	err = Default.Package(info, &rpmBuffer)
+	err = DefaultRPM.Package(info, &rpmBuffer)
 	require.NoError(t, err)
 
 	_, sigs, err := rpmutils.Verify(bytes.NewReader(rpmBuffer.Bytes()), keyring)
@@ -909,7 +969,7 @@ func TestRPMGhostFiles(t *testing.T) {
 	}
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	headerFiles, err := extraFileInfoSliceFromRpm(rpmFileBuffer.Bytes())
@@ -947,7 +1007,7 @@ func TestDisableGlobbing(t *testing.T) {
 	}
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	expectedContent, err := os.ReadFile("../testdata/{file}[")
@@ -989,7 +1049,7 @@ func TestDirectories(t *testing.T) {
 	}
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	require.Equal(t, []string{
@@ -1017,7 +1077,7 @@ func TestDirectories(t *testing.T) {
 }
 
 func TestGlob(t *testing.T) {
-	require.NoError(t, Default.Package(nfpm.WithDefaults(&nfpm.Info{
+	require.NoError(t, DefaultRPM.Package(nfpm.WithDefaults(&nfpm.Info{
 		Name:       "nfpm-repro",
 		Version:    "1.0.0",
 		Maintainer: "asdfasdf",
@@ -1044,7 +1104,7 @@ func TestIgnoreUnrelatedFiles(t *testing.T) {
 	}
 
 	var rpmFileBuffer bytes.Buffer
-	err := Default.Package(info, &rpmFileBuffer)
+	err := DefaultRPM.Package(info, &rpmFileBuffer)
 	require.NoError(t, err)
 
 	require.Empty(t, getTree(t, rpmFileBuffer.Bytes()))
diff --git a/testdata/acceptance/deb.dockerfile b/testdata/acceptance/deb.dockerfile
index e4b2bea..382f59f 100644
--- a/testdata/acceptance/deb.dockerfile
+++ b/testdata/acceptance/deb.dockerfile
@@ -161,7 +161,7 @@ FROM min AS rules
 RUN dpkg -r foo
 
 # ---- triggers test ----
-FROM min as triggers
+FROM min AS triggers
 # simulate another package that activates the trigger
 RUN dpkg-trigger --by-package foo manual-trigger
 RUN dpkg --triggers-only foo
diff --git a/testdata/acceptance/rpm.dockerfile b/testdata/acceptance/rpm.dockerfile
index 496d9f3..e7b0632 100644
--- a/testdata/acceptance/rpm.dockerfile
+++ b/testdata/acceptance/rpm.dockerfile
@@ -124,15 +124,15 @@ RUN command -v zsh
 # ---- env-var-version test ----
 FROM min AS env-var-version
 ENV EXPECTVER="Version : 1.0.0~0.1.b1+git.abcdefgh" \
-  EXPECTREL="Release : 1"
+	EXPECTREL="Release : 1"
 RUN rpm -qpi /tmp/foo.rpm | sed -e 's/ \+/ /g' | grep "Version" > found.ver
 RUN rpm -qpi /tmp/foo.rpm | sed -e 's/ \+/ /g' | grep "Release" > found.rel
 RUN export FOUND_VER="$(cat found.ver)" && \
-  echo "Expected: ${EXPECTVER}' :: Found: '${FOUND_VER}'" && \
-  test "${FOUND_VER}" = "${EXPECTVER}"
+	echo "Expected: ${EXPECTVER}' :: Found: '${FOUND_VER}'" && \
+	test "${FOUND_VER}" = "${EXPECTVER}"
 RUN export FOUND_REL="$(cat found.rel)" && \
-  echo "Expected: '${EXPECTREL}' :: Found: '${FOUND_REL}'" && \
-  test "${FOUND_REL}" = "${EXPECTREL}"
+	echo "Expected: '${EXPECTREL}' :: Found: '${FOUND_REL}'" && \
+	test "${FOUND_REL}" = "${EXPECTREL}"
 
 
 # ---- changelog test ----
@@ -222,7 +222,7 @@ RUN test ! -d /etc/bar
 RUN test ! -d /etc/baz
 
 # ---- verify test ----
-FROM min as verify
+FROM min AS verify
 RUN rpm -V foo
 RUN rm /tmp/postinstall-proof
 RUN ! rpm -V foo