forked from mirrors/gomod2nix
Merge pull request #52 from adisbladis/mac-ds-store-filter
Filter MacOS .DS_Store directories
This commit is contained in:
commit
71c797eb0d
5 changed files with 11 additions and 4 deletions
|
@ -8,3 +8,5 @@ go mod download "$goPackagePath@$version"
|
||||||
dir=$(go mod download --json "$goPackagePath@$version" | jq -r .Dir)
|
dir=$(go mod download --json "$goPackagePath@$version" | jq -r .Dir)
|
||||||
|
|
||||||
cp -r $dir $out
|
cp -r $dir $out
|
||||||
|
|
||||||
|
find $out -iname ".ds_store" | xargs -r rm -r
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/nix-community/go-nix/pkg/nar"
|
"github.com/nix-community/go-nix/pkg/nar"
|
||||||
|
@ -113,7 +114,9 @@ func GeneratePkgs(directory string, goMod2NixPath string, numWorkers int) ([]*sc
|
||||||
}).Info("Calculating NAR hash")
|
}).Info("Calculating NAR hash")
|
||||||
|
|
||||||
h := sha256.New()
|
h := sha256.New()
|
||||||
err := nar.DumpPath(h, dl.Dir)
|
err := nar.DumpPathFilter(h, dl.Dir, func(name string, nodeType nar.NodeType) bool {
|
||||||
|
return strings.ToLower(filepath.Base(name)) != ".ds_store"
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -4,7 +4,7 @@ go 1.14
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/BurntSushi/toml v1.1.0
|
github.com/BurntSushi/toml v1.1.0
|
||||||
github.com/nix-community/go-nix v0.0.0-20220528121639-b940fb0a12d8
|
github.com/nix-community/go-nix v0.0.0-20220531154832-fb763dcb3ffc
|
||||||
github.com/sirupsen/logrus v1.8.1
|
github.com/sirupsen/logrus v1.8.1
|
||||||
golang.org/x/mod v0.5.1
|
golang.org/x/mod v0.5.1
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -15,6 +15,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/nix-community/go-nix v0.0.0-20220528121639-b940fb0a12d8 h1:IYr+3pldQtTwS55Xm2+3Ry81MpSKNVpMyYMNr7yQpts=
|
github.com/nix-community/go-nix v0.0.0-20220528121639-b940fb0a12d8 h1:IYr+3pldQtTwS55Xm2+3Ry81MpSKNVpMyYMNr7yQpts=
|
||||||
github.com/nix-community/go-nix v0.0.0-20220528121639-b940fb0a12d8/go.mod h1:r5pCQAjHNSDWTsy6+UbacPN8EzMVJiCAXDWbRN2qfwU=
|
github.com/nix-community/go-nix v0.0.0-20220528121639-b940fb0a12d8/go.mod h1:r5pCQAjHNSDWTsy6+UbacPN8EzMVJiCAXDWbRN2qfwU=
|
||||||
|
github.com/nix-community/go-nix v0.0.0-20220531154832-fb763dcb3ffc h1:/uRl4vxjqF0N8m8ha+TouWZxsMRCA98Fft24WNIb0L8=
|
||||||
|
github.com/nix-community/go-nix v0.0.0-20220531154832-fb763dcb3ffc/go.mod h1:r5pCQAjHNSDWTsy6+UbacPN8EzMVJiCAXDWbRN2qfwU=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
|
|
@ -29,8 +29,8 @@ schema = 1
|
||||||
version = "v0.1.0"
|
version = "v0.1.0"
|
||||||
hash = "sha256-QT65kTrNypS5GPWGvgnCpGLPlVbQAL4IYvuqAKhepb4="
|
hash = "sha256-QT65kTrNypS5GPWGvgnCpGLPlVbQAL4IYvuqAKhepb4="
|
||||||
[mod."github.com/nix-community/go-nix"]
|
[mod."github.com/nix-community/go-nix"]
|
||||||
version = "v0.0.0-20220528121639-b940fb0a12d8"
|
version = "v0.0.0-20220531154832-fb763dcb3ffc"
|
||||||
hash = "sha256-r6fq1mu0gRFqdI6msuAZp3ZoncAw5L16oBFPUA9vPYk="
|
hash = "sha256-vCoRCe1DcyNXfz6gun9wGBu/o+j6WGcS8mbFmXZfyps="
|
||||||
[mod."github.com/pkg/errors"]
|
[mod."github.com/pkg/errors"]
|
||||||
version = "v0.9.1"
|
version = "v0.9.1"
|
||||||
hash = "sha256-mNfQtcrQmu3sNg/7IwiieKWOgFQOVVe2yXgKBpe/wZw="
|
hash = "sha256-mNfQtcrQmu3sNg/7IwiieKWOgFQOVVe2yXgKBpe/wZw="
|
||||||
|
|
Loading…
Reference in a new issue