mirror of
https://github.com/mudler/luet.git
synced 2025-09-25 22:46:56 +00:00
Use goreleaser to build and release (#244)
Instead of using gox on one side and an action to release, we can merge them together with goreleaser which will build for extra targets (arm, mips if needed in the future) and it also takes care of creating checksums, a source archive, and a changelog and creating a release with all the artifacts. All binaries should respect the old naming convention, so any scripts out there should still work. Signed-off-by: Itxaka <igarcia@suse.com>
This commit is contained in:
35
vendor/github.com/spf13/afero/copyOnWriteFs.go
generated
vendored
35
vendor/github.com/spf13/afero/copyOnWriteFs.go
generated
vendored
@@ -14,7 +14,7 @@ var _ Lstater = (*CopyOnWriteFs)(nil)
|
||||
// a possibly writeable layer on top. Changes to the file system will only
|
||||
// be made in the overlay: Changing an existing file in the base layer which
|
||||
// is not present in the overlay will copy the file to the overlay ("changing"
|
||||
// includes also calls to e.g. Chtimes() and Chmod()).
|
||||
// includes also calls to e.g. Chtimes(), Chmod() and Chown()).
|
||||
//
|
||||
// Reading directories is currently only supported via Open(), not OpenFile().
|
||||
type CopyOnWriteFs struct {
|
||||
@@ -75,6 +75,19 @@ func (u *CopyOnWriteFs) Chmod(name string, mode os.FileMode) error {
|
||||
return u.layer.Chmod(name, mode)
|
||||
}
|
||||
|
||||
func (u *CopyOnWriteFs) Chown(name string, uid, gid int) error {
|
||||
b, err := u.isBaseFile(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b {
|
||||
if err := u.copyToLayer(name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return u.layer.Chown(name, uid, gid)
|
||||
}
|
||||
|
||||
func (u *CopyOnWriteFs) Stat(name string) (os.FileInfo, error) {
|
||||
fi, err := u.layer.Stat(name)
|
||||
if err != nil {
|
||||
@@ -117,6 +130,26 @@ func (u *CopyOnWriteFs) LstatIfPossible(name string) (os.FileInfo, bool, error)
|
||||
return fi, false, err
|
||||
}
|
||||
|
||||
func (u *CopyOnWriteFs) SymlinkIfPossible(oldname, newname string) error {
|
||||
if slayer, ok := u.layer.(Linker); ok {
|
||||
return slayer.SymlinkIfPossible(oldname, newname)
|
||||
}
|
||||
|
||||
return &os.LinkError{Op: "symlink", Old: oldname, New: newname, Err: ErrNoSymlink}
|
||||
}
|
||||
|
||||
func (u *CopyOnWriteFs) ReadlinkIfPossible(name string) (string, error) {
|
||||
if rlayer, ok := u.layer.(LinkReader); ok {
|
||||
return rlayer.ReadlinkIfPossible(name)
|
||||
}
|
||||
|
||||
if rbase, ok := u.base.(LinkReader); ok {
|
||||
return rbase.ReadlinkIfPossible(name)
|
||||
}
|
||||
|
||||
return "", &os.PathError{Op: "readlink", Path: name, Err: ErrNoReadlink}
|
||||
}
|
||||
|
||||
func (u *CopyOnWriteFs) isNotExist(err error) bool {
|
||||
if e, ok := err.(*os.PathError); ok {
|
||||
err = e.Err
|
||||
|
Reference in New Issue
Block a user