1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-20 16:03:06 +02:00

fix(#95): resolve empty dir permission issues and readd the MTime back to the files and directories in the RPM (#96)

This commit is contained in:
Dj Gilcrease 2019-10-30 13:56:34 -07:00 committed by Carlos Alexandro Becker
parent 03c6661b41
commit d17e048e5f

View File

@ -6,6 +6,7 @@ import (
"io"
"io/ioutil"
"os"
"time"
"github.com/google/rpmpack"
"github.com/pkg/errors"
@ -180,8 +181,9 @@ func addEmptyDirsRPM(info *nfpm.Info, rpm *rpmpack.RPM) {
for _, dir := range info.EmptyFolders {
rpm.AddFile(
rpmpack.RPMFile{
Name: dir,
Mode: uint(1 | 040000),
Name: dir,
Mode: uint(040755),
MTime: uint32(time.Now().Unix()),
},
)
}
@ -236,9 +238,10 @@ func copyToRPM(rpm *rpmpack.RPM, src, dst string, config bool) error {
}
rpmFile := rpmpack.RPMFile{
Name: dst,
Body: data,
Mode: uint(info.Mode()),
Name: dst,
Body: data,
Mode: uint(info.Mode()),
MTime: uint32(info.ModTime().Unix()),
}
if config {