File tree Expand file tree Collapse file tree
alteriso/src/internal/archiso Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 "log/slog"
66 "os"
77 "path"
8+ "path/filepath"
89 "reflect"
910 "runtime"
1011
@@ -15,9 +16,20 @@ import (
1516 cp "github.com/otiai10/copy"
1617)
1718
18- func (p * Profile ) pacmanConf (outDir string ) error {
19+ func (p * Profile ) PacmanConf () string {
20+ if p .Config .PacmanConf == "" {
21+ return path .Join (p .Path , "pacman.conf" )
22+ }
23+ if filepath .IsAbs (p .Config .PacmanConf ) {
24+ return p .Config .PacmanConf
25+ } else {
26+ return path .Join (p .Path , p .Config .PacmanConf )
27+ }
28+ }
29+
30+ func (p * Profile ) copyPacmanConf (outDir string ) error {
1931 dst := path .Join (outDir , "pacman.conf" )
20- src := path . Join ( p . Path , "pacman.conf" )
32+ src := p . PacmanConf ( )
2133 if ! futils .Exists (src ) {
2234 return errors .Newf ("pacman.conf file does not exist in %s" , p .Path )
2335 }
@@ -102,7 +114,7 @@ func (p *Profile) GenArchisoProfile(outDir string) error {
102114 p .copyInjecter ,
103115 p .copyAirootfs ,
104116 p .generatePackagesFile ,
105- p .pacmanConf ,
117+ p .copyPacmanConf ,
106118 p .generateInfoFile ,
107119 }
108120
You can’t perform that action at this time.
0 commit comments