Remove all the internal package that are now in the github.com/osbuild/images package and vendor it. A new function in internal/blueprint/ converts from an osbuild-composer blueprint to an images blueprint. This is necessary for keeping the blueprint implementation in both packages. In the future, the images package will change the blueprint (and most likely rename it) and it will only be part of the osbuild-composer internals and interface. The Convert() function will be responsible for converting the blueprint into the new configuration object.
34 lines
754 B
Go
34 lines
754 B
Go
package fsnode
|
|
|
|
import "os"
|
|
|
|
type Directory struct {
|
|
baseFsNode
|
|
ensureParentDirs bool
|
|
}
|
|
|
|
func (d *Directory) IsDir() bool {
|
|
return true
|
|
}
|
|
|
|
func (d *Directory) EnsureParentDirs() bool {
|
|
if d == nil {
|
|
return false
|
|
}
|
|
return d.ensureParentDirs
|
|
}
|
|
|
|
// NewDirectory creates a new directory with the given path, mode, user and group.
|
|
// user and group can be either a string (user name/group name), an int64 (UID/GID) or nil.
|
|
func NewDirectory(path string, mode *os.FileMode, user interface{}, group interface{}, ensureParentDirs bool) (*Directory, error) {
|
|
baseNode, err := newBaseFsNode(path, mode, user, group)
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Directory{
|
|
baseFsNode: *baseNode,
|
|
ensureParentDirs: ensureParentDirs,
|
|
}, nil
|
|
}
|