mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 02:24:21 +01:00
Substring version checks admitted stale agents and dependency literals, while ARMv6 executables could select ARMv7 updates. Share compiler target and exact release identity admission across producers, downloads and activation, and keep validated local downloads bound to their open file descriptor. Cover bounded runtime probes, failure atomicity, canonical executable formats, ARM emulation and saved-state installer repair boundaries. Retain the installed ARM fleet and physical-device gap, and leave release qualification open.
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
// verify-agent-release checks copied agent artifacts before release packaging.
|
|
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"io"
|
|
"os"
|
|
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/agentidentity"
|
|
)
|
|
|
|
func verify(args []string, stderr io.Writer) error {
|
|
flags := flag.NewFlagSet("verify-agent-release", flag.ContinueOnError)
|
|
flags.SetOutput(stderr)
|
|
version := flags.String("version", "", "exact release version")
|
|
if err := flags.Parse(args); err != nil {
|
|
return err
|
|
}
|
|
if _, err := agentidentity.Version(*version); err != nil {
|
|
return err
|
|
}
|
|
pairs := flags.Args()
|
|
if len(pairs) == 0 || len(pairs)%2 != 0 {
|
|
return fmt.Errorf("expected target and executable path pairs")
|
|
}
|
|
for index := 0; index < len(pairs); index += 2 {
|
|
target, path := pairs[index], pairs[index+1]
|
|
if target == "" {
|
|
return fmt.Errorf("empty executable target")
|
|
}
|
|
if err := agentidentity.Validate(path, *version, target); err != nil {
|
|
return fmt.Errorf("%s (%s): %w", path, target, err)
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func main() {
|
|
if err := verify(os.Args[1:], os.Stderr); err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
}
|