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:
parent
03c6661b41
commit
d17e048e5f
13
rpm/rpm.go
13
rpm/rpm.go
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user