From 645cd94efc970b7ecacefc29fe78153608ade11d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 26 Nov 2026 20:43:16 +0900 Subject: internal/rosa: remove /usr/src There is only one primary source directory per package, so naming the directory after the package makes little sense, and introduces many complications and ugliness of having to refer to their own name. This change also moves extras to /extra, preserving the relative pathnames. Signed-off-by: Ophestra --- internal/rosa/rosa.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'internal/rosa/rosa.go') diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index 22dbcd6d..3d4914f2 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -53,11 +53,13 @@ const ( ) var ( - // AbsUsrSrc is the conventional directory to place source code under. - AbsUsrSrc = fhs.AbsUsr.Append("src") - // AbsSystem is the Rosa OS installation prefix. AbsSystem = fhs.AbsRoot.Append(prefixR) + + // AbsSource is the directory to place source code under. + AbsSource = fhs.AbsRoot.Append("source") + // AbsExtra holds extra files provided to a packaging container. + AbsExtra = fhs.AbsRoot.Append("extra") ) // TargetError is an unsupported target architecture name. @@ -631,9 +633,7 @@ func (t Toolchain) New( dir == "" || attr.ScriptEarly != "" || helperScriptEarly != "" { - scriptEarly += ` -cd '/usr/src/` + name + `/' -` + scriptEarly += "\ncd /source/\n" } scriptEarly += attr.ScriptEarly + helperScriptEarly if dir != "" && dir != helperInPlace { @@ -648,9 +648,7 @@ cd '/usr/src/` + name + `/' paths := attr.Paths if source != nil { paths = slices.Concat(attr.Paths, []pkg.ExecPath{ - pkg.Path(AbsUsrSrc.Append( - name, - ), attr.Writable || wantsWrite, t.NewPatchedSource( + pkg.Path(AbsSource, attr.Writable || wantsWrite, t.NewPatchedSource( rn, source, !attr.Chmod && !wantsChmod, attr.Patches..., )), }) -- cgit v1.3.1