Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't recheck runtime architecture #144

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var buildCmd = &cobra.Command{
extraMockArgs := impl.MockExtraCmdlineArgs{
NoCheck: noCheck,
}
return impl.Build(repo, pkg, defaultArch(), extraCreateSrpmArgs, extraMockArgs)
return impl.Build(repo, pkg, defaultArch, extraCreateSrpmArgs, extraMockArgs)
},
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
"strings"
)

func defaultArch() string {
var defaultArch = func() string {
var output []byte
var err error
if output, err = exec.Command("arch").Output(); err != nil {
panic(err)
}
return strings.TrimRight(string(output), "\n")
}
}()

// SetViperDefaults sets defaults for viper configs
func SetViperDefaults() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var mockCmd = &cobra.Command{
func init() {
mockCmd.Flags().StringP("repo", "r", "", "Repository name (OPTIONAL)")
mockCmd.Flags().StringP("package", "p", "", "package name (OPTIONAL)")
mockCmd.Flags().StringP("target", "t", defaultArch(), "target architecture for the rpmbuild (OPTIONAL)")
mockCmd.Flags().StringP("target", "t", defaultArch, "target architecture for the rpmbuild (OPTIONAL)")
mockCmd.Flags().Bool("only-create-cfg", false, "Just create mock configuration, don't run mock (OPTIONAL)")
mockCmd.Flags().Bool("nocheck", false, "Pass --nocheck to rpmbuild (OPTIONAL)")
rootCmd.AddCommand(mockCmd)
Expand Down
2 changes: 1 addition & 1 deletion cmd/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func runMockAndVerify(t *testing.T, destDir string,
quiet bool,
expectedFiles []ExpectedRpmFile,
expectedTags map[string]string) {
args := []string{"mock", "--target", defaultArch(), "--repo", repoName}
args := []string{"mock", "--target", defaultArch, "--repo", repoName}
testutil.RunCmd(t, rootCmd, args, quiet, true)
for _, expectedFile := range expectedFiles {
fileAbsPath := filepath.Join(destDir, "RPMS",
Expand Down
Loading