diff --git a/pkg/build/build.go b/pkg/build/build.go index eb99cc79..f29c3ea8 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -23,7 +23,6 @@ type Builder struct { eibBuildDir string combustionDir string combustionScripts []string - rpmBuildDir string rpmFileNames []string rpmSourceDir string } @@ -93,18 +92,12 @@ func (b *Builder) prepareBuildDir() error { b.eibBuildDir = b.buildConfig.BuildDir } b.combustionDir = filepath.Join(b.eibBuildDir, "combustion") - b.rpmBuildDir = filepath.Join(b.combustionDir, "rpms") err := os.MkdirAll(b.combustionDir, os.ModePerm) if err != nil { return fmt.Errorf("creating the build directory structure for combustion: %w", err) } - err = os.MkdirAll(b.rpmBuildDir, os.ModePerm) - if err != nil { - return fmt.Errorf("creating the build directory structure for rpms: %w", err) - } - return nil } diff --git a/pkg/build/rpm.go b/pkg/build/rpm.go index 3c57b491..03241c34 100644 --- a/pkg/build/rpm.go +++ b/pkg/build/rpm.go @@ -18,6 +18,7 @@ func (b *Builder) getRPMFileNames() error { for _, rpmFile := range rpms { b.rpmFileNames = append(b.rpmFileNames, rpmFile.Name()) } + return nil } @@ -29,7 +30,7 @@ func (b *Builder) copyRPMs() error { for _, rpm := range b.rpmFileNames { sourcePath := filepath.Join(b.rpmSourceDir, rpm) - destPath := filepath.Join(b.rpmBuildDir, rpm) + destPath := filepath.Join(b.combustionDir, rpm) sourceFile, err := os.Open(sourcePath) if err != nil { @@ -48,5 +49,6 @@ func (b *Builder) copyRPMs() error { return fmt.Errorf("copying rpm: %w", err) } } + return nil } diff --git a/pkg/build/rpm_test.go b/pkg/build/rpm_test.go index c9db9b01..87e07a0c 100644 --- a/pkg/build/rpm_test.go +++ b/pkg/build/rpm_test.go @@ -46,9 +46,9 @@ func TestCopyRPMs(t *testing.T) { // Verify require.NoError(t, err) - _, err = os.Stat(filepath.Join(builder.rpmBuildDir, "rpm1.rpm")) + _, err = os.Stat(filepath.Join(builder.combustionDir, "rpm1.rpm")) require.NoError(t, err) - _, err = os.Stat(filepath.Join(builder.rpmBuildDir, "rpm2.rpm")) + _, err = os.Stat(filepath.Join(builder.combustionDir, "rpm2.rpm")) require.NoError(t, err) }