installspec

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package installspec is the declarative KIDS install spec + validating loader (VSL T0a.3): the answers `v pkg install` feeds to a non-interactive KIDS install — the source distribution, the environment-check choice, the standard KIDS questions, and the device/queue. It is the JSON form of the install-spec.yaml in docs/kids-installation-automation.md §5. The standard answers map onto the KIDS XPDDIQ answer codes (XPO1/XPI1/XPZ1) used to suppress the prompts (see that doc, Tier A).

Index

Constants

View Source
const ResultMarker = "<<VPKG>>"

ResultMarker prefixes the script's machine-readable result lines on the principal device — the driver layer scans stdout for it. Format: `<<VPKG>>key=value`.

Variables

This section is empty.

Functions

func FinalInstallScript

func FinalInstallScript(name, header string, nPairs int) string

FinalInstallScript returns the constant-size install routine run after StageChunks has populated ^XTMP("VPKGI",…). nPairs is the expected staged-node count: the routine counts the staging global and refuses to install if it does not match (so a silently-truncated stage fails loudly instead of installing a partial package). header is the #9.7 install header (cosmetic).

func StageChunks

func StageChunks(pairs []kids.Pair, maxBytes int) []string

StageChunks renders the transport-global pairs as M routine bodies that populate the staging global ^XTMP("VPKGI",…). Each body is kept at or below maxBytes (a lone over-long SET is its own chunk), so no single staged routine is large enough to hit the driver's silent-truncation limit. The first body clears any stale staging global. Run each body in order; the global persists across the (stateless) driver processes, accumulating the whole tree.

func UninstallScript

func UninstallScript(name string, routines, paramDefs, files []string) string

UninstallScript returns M source that reverses an install (T0a.4): delete each routine (^%ZOSF("DEL") removes the .m + .o), each PARAMETER DEFINITION from #8989.51 (FileMan DIK by IEN — clears its "B" and subfile xrefs), each FileMan FILE (its DD, data global, and dict-of-files pointer — KIDS ships no generic file uninstall), and the #9.7 INSTALL and #9.6 BUILD entries via DIK. The monotonic #9.x / #8989.51 IEN counters are not rolled back (inherent to FileMan, not a leak).

func VerifyScript

func VerifyScript(name string, routines, paramDefs, files []string) string

VerifyScript returns M source that reports whether name is installed: the #9.7 INSTALL presence + status (piece 9; 3 = "Install Completed"), per routine whether it is loaded ($T probe), per PARAMETER DEFINITION whether it is present in #8989.51 (the "B" index), and per FileMan FILE whether its data dictionary installed (^DD(file,0) present). Each fact is a ResultMarker line.

Types

type Answers

type Answers struct {
	RebuildMenuTrees        bool `json:"rebuildMenuTrees"`
	InhibitLogons           bool `json:"inhibitLogons"`
	DisableOptionsProtocols bool `json:"disableOptionsProtocols"`
	DelayInstallMinutes     int  `json:"delayInstallMinutes"`
}

Answers are the four standard KIDS install questions.

func (Answers) XPDDIQ

func (a Answers) XPDDIQ() map[string]string

XPDDIQ maps the standard answers onto the KIDS XPDDIQ answer codes (set in the environment-check to suppress the prompts): XPO1 = rebuild menu trees, XPI1 = inhibit logons, XPZ1 = disable options/protocols. "0" = NO, "1" = YES.

type Device

type Device struct {
	Queue bool   `json:"queue"`
	At    string `json:"at,omitempty"` // ISO time when queued
}

Device selects the install output device / queueing.

type ExtraAnswer

type ExtraAnswer struct {
	PromptContains string `json:"promptContains"`
	Answer         string `json:"answer"`
}

ExtraAnswer answers a build-specific pre/post-install question by prompt match.

type Source

type Source struct {
	Kind string `json:"kind"` // "hfs" (Host File) | "packman" (MailMan message)
	Path string `json:"path"`
}

Source is the distribution location.

type Spec

type Spec struct {
	Name         string        `json:"name"`                       // INSTALL NAME, e.g. ZZSKEL*1.0*1
	Source       Source        `json:"source"`                     // where the distribution comes from
	EnvCheck     string        `json:"environmentCheck,omitempty"` // "run" (default) | "skip"
	Backup       bool          `json:"backupTransportGlobal,omitempty"`
	Answers      Answers       `json:"answers"`
	Device       Device        `json:"device"`
	ExtraAnswers []ExtraAnswer `json:"extraAnswers,omitempty"` // build-specific pre/post questions
}

Spec is one install spec (kids/<pkg>.install.json or passed inline).

func Load

func Load(path string) (*Spec, error)

Load reads + validates an install spec from a file.

func Parse

func Parse(data []byte) (*Spec, error)

Parse decodes an install spec from JSON (rejecting unknown fields) + validates.

func (*Spec) Validate

func (s *Spec) Validate() error

Validate checks the spec is usable for a non-interactive install.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL