diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-07 21:29:16 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-07 21:29:16 +0900 |
| commit | 5d18af00077ae6ba8ef686d1fd93d888f69681b2 (patch) | |
| tree | eff32422fe3ef095c6a915ccb41c2a10a06990f7 /hst/fsbind.go | |
| parent | 0e6c1a50260de141c50bb50fd3f2b2bcf9a3fe64 (diff) | |
container/fhs: move pathname constants
This allows referencing FHS pathnames without importing container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fsbind.go')
| -rw-r--r-- | hst/fsbind.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/hst/fsbind.go b/hst/fsbind.go index 2cebf6b6..8b7b5fe8 100644 --- a/hst/fsbind.go +++ b/hst/fsbind.go @@ -6,6 +6,7 @@ import ( "hakurei.app/container" "hakurei.app/container/check" + "hakurei.app/container/fhs" ) func init() { gob.Register(new(FSBind)) } @@ -29,19 +30,19 @@ type FSBind struct { Optional bool `json:"optional,omitempty"` // enable special behaviour: - // for autoroot, Target must be set to [container.AbsFHSRoot]; - // for autoetc, Target must be set to [container.AbsFHSEtc] + // for autoroot, Target must be set to [fhs.AbsRoot]; + // for autoetc, Target must be set to [fhs.AbsEtc] Special bool `json:"special,omitempty"` } // IsAutoRoot returns whether this FSBind has autoroot behaviour enabled. func (b *FSBind) IsAutoRoot() bool { - return b.Valid() && b.Special && b.Target.String() == container.FHSRoot + return b.Valid() && b.Special && b.Target.String() == fhs.Root } // IsAutoEtc returns whether this FSBind has autoetc behaviour enabled. func (b *FSBind) IsAutoEtc() bool { - return b.Valid() && b.Special && b.Target.String() == container.FHSEtc + return b.Valid() && b.Special && b.Target.String() == fhs.Etc } func (b *FSBind) Valid() bool { @@ -56,7 +57,7 @@ func (b *FSBind) Valid() bool { return false } else { switch b.Target.String() { - case container.FHSRoot, container.FHSEtc: + case fhs.Root, fhs.Etc: break default: @@ -138,7 +139,7 @@ func (b *FSBind) String() string { if flagSym != "" { prefix += ":" + flagSym } - if b.Source.String() != container.FHSRoot { + if b.Source.String() != fhs.Root { return prefix + ":" + b.Source.String() } return prefix |
