Skip to content

Conversation

@vitorsavian
Copy link
Member

@vitorsavian vitorsavian commented Sep 25, 2025

This PR aims to refac the older rpm tool to match the pattern of the project and fix the problem that we have when we need to rerun the CI.

  • This new tool will have a new flag to rebuild the project if for some reason we need to rebuild the repo from the ground up.

  • It will delete the older repodata to clear older repodata files.

  • The tool will also verify if we already have a rpm with the same name, release and version and it will fail in this case

Signed-off-by: Vitor Savian <[email protected]>
Comment on lines +50 to +58
expect -c '
set timeout 60
spawn gpg --pinentry-mode loopback --force-v3-sigs --verbose --detach-sign --armor %s
expect -re "Enter passphrase.*"
send -- "%s\r"
expect eof
lassign [wait] _ _ _ code
exit $code
'
Copy link
Member

@brandond brandond Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels odd to have golang running a shell that runs expect. This seems... messy. Is there a golang native way to do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a way to sign with gpg, but for the rpm-sign I didn't.

Go apparently has a tool for gpg signs that is in the x/crypto package, but it's deprecated, I found this fork that is being maintained.

I'm trying right now to see if I can get the password without the expect in the rpm-sign step.

Comment on lines +480 to +496
cmd := exec.Command("rpm", "-qpi", localDest)
output, err := cmd.Output()
if err == nil {
lines := strings.Split(strings.TrimSpace(string(output)), "\n")

logrus.Info("=== RPM Package Info ===")
for _, line := range lines {
line = strings.TrimSpace(line)
if line != "" {
if strings.Contains(line, "Name") ||
strings.Contains(line, "Version") ||
strings.Contains(line, "Signature") ||
strings.Contains(line, "Build Date") {
logrus.Infof(" %s", line)
}
}
}
Copy link
Member

@brandond brandond Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no better interface to parsing package metadata? Are we doing anything with this data or are we basically just filtering and logging the output from the rpm query?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants