arrans_overlay_workflow_builder

package module
v0.1.50 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: GPL-2.0 Imports: 34 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

arrans_overlay_workflow_builder_generator

This is a generator for some of the github actions in my gentoo overlay's workflow directory. - Which check for updates to various applications then generates ebuilds for them.

Installation

To install this application, run the following command:

go install github.com/arran4/arrans_overlay_workflow_builder@latest

This will install the arrans_overlay_workflow_builder binary in your $GOPATH/bin directory.

The purpose of this application is (currently) to quickly generate binary ebuild files for 2 use cases:

  • Github repositories with AppImage binary releases
  • Github repositories with normal elf binaries releases (such as those generated with goreleaser)

The general idea is that this is to be used to quickly get specific binary apps.

Some considerations:

  • alternative executables (such as with hugo and it's extended version which comes up as a use flag to switch between them.)
  • manual pages
  • documents
  • shell completion scripts (bash, zsh, fish and powershell)

Usage:

The basic flow of using the app is that:

  • Find a list of github URLs for applicable programs that you want to generate ebuilds for in your overlay
  • Feed the URL to the appropriate config generation step (See the appropriate section below)
  • Modify the configuration as appropriate
  • Run the generate workflows step
  • Install the ./output/*.yaml files in your overlay's github repo's ./github/workflows directory
  • Commit and push. Staggered to 1 at a time with a 1-minute wait between each commit & push.
  • Watch the ebuilds (or errors) come through
  • Install your tools

Config generation

The configuration files sections look as follows: (See mine here for more)

For AppImages released on GitHub:

Type Github AppImage Release
GithubProjectUrl https://github.com/anyproto/anytype-ts
Category app-text
EbuildName anytype-ts-appimage
Description Official Anytype client for MacOS, Linux, and Windows
Workaround Semantic Version Prerelease Hack 1
Homepage https://anytype.io
License Other
ProgramName Anytype
DesktopFile anytype.desktop
Icons hicolor-apps root
Dependencies sys-libs/glibc sys-libs/zlib
Binary amd64=>Anytype-${VERSION}.AppImage > Anytype.AppImage

For other binary files being released on GitHub:

Type Github Binary Release
GithubProjectUrl https://github.com/twpayne/chezmoi
EbuildName chezmoi-bin
Category app-admin
Description Manage your dotfiles across multiple diverse machines, securely.
Homepage https://www.chezmoi.io/
License MIT License
Workaround Programs as Alternatives => amd64:glibc amd64:loong64 arm64:android ppc64:le
ProgramName android
Binary arm64=>chezmoi_${VERSION}_android_arm64.tar.gz > chezmoi > chezmoi
ProgramName chezmoi
Dependencies sys-libs/glibc
Binary amd64=>chezmoi_${VERSION}_linux-musl_amd64.tar.gz > chezmoi > chezmoi
Binary arm=>chezmoi_${VERSION}_linux_arm.tar.gz > chezmoi > chezmoi
Binary arm64=>chezmoi_${VERSION}_linux_arm64.tar.gz > chezmoi > chezmoi
Binary ppc64=>chezmoi_${VERSION}_linux_ppc64.tar.gz > chezmoi > chezmoi
Binary riscv=>chezmoi_${VERSION}_linux_riscv64.tar.gz > chezmoi > chezmoi
Binary s390=>chezmoi_${VERSION}_linux_s390x.tar.gz > chezmoi > chezmoi
Binary x86=>chezmoi_${VERSION}_linux_i386.tar.gz > chezmoi > chezmoi
ProgramName glibc
Dependencies sys-libs/glibc
Binary amd64=>chezmoi_${VERSION}_linux-glibc_amd64.tar.gz > chezmoi > chezmoi
ProgramName le
Binary ppc64=>chezmoi_${VERSION}_linux_ppc64le.tar.gz > chezmoi > chezmoi
ProgramName loong64
Binary amd64=>chezmoi_${VERSION}_linux_loong64.tar.gz > chezmoi > chezmoi

Ideally you would have 1 file, with multiple of these entries in it. See mine here

Config Generation for an AppImage binary in a GitHub Release

There are 2 commands to generate the AppImage section, one outputs to STDOUT and the other outputs to a specified config file

STDOUT version:

You need to provide a github URL as such:

go run github.com/arran4/arrans_overlay_workflow_builder@latest config view github-release-appimage -github-url https://github.com/anyproto/anytype-ts
Append to config file version

You will need to provide the GitHub URL for the target project, and optionally the input file which defaults to input.config

go run github.com/arran4/arrans_overlay_workflow_builder@latest config add github-release-appimage -github-url https://github.com/anyproto/anytype-ts -to input.config
Config Generation for a binary in a GitHub Release

There are 2 commands to generate the AppImage section, one outputs to STDOUT and the other outputs to a specified config file

STDOUT version:

You need to provide a github URL as such:

go run github.com/arran4/arrans_overlay_workflow_builder@latest config view github-release-binary -github-url https://github.com/goreleaser/goreleaser
Append to config file version

You will need to provide the GitHub URL for the target project, and optionally the input file which defaults to input.config

go run github.com/arran4/arrans_overlay_workflow_builder@latest config add github-release-binary -github-url https://github.com/goreleaser/goreleaser -to input.config

ebuild Generator GitHub Action Generator

To generate the workflows from an input.config file run:

go run github.com/arran4/arrans_overlay_workflow_builder@latest generate workflows -input-file input.config

Look in the output/ directory for the generated file(s) these should be copied to your github overlay's ./.github/workflows directory after being modified. Remember to add: Category with the appropriate Gentoo ebuild category.

Configuration Variables

When defining URLs or filenames in directives like Binary, Custom Download URL, or DownloadBaseUrl, you can use the following variables, which the generator will automatically replace with appropriate bash variables during workflow generation:

  • ${TAG} - Replaced by ${tag} in the generated bash script. Used to represent the original release tag string.
  • ${VERSION} - Replaced by ${version} or \${PV} (in SRC_URI), depending on the context. Used to represent the version string (e.g. 1.2.3).
  • ${GITHUB_OWNER} - Replaced by ${{ env.github_owner }}.
  • ${GITHUB_REPO} - Replaced by ${{ env.github_repo }}.
  • ${KEYWORD} - Replaced by \${ARCH} in the ebuild SRC_URI.

Additional options and work-arounds

There are a couple workarounds. At the moment the application assumes semantic versions, and using GitHub releases. Some will be automatically detected, some won't.

In some cases, multiple workarounds are supported.

Version doesn't have a v preceding it:

The program will automatically detect this.

Add Workaround Semantic Version Without V to the config after License

Version is semantic and doesn't match Gentoo version requirements

This mostly impacts projects that have releases like alpha beta etc. The program will automatically detect this.

Add Workaround Semantic Version Prerelease Hack 1 to the config after License

Multiple applications are in one repo using a tag prefix to distinguish between them

The program will NOT detect this, you will have to craft a config to match this, or attempt to use the appropriate commandline flag.

The work around is:

Workaround Tag Prefix => prefix-

Such as in Ente's Auth:

Type Github AppImage Release
GithubProjectUrl https://github.com/ente-io/ente
EbuildName ente-auth-appimage
Description Ente's 2FA solution
Homepage https://ente.io/blog/auth/
License GNU Affero General Public License v3.0
Workaround Semantic Version Prerelease Hack 1
Workaround Tag Prefix => auth-
ProgramName ente_auth
DesktopFile ente_auth.desktop
Icons hicolor-apps root
Dependencies sys-libs/glibc sys-libs/zlib
Binary amd64=>ente-${TAG}-x86_64.AppImage > ente_auth.AppImage

The flag for this is -tag-prefix used as such:

go run github.com/arran4/arrans_overlay_workflow_builder@latest config view github-release-appimage -github-url https://github.com/anyproto/anytype-ts -tag-prefix auth-

Due to assumption in the program you WILL have to modify the EbuildName, Description, Homepage and Category at minimum.

The application uses some other system for versioning

This is not really supported but you can manually specify the tag to base the configuration off with -version-tag this is used in cases such as: https://github.com/probonopd/go-appimage itself, as currently it uses a snapshot system where the snapshot tag is continuous which is hard to work with.

If it was working this is what it would look like.

Type Github AppImage
GithubProjectUrl https://github.com/probonopd/go-appimage
EbuildName go-appimage
Description Go implementation of AppImage tools
License MIT License
Workaround Nightly Build in 'Continuous' With Build Number as version with offset '646'
ProgramName appimaged-838
DesktopFile appimaged.desktop
InstalledFilename appimaged-838.AppImage
ReleasesFilename amd64=>appimaged-838-x86_64.AppImage
ReleasesFilename arm=>appimaged-838-armhf.AppImage
ReleasesFilename arm64=>appimaged-838-aarch64.AppImage
ReleasesFilename x86=>appimaged-838-i686.AppImage
ProgramName appimagetool-838
DesktopFile appimagetool.desktop
InstalledFilename appimagetool-838.AppImage
ReleasesFilename amd64=>appimagetool-838-x86_64.AppImage
ReleasesFilename arm=>appimagetool-838-armhf.AppImage
ReleasesFilename arm64=>appimagetool-838-aarch64.AppImage
ReleasesFilename x86=>appimagetool-838-i686.AppImage
ProgramName mkappimage-838
DesktopFile mkappimage.desktop
InstalledFilename mkappimage-838.AppImage
ReleasesFilename amd64=>mkappimage-838-x86_64.AppImage
ReleasesFilename arm=>mkappimage-838-armhf.AppImage
ReleasesFilename arm64=>mkappimage-838-aarch64.AppImage
ReleasesFilename x86=>mkappimage-838-i686.AppImage

Please note: 838 should be the ${TAG} and this removed from the program name. '646' is specified as though we could grab the current build number, which we don't. This will remain unsupported for the mean time.

Notes

  • The program has been extended without being refactored beyond its original purpose, I am keen to get someone who has a better design to weigh in, create a PR, or a discussion
  • this tool is for VERY specific use cases. You will have to be prepared to modify it for yours if not included
  • This program is provided under the "good enough for my itch" philosophy. You're welcome to fork, create pull requests and extend as needed.
  • I will be concerned mostly with the apps of my interest, the list can be found here: https://github.com/arran4/arrans_overlay/blob/main/current.config
  • The entire main.go is to completely rebuilt with generated code. But until then do what is necessary but in a way which is compatible with that idea
  • I am considering generating more files such as the metadata.xml file too

Custom Web Extractors (Web AppImage / Web Binary)

For non-GitHub releases, the generator supports the Web AppImage and Web Binary types. By default, these rely on HTML scraping or static URLs, but can be highly customized to extract dynamic versions and downloads from index pages, JSON APIs, or RSS feeds.

Pipeline Directives

Instead of using Bash-dependent tools, you can use the built-in python extraction pipeline. You define pipelines in your configuration for version parsing and download resolution.

  • VersionPipeline (Web Binary only) - A chained command string used to extract all release versions from the web. Web AppImage derives versions dynamically via AppImage artifact names or CustomVersionSource.
  • DownloadPipeline - A chained command string used to extract the specific binary download URL for a given tag.
  • Download Redirect (AppImages only) - Resolves AppImage URLs by following HTTP 302 redirects natively, bypassing HTML scraping.
  • DownloadRegex (Legacy fallback) - Equivalent to get(URL) | html_links | regex(PATTERN) | last.
  • DownloadXPath (Legacy fallback) - Not recommended, use VersionPipeline and DownloadPipeline instead.
Pipeline Syntax

The extraction pipeline supports piping commands (|) to incrementally parse data (like jq or sed, but using python standard libraries).

Available commands:

  • get(url) - Fetches data from a URL using urllib. Note: URL should be plain text, variables like ${TAG} are injected.
  • rss or atom - Parses XML and returns a list of items/entries.
  • json(path.to.key) - Parses JSON data and navigates down to the specified key.
  • html_links - Extracts href attributes from HTML <a> tags and automatically resolves them against the fetching URL using urljoin.
  • regex(pattern) - Applies a regex pattern to extract a matching group. If applied to a list, it filters the list.
  • link - Extracts the <link> target (from RSS/Atom).
  • url.basename - Extracts the file path basename from a URL string.
  • replace('search', 'replace') - Simple string replacement using ast.literal_eval for parsing tuple arguments.
  • xml - Parses XML inputs natively for xpath extraction.
  • xpath(query) - Executes standard ElementTree xpath subset queries on parsed XML.
  • first / last - Grabs the first or last element of a list. When an ambiguous count matches, exactly 1 element is selected depending on orientation.
  • exactly_one / single - Selects exactly one element. Throws a clear fatal error if ambiguous (multiple matches) or missing (zero matches) are found, enforcing a strict cardinality constraint instead of selecting an arbitrary element.
Pipeline Substitutions

The pipeline supports native templating substitutions during workflow execution for precise resource fetching. Note that substitutions are heavily restricted depending on configuration type to enforce correct lifecycle resolution:

  • ${VERSION}: Supported unconditionally in Web Binary to access the current mapped iteration version. In Web AppImage, it is only supported if CustomVersionSource is explicitly specified.
  • ${TAG}: Supported natively in Web Binary iteration loops. Unsupported in Web AppImage pipeline generation.
  • ${RELEASE_FILENAME}: Replaced with the evaluated architecture-specific resource filename mapping within ExternalResources. Unsupported in Web AppImage generation.
Example: RSS Feed Extraction

For a project updating its versions via an RSS feed, you can easily extract the version by chaining get, rss, first and regex.

Type Web Binary
EbuildName example-bin
Category app-misc
Description Example using Web Binary and RSS extraction
Homepage https://example.com
License MIT
DownloadBaseUrl https://example.com/downloads/example-${VERSION}.tar.gz
VersionPipeline get(https://example.com/feed.xml) | rss | first | link | url.basename | regex(v(.*))
ProgramName example
Binary amd64=>example-${VERSION}.tar.gz > example > example
Example: Strict Ordinary-HTTP HTML Extraction

For a static site where you are extracting versions from the index path strings, it is highly recommended to use exactly_one to immediately catch regressions instead of quietly returning arbitrary components from upstream HTML changes. If there are no matches, it will fail gracefully with exactly_one/single expected 1 item, got 0. If there are multiple releases published simultaneously, it will fail with exactly_one/single expected 1 item, got X.

Type Web Binary
EbuildName which-browser-bin
Category www-client
Description Example which_browser implementation
Homepage https://which-browser.site
License MIT
DownloadBaseUrl https://which-browser.site/downloads/v${VERSION}/
VersionPipeline get(https://which-browser.site/downloads/) | html_links | regex(which_browser-([^/]+)-linux[.]deb$) | exactly_one
DownloadPipeline get(https://which-browser.site/downloads/) | html_links | regex(.*/downloads/v[^/]+/which_browser-[^/]+-linux[.]deb$) | exactly_one
Workaround Version Replacement => s/\+/_p/g
ProgramName which-browser
Binary amd64=>which_browser-${TAG}-linux.deb > which_browser > which-browser

Testing

This repository includes a deterministic, hermetic smoke test suite in smoke_test.go. The test harness renders the actual workflow templates, parses the yaml, substitutes github environment bindings, and executes the generated bash scripts natively within a stubbed shell context ($PATH is overridden). This proves that the templated paths function accurately from ebuild synthesis up through metadata and commit generation. When adding new template workflows or complicated edge conditions, consider adding a new scenario block to the smoke harness.

Batch workflow output safety and failure recovery are documented in Batch workflow publication.

Global Flags

  • --gentoo-authors / --generated-ebuild-gentoo-authors: Emit Gentoo Authors copyright header instead of generic SPDX MIT (default false).
  • --source-license / --generated-ebuild-source-license: Source-level license to emit in headers (e.g., MIT) (default "").

Configuration directives

  • GentooAuthors <boolean> / GeneratedEbuildGentooAuthors <boolean>: Toggles the generated source header copyright attribution for a single package.
    • If unset, inherits the global --gentoo-authors default.
    • If explicitly true, generates Gentoo copyright + GPL-2 distribution line.
    • If explicitly false, generates an SPDX-License-Identifier string without Gentoo attribution.
  • SourceLicense <string> / GeneratedEbuildSourceLicense <string>: Explicit license string for the source header (e.g., Apache-2.0).
    • If GentooAuthors is off and this is unset, defaults to MIT.
    • Overrides the GPL-2 distribution line if GentooAuthors is on but an explicit source license is set.

Contributing and engineering guidance

Before changing public behaviour, tests, parsers or generation rules, see repository-specific agent/contributor guidance. The applicable rationale is collected in Suggested Coding Standards; this is selective guidance, not a blanket rewrite policy. The standards adoption issue tracks the required implementation/test audit separately from documentation.

Real-g2 integration boundary

CI installs released g2 v0.0.107 and verifies the executable's embedded Go module version and release version stamp before running TestRealG2_*. A missing dependency fails CI; a missing local executable explicitly skips these integration tests. An installed executable with a different version (including a development build) fails. The official release includes +dirty in its module version; that release suffix is accepted. Install the released executable rather than substituting a mock.

These tests execute generated updater scripts against controlled HTTP assets, then run real g2 cache generation and lint. Their disposable overlay contains synthetic license files and minimal eclass stubs. They establish generated metadata/parser compatibility, not real Gentoo license compliance, full eclass compatibility, Portage metadata evaluation, or fetch/build/install validation. Package-license normalization remains #173; ebuild/Manifest publication remains #155. The MIT/SPDX source-header policy is preserved. PG0802 (the generated provenance comment's width) is explicitly disabled in these fixture lint runs; other source width assertions permit only a single indivisible SRC_URI URL that exceeds the available width, without exempting other text on the line.

Metadata cache generation and master repository context

Generated updater workflows include a Generate md5-cache step before Lint output. Metadata cache generation complies with PMS Chapter 14 and g2 authoritative reconciliation:

  • Ordinary binary packages (which do not inherit external eclasses) authoritatively generate and verify metadata/md5-cache directly on standard CI runners without requiring master repositories or Portage.
  • Multi-master repositories (e.g., masters = gentoo guru hyproverlay in metadata/layout.conf) are parsed and resolved against available local paths:
    • Environment mappings via G2_MASTER_REPOS (comma-separated name=path pairs).
    • Portage configuration via PORTAGE_REPOS_CONF or /etc/portage/repos.conf.
    • Standard repository directories in /var/db/repos/<name>, ${G2_MASTER_REPO_DIR}/<name>, ../<name>, or ${RUNNER_TEMP}/repos/<name>.
  • Missing master repositories and Portage evaluation in CI:
    • When an ebuild inherits external eclasses (e.g., AppImages with desktop files inheriting xdg-utils) and the runner lacks master repository trees, cache generation is skipped with an explicit notice per G2's CI policy (Authoritative md5-cache generation requires unavailable master repository context (...)). No partial, unverified, or fabricated cache files are staged or committed.
    • When master repositories are provided but an eclass contains PMS control flow requiring dynamic Portage evaluation (such as case ${EAPI} in in xdg-utils.eclass), the step detects whether portageq is available. If unavailable, it skips cache generation with an explicit notice rather than producing non-authoritative metadata.
    • Genuine ebuild defects, Manifest mismatches, or missing dependencies still fail closed under g2 lint -fail-severity error and prevent publication.
Ebuild deduplication and Manifest consistency lifecycle

Generated updater workflows include an Ebuild deduplicate step before Generate md5-cache and Lint output. Package deduplication and Manifest reconciliation maintain transactional consistency:

  • Transactional snapshot: Before invoking deduplication, the workflow snapshots the package directory and matching metadata/md5-cache / metadata/cache entries to an isolated temporary backup directory.
  • Authoritative deduplication: For packages where all referenced distfiles can be evaluated authoritatively (such as binary packages with static SRC_URI), g2 ebuild deduplicate removes superseded ebuilds, their obsolete cache entries, and prunes obsolete distfiles from Manifest.
  • Uncertain source fallback and consistency preservation: When a package inherits external eclasses (e.g., AppImages inheriting xdg-utils), G2's source evaluation without full Portage runtime context treats SRC_URI as uncertain. g2 ebuild deduplicate removes older duplicate ebuilds and their cache entries but skips CleanManifest, which would leave orphaned DIST entries in Manifest and subsequently fail g2 lint -fail-severity error. The workflow detects skipped cleanup and unreferenced distfiles (g2 manifest verify), and restores both the package directory and cache entries from the backup snapshot. Both older and newer ebuilds are retained along with their valid distfiles and cache entries, emitting a GitHub Actions notice: ::notice title=Deduplication deferred::Manifest cleanup was skipped because directory contains uncertain ebuilds; retaining older ebuilds to maintain Manifest consistency.
  • Fail-closed error handling: If g2 ebuild deduplicate or g2 manifest verify fails (exits non-zero), both the package directory and cache entries are restored from the snapshot before failing closed, ensuring that no partially deleted or inconsistent package state is committed.

Documentation

Index

Constants

View Source
const (
	DefaultCategory = "app-misc"
	DefaultLicense  = "unknown"
)

Variables

View Source
var (
	DefaultDesktopFileEnabled = false
)

Functions

func AppendToConfigurationFile

func AppendToConfigurationFile(config string, ic *InputConfig) error

func CmdOneshotGithubReleaseAppImage

func CmdOneshotGithubReleaseAppImage(gitRepo, tagOverride, tagPrefix, outputDir, version string, opts ...any) error

func CmdOneshotGithubReleaseBinary

func CmdOneshotGithubReleaseBinary(gitRepo, tagOverride, tagPrefix, outputDir, version string, opts ...any) error

func CmdOneshotGithubReleaseCmakeSource added in v0.1.27

func CmdOneshotGithubReleaseCmakeSource(githubUrl string, selectedVersionTag string, tagPrefix string, outputDir string, version string, opts ...any) error

func CmdOneshotWebAppImage

func CmdOneshotWebAppImage(pageURL, matchExpr, linkExt, outputDir, version string, opts ...any) error

CmdOneshotWebAppImage writes the derived configuration to stdout and renders a workflow.

func ConfigAddAppImageGithubReleases

func ConfigAddAppImageGithubReleases(toConfig, gitRepo, tagOverride, tagPrefix string) error

func ConfigAddBinaryGithubReleases

func ConfigAddBinaryGithubReleases(toConfig, gitRepo, tagOverride, tagPrefix string) error

func ConfigAddCmakeSourceGithubReleases added in v0.1.27

func ConfigAddCmakeSourceGithubReleases(configFile string, githubUrl string, selectedVersionTag string, tagPrefix string) error

func ConfigAddWebAppImage

func ConfigAddWebAppImage(toConfig, pageURL, matchExpr, linkExt string) error

ConfigAddWebAppImage appends a generated configuration entry to the provided file.

func ConfigViewAppImageGithubReleases

func ConfigViewAppImageGithubReleases(gitRepo, tagOverride, tagPrefix string) error

func ConfigViewBinaryGithubReleases

func ConfigViewBinaryGithubReleases(gitRepo, tagOverride, tagPrefix string) error

func ConfigViewCmakeSourceGithubReleases added in v0.1.27

func ConfigViewCmakeSourceGithubReleases(githubUrl string, selectedVersionTag string, tagPrefix string) error

func ConfigViewWebAppImage

func ConfigViewWebAppImage(pageURL, matchExpr, linkExt string) error

ConfigViewWebAppImage prints the derived configuration for inspection.

func DoubleMapStringer

func DoubleMapStringer(sb *strings.Builder, key string, valueMap map[string]map[string][]string)

func GenerateGithubWorkflows

func GenerateGithubWorkflows(file, outputDir, version string, ops ...any) error

func GenerateGithubWorkflowsFromInputConfigs

func GenerateGithubWorkflowsFromInputConfigs(file string, inputConfigs []*InputConfig, outputDir, version string, ops ...any) error

GenerateGithubWorkflowsFromInputConfigs renders and publishes GitHub Actions workflows for multiple input configurations.

Publication safety contract (#180):

  1. Validation & Pre-render Phase: All workflow templates are rendered, normalized, and validated in-memory before any files are created or modified on disk. If any input configuration or template execution fails, no files are written and existing output files remain completely untouched.
  2. Publication Phase: Outputs are written to outputDir. If an I/O error occurs during publication, best-effort rollback restores previously modified files to their original contents and removes newly created partial files. Recovery includes the failing destination, restores contents and modes, removes new files/directories, and reports every failed recovery operation. This is best-effort rollback, not atomic publication: concurrent readers can see intermediate files. Concurrent writers are unsupported; crashes, SIGKILL, power loss and rollback I/O failures can leave partial state. No fsync or crash-recovery journal is provided. This is unrelated to package-state #155.

func GenerateWordMeanings

func GenerateWordMeanings(gitRepo string, versions []string, tags []string) map[string]*FilenamePartMeaning

func GroupAndSort

func GroupAndSort(wordMap map[string]*FilenamePartMeaning) map[string][]*GroupedFilenamePartMeaning

func IndentContent added in v0.1.36

func IndentContent(indent, content string) string

func MapDoubleStringer

func MapDoubleStringer(sb *strings.Builder, key string, valueMap map[string][][]string)

func MapStringer

func MapStringer(sb *strings.Builder, key string, valueMap map[string][]string)

func NewInputConfigurationFromRepo

func NewInputConfigurationFromRepo(gitRepo, tagOverride, tagPrefix, ebuildSuffix, sourceType string) (string, *InputConfig, []string, []string, *github.RepositoryRelease, *InputConfig, error)

func ParseWorkflowTemplates

func ParseWorkflowTemplates() (*template.Template, error)

func ReadDependencies

func ReadDependencies(file string, program *Program) ([]string, error)

func ReadDependenciesFromReader

func ReadDependenciesFromReader(program *Program, f io.ReaderAt, unknownSymbols []string) ([]string, error)

func ShellEchoContent added in v0.1.36

func ShellEchoContent(content string) string

func ShellEchoEvalContent added in v0.1.36

func ShellEchoEvalContent(content string) string

func ShellSingleQuote added in v0.1.46

func ShellSingleQuote(content string) string

ShellSingleQuote produces one literal Bash argument, preserving dollar signs, backticks, backslashes and embedded single quotes without expansion.

Types

type AppImageFileInfo

type AppImageFileInfo struct {
	// Core properties
	// Gentoo keyword
	Keyword string
	OS      string
	// Generally msvc, gnu, musl, etc
	Toolchain string
	// Like tar, or zip, also a bit of bz2, and gz but not proper "containers", later replaced by the container of the
	// contained file
	Container   string
	ProgramName string

	// Compiled only
	Containers []string
	// App image filename, not container
	Filename string

	// Relevant restraint + identification
	AppImage bool

	// Identification
	Version     bool
	Tag         bool
	ProjectName bool

	// Match rules
	SuffixOnly       bool
	CaseInsensitive  bool
	KeywordDefaulted bool
	// Required for the URL only atm:
	ReleaseAsset *github.ReleaseAsset
	// Unmatched
	Unmatched []string

	OriginalFilename string
	Installer        bool
	// contains filtered or unexported fields
}

func (*AppImageFileInfo) CompileMeanings

func (base *AppImageFileInfo) CompileMeanings(input []*FilenamePartMeaning) (*AppImageFileInfo, bool)

func (*AppImageFileInfo) GetInformationFromAppImage

func (appImage *AppImageFileInfo) GetInformationFromAppImage(repoName string, ic *InputConfig) error

func (*AppImageFileInfo) SearchArchiveForAppImageFiles

func (container *AppImageFileInfo) SearchArchiveForAppImageFiles() ([]*AppImageFileInfo, error)

type AppImageFiles

type AppImageFiles []*AppImageFileInfo

func (AppImageFiles) ExtractAppImagesAndContainers

func (base AppImageFiles) ExtractAppImagesAndContainers(wordMap map[string][]*GroupedFilenamePartMeaning) ([]*AppImageFileInfo, []*AppImageFileInfo)

type BinaryReleaseFileInfo

type BinaryReleaseFileInfo struct {
	// Core properties
	// Gentoo keyword
	Keyword string
	OS      string
	// Generally msvc, gnu, musl, etc
	Toolchain string
	// Like tar, or zip, also a bit of bz2, and gz but not proper "containers", later replaced by the container of the
	// contained file
	ProgramName      string
	OriginalFilename string
	ArchivePathname  string
	InstalledName    string
	ExecutableBit    bool
	Installer        bool
	Document         bool
	AppImage         bool
	Container        *BinaryReleaseFileInfo
	DirectoryName    string

	// Compiled only
	Containers []string
	// Binary filename, not container
	Filename string

	// Relevant restraint + identification
	Binary              bool
	ShellCompletionFile bool
	ShellScript         string

	// Identification
	Version     bool
	Tag         bool
	ProjectName bool
	ManualPage  int

	// Match rules
	SuffixOnly       bool
	CaseInsensitive  bool
	KeywordDefaulted bool
	// Required for the URL only atm:
	ReleaseAsset *github.ReleaseAsset
	// Unmatched
	Unmatched []string
	// contains filtered or unexported fields
}

func (*BinaryReleaseFileInfo) CheckMaybe

func (brfi *BinaryReleaseFileInfo) CheckMaybe() (bool, error)

func (*BinaryReleaseFileInfo) CompileMeanings

func (brfi *BinaryReleaseFileInfo) CompileMeanings(input []*FilenamePartMeaning, container *FileTypes) (*BinaryReleaseFileInfo, bool)

func (*BinaryReleaseFileInfo) FetchContent

func (brfi *BinaryReleaseFileInfo) FetchContent() (string, error)

func (*BinaryReleaseFileInfo) Free

func (brfi *BinaryReleaseFileInfo) Free()

func (*BinaryReleaseFileInfo) SearchArchiveForFiles

func (brfi *BinaryReleaseFileInfo) SearchArchiveForFiles() ([]*BinaryReleaseFileInfo, error)

func (*BinaryReleaseFileInfo) UnmatchedOkay

func (brfi *BinaryReleaseFileInfo) UnmatchedOkay() bool

type BinaryReleaseFiles

type BinaryReleaseFiles []*BinaryReleaseFileInfo

func (BinaryReleaseFiles) FindFiles

func (bases BinaryReleaseFiles) FindFiles(wordMap map[string][]*GroupedFilenamePartMeaning, root *FileTypes) *FileTypes

type ExternalResource

type ExternalResource struct {
	Keyword         string
	ReleaseFilename string
	Archived        bool
}

type ExternalResourceKeywordExtended

type ExternalResourceKeywordExtended struct {
	ExternalResource   *ExternalResource
	MustHaveUseFlags   []string
	MustntHaveUseFlags []string
}

func (*ExternalResourceKeywordExtended) Archived

func (erke *ExternalResourceKeywordExtended) Archived() bool

func (*ExternalResourceKeywordExtended) Keyword

func (erke *ExternalResourceKeywordExtended) Keyword() string

func (*ExternalResourceKeywordExtended) ReleaseFilename

func (erke *ExternalResourceKeywordExtended) ReleaseFilename() string

type FileTypes

type FileTypes struct {
	CompressedArchives       []*BinaryReleaseFileInfo
	CompressedArchiveContent map[string]*FileTypes
	Binaries                 []*BinaryReleaseFileInfo
	ManualPages              []*BinaryReleaseFileInfo
	ShellCompletionScripts   []*BinaryReleaseFileInfo
	Root                     *FileTypes
	MightBeBinaries          []*BinaryReleaseFileInfo
	Documents                []*BinaryReleaseFileInfo
}

func (*FileTypes) AllBinaries

func (t *FileTypes) AllBinaries() (result []*BinaryReleaseFileInfo)

func (*FileTypes) AllDocuments

func (t *FileTypes) AllDocuments() (result []*BinaryReleaseFileInfo)

func (*FileTypes) AllManualPages

func (t *FileTypes) AllManualPages() (result []*BinaryReleaseFileInfo)

func (*FileTypes) AllShellCompletionScripts

func (t *FileTypes) AllShellCompletionScripts() (result []*BinaryReleaseFileInfo)

func (*FileTypes) CheckMaybes

func (t *FileTypes) CheckMaybes() error

func (*FileTypes) CountBinaries

func (t *FileTypes) CountBinaries() int

func (*FileTypes) CountCompressedArchives

func (t *FileTypes) CountCompressedArchives() int

func (*FileTypes) CountMaybeBinaries

func (t *FileTypes) CountMaybeBinaries() int

func (*FileTypes) Free

func (t *FileTypes) Free()

type FilenamePartMeaning

type FilenamePartMeaning struct {
	// Core properties
	// Gentoo keyword
	Keyword string
	OS      string
	// Generally msvc, gnu, musl, etc
	Toolchain string
	// Like tar, or zip, also a bit of bz2, and gz but not proper "containers", later replaced by the container of the
	// contained file
	Container string
	// The separator -_-
	Separator bool
	Captured  string

	// Relevant restraint + identification
	AppImage            bool
	Installer           bool
	Document            bool
	ShellCompletionFile bool
	ShellScript         string
	ManualPage          int

	// Identification
	Version     bool
	Tag         bool
	ProjectName bool
	Folder      bool

	// Match rules
	SuffixOnly      bool
	CaseInsensitive bool
	// Required for the URL only atm:
	Unmatched bool
}

func DecodeFilename

func DecodeFilename(groupedWordMap map[string][]*GroupedFilenamePartMeaning, filename string) []*FilenamePartMeaning

type GenerateGithubAppImageTemplateData

type GenerateGithubAppImageTemplateData struct {
	*GenerateGithubWorkflowBase
}

func (*GenerateGithubAppImageTemplateData) Dependencies

func (ggaitd *GenerateGithubAppImageTemplateData) Dependencies() []string

func (*GenerateGithubAppImageTemplateData) ExternalResources

func (ggaitd *GenerateGithubAppImageTemplateData) ExternalResources() map[string]*ExternalResource

func (*GenerateGithubAppImageTemplateData) HasDesktopFile

func (ggaitd *GenerateGithubAppImageTemplateData) HasDesktopFile() bool

func (*GenerateGithubAppImageTemplateData) IsArchived

func (ggaitd *GenerateGithubAppImageTemplateData) IsArchived(keyword string) bool

func (*GenerateGithubAppImageTemplateData) KeywordList

func (ggaitd *GenerateGithubAppImageTemplateData) KeywordList() []string

func (*GenerateGithubAppImageTemplateData) Keywords

func (ggaitd *GenerateGithubAppImageTemplateData) Keywords() string

func (*GenerateGithubAppImageTemplateData) MaskedKeywords

func (ggaitd *GenerateGithubAppImageTemplateData) MaskedKeywords() string

func (*GenerateGithubAppImageTemplateData) NeedsSrcUnpack

func (ggaitd *GenerateGithubAppImageTemplateData) NeedsSrcUnpack() bool

func (*GenerateGithubAppImageTemplateData) PackageName

func (ggaitd *GenerateGithubAppImageTemplateData) PackageName() string

func (*GenerateGithubAppImageTemplateData) TemplateFileName

func (ggaitd *GenerateGithubAppImageTemplateData) TemplateFileName() string

func (*GenerateGithubAppImageTemplateData) WorkflowFileName

func (ggaitd *GenerateGithubAppImageTemplateData) WorkflowFileName() string

func (*GenerateGithubAppImageTemplateData) WorkflowName

func (ggaitd *GenerateGithubAppImageTemplateData) WorkflowName() string

type GenerateGithubBinaryTemplateData

type GenerateGithubBinaryTemplateData struct {
	*GenerateGithubWorkflowBase

	MustntHaveUseFlags map[string]map[string][]string
	MustHaveUseFlags   map[string]map[string][]string
	// contains filtered or unexported fields
}

func (*GenerateGithubBinaryTemplateData) AlternativeDependencies

func (ggbtd *GenerateGithubBinaryTemplateData) AlternativeDependencies() map[string][]string

func (*GenerateGithubBinaryTemplateData) CompressGroupedKeywordedFilenameReference

func (ggbtd *GenerateGithubBinaryTemplateData) CompressGroupedKeywordedFilenameReference(result []KeywordGrouped[*KeywordedFilenameReference]) []KeywordGrouped[*KeywordedFilenameReference]

func (*GenerateGithubBinaryTemplateData) CompressGroupedKeywordedanualPageReference

func (ggbtd *GenerateGithubBinaryTemplateData) CompressGroupedKeywordedanualPageReference(result []KeywordGrouped[*KeywordedManualPageReference]) []KeywordGrouped[*KeywordedManualPageReference]

func (*GenerateGithubBinaryTemplateData) CompressedManualPages

func (ggbtd *GenerateGithubBinaryTemplateData) CompressedManualPages() (result []KeywordGrouped[*KeywordedManualPageReference])

func (*GenerateGithubBinaryTemplateData) Documents

func (*GenerateGithubBinaryTemplateData) ExternalResources

func (*GenerateGithubBinaryTemplateData) ExtractedUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) ExtractedUseFlags() []string

func (*GenerateGithubBinaryTemplateData) G2MetadataArgs added in v0.1.26

func (ggbtd *GenerateGithubBinaryTemplateData) G2MetadataArgs() string

func (*GenerateGithubBinaryTemplateData) GetMustHaveUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) GetMustHaveUseFlags(programName string, kw string) []string

func (*GenerateGithubBinaryTemplateData) GetMustntHaveUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) GetMustntHaveUseFlags(programName string, kw string) []string

func (*GenerateGithubBinaryTemplateData) HasCompressedManualPages

func (ggbtd *GenerateGithubBinaryTemplateData) HasCompressedManualPages() bool

func (*GenerateGithubBinaryTemplateData) HasDesktopFile

func (ggbtd *GenerateGithubBinaryTemplateData) HasDesktopFile() bool

func (*GenerateGithubBinaryTemplateData) HasDocuments

func (ggbtd *GenerateGithubBinaryTemplateData) HasDocuments() bool

func (*GenerateGithubBinaryTemplateData) HasManualPages

func (ggbtd *GenerateGithubBinaryTemplateData) HasManualPages() bool

func (*GenerateGithubBinaryTemplateData) HasShellCompletion

func (ggbtd *GenerateGithubBinaryTemplateData) HasShellCompletion(shell string) bool

func (*GenerateGithubBinaryTemplateData) IUseFlags added in v0.1.41

func (ggbtd *GenerateGithubBinaryTemplateData) IUseFlags() []g2.Flag

func (*GenerateGithubBinaryTemplateData) IsArchived

func (ggbtd *GenerateGithubBinaryTemplateData) IsArchived(keyword string) bool

func (*GenerateGithubBinaryTemplateData) KeywordList

func (ggbtd *GenerateGithubBinaryTemplateData) KeywordList() []string

func (*GenerateGithubBinaryTemplateData) Keywords

func (ggbtd *GenerateGithubBinaryTemplateData) Keywords() string

func (*GenerateGithubBinaryTemplateData) MainDependencies

func (ggbtd *GenerateGithubBinaryTemplateData) MainDependencies() []string

func (*GenerateGithubBinaryTemplateData) ManualPages

func (*GenerateGithubBinaryTemplateData) MaskedKeywords

func (ggbtd *GenerateGithubBinaryTemplateData) MaskedKeywords() string

func (*GenerateGithubBinaryTemplateData) Metadata

func (ggbtd *GenerateGithubBinaryTemplateData) Metadata() (string, error)

func (*GenerateGithubBinaryTemplateData) NeedsSrcUnpack

func (ggbtd *GenerateGithubBinaryTemplateData) NeedsSrcUnpack() bool

func (*GenerateGithubBinaryTemplateData) PackageName

func (ggbtd *GenerateGithubBinaryTemplateData) PackageName() string

func (*GenerateGithubBinaryTemplateData) ParseKeywordAndUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) ParseKeywordAndUseFlags(kw string) (string, []string, []string)

func (*GenerateGithubBinaryTemplateData) ProgramsAsAlternatives

func (ggbtd *GenerateGithubBinaryTemplateData) ProgramsAsAlternatives() map[string][]string

func (*GenerateGithubBinaryTemplateData) ProgramsAsAlternativesForArch

func (ggbtd *GenerateGithubBinaryTemplateData) ProgramsAsAlternativesForArch(forArchitecture string) []string

func (*GenerateGithubBinaryTemplateData) ReverseProgramsAsAlternatives

func (ggbtd *GenerateGithubBinaryTemplateData) ReverseProgramsAsAlternatives() map[string][]string

func (*GenerateGithubBinaryTemplateData) ShellCompletion

func (*GenerateGithubBinaryTemplateData) ShellCompletionInstallPath

func (ggbtd *GenerateGithubBinaryTemplateData) ShellCompletionInstallPath(shell string) (string, error)

func (*GenerateGithubBinaryTemplateData) ShellCompletionShells

func (ggbtd *GenerateGithubBinaryTemplateData) ShellCompletionShells() []string

func (*GenerateGithubBinaryTemplateData) SortedReverseProgramsAsAlternatives added in v0.1.43

func (ggbtd *GenerateGithubBinaryTemplateData) SortedReverseProgramsAsAlternatives() []ReverseProgramAlternative

func (*GenerateGithubBinaryTemplateData) TemplateFileName

func (ggbtd *GenerateGithubBinaryTemplateData) TemplateFileName() string

func (*GenerateGithubBinaryTemplateData) WorkflowFileName

func (ggbtd *GenerateGithubBinaryTemplateData) WorkflowFileName() string

func (*GenerateGithubBinaryTemplateData) WorkflowName

func (ggbtd *GenerateGithubBinaryTemplateData) WorkflowName() string

type GenerateGithubCmakeTemplateData added in v0.1.27

type GenerateGithubCmakeTemplateData struct {
	*GenerateGithubWorkflowBase
	GentooAuthors bool
	SourceLicense string
}

func (*GenerateGithubCmakeTemplateData) Metadata added in v0.1.27

func (ggctd *GenerateGithubCmakeTemplateData) Metadata() (string, error)

func (*GenerateGithubCmakeTemplateData) PackageName added in v0.1.27

func (ggctd *GenerateGithubCmakeTemplateData) PackageName() string

func (*GenerateGithubCmakeTemplateData) TemplateFileName added in v0.1.27

func (ggctd *GenerateGithubCmakeTemplateData) TemplateFileName() string

func (*GenerateGithubCmakeTemplateData) WorkaroundGentooVersionRegularExpression added in v0.1.32

func (ggctd *GenerateGithubCmakeTemplateData) WorkaroundGentooVersionRegularExpression() string

func (*GenerateGithubCmakeTemplateData) WorkaroundVersionReplacement added in v0.1.32

func (ggctd *GenerateGithubCmakeTemplateData) WorkaroundVersionReplacement() string

func (*GenerateGithubCmakeTemplateData) WorkflowFileName added in v0.1.27

func (ggctd *GenerateGithubCmakeTemplateData) WorkflowFileName() string

func (*GenerateGithubCmakeTemplateData) WorkflowName added in v0.1.27

func (ggctd *GenerateGithubCmakeTemplateData) WorkflowName() string

type GenerateGithubWorkflowBase

type GenerateGithubWorkflowBase struct {
	*InputConfig
	Version    string
	Now        time.Time
	ConfigFile string
	Schedule   string

	GlobalGenerateMd5Cache      bool
	GlobalGenerateOverlay       bool
	GlobalOverlayRepoName       *string
	GlobalUpsertOverlayRepoName bool
	GentooAuthors               bool
	SourceLicense               string
	HasExplicitSourceLicense    bool
}

func (*GenerateGithubWorkflowBase) Cron added in v0.1.27

func (*GenerateGithubWorkflowBase) DefaultMetadata

func (b *GenerateGithubWorkflowBase) DefaultMetadata() (string, error)

func (*GenerateGithubWorkflowBase) FeatureGenerateMd5Cache added in v0.1.34

func (b *GenerateGithubWorkflowBase) FeatureGenerateMd5Cache() bool

func (*GenerateGithubWorkflowBase) FeatureGenerateOverlay added in v0.1.40

func (b *GenerateGithubWorkflowBase) FeatureGenerateOverlay() bool

func (*GenerateGithubWorkflowBase) FeatureUpsertOverlayRepoName added in v0.1.46

func (b *GenerateGithubWorkflowBase) FeatureUpsertOverlayRepoName() bool

func (*GenerateGithubWorkflowBase) G2MetadataArgs added in v0.1.26

func (b *GenerateGithubWorkflowBase) G2MetadataArgs() string

func (*GenerateGithubWorkflowBase) GetDownloadPipelineBase64 added in v0.1.43

func (b *GenerateGithubWorkflowBase) GetDownloadPipelineBase64() string

func (*GenerateGithubWorkflowBase) GetHeader added in v0.1.46

func (b *GenerateGithubWorkflowBase) GetHeader() string

func (*GenerateGithubWorkflowBase) GetHeaderLines added in v0.1.46

func (b *GenerateGithubWorkflowBase) GetHeaderLines() []string

GetHeaderLines provides header data as separate physical lines. Keep GetHeader for callers using the original string-valued policy API.

func (*GenerateGithubWorkflowBase) GetOverlayRepoName added in v0.1.45

func (b *GenerateGithubWorkflowBase) GetOverlayRepoName() string

func (*GenerateGithubWorkflowBase) GetVersionPipelineBase64 added in v0.1.43

func (b *GenerateGithubWorkflowBase) GetVersionPipelineBase64() string

func (*GenerateGithubWorkflowBase) HasOverlayRepoName added in v0.1.45

func (b *GenerateGithubWorkflowBase) HasOverlayRepoName() bool

func (*GenerateGithubWorkflowBase) PipelineScriptBase64 added in v0.1.43

func (b *GenerateGithubWorkflowBase) PipelineScriptBase64() string

func (*GenerateGithubWorkflowBase) WorkaroundGentooVersionRegularExpression added in v0.1.32

func (b *GenerateGithubWorkflowBase) WorkaroundGentooVersionRegularExpression() string

func (*GenerateGithubWorkflowBase) WorkaroundVersionReplacement added in v0.1.32

func (b *GenerateGithubWorkflowBase) WorkaroundVersionReplacement() string

type GenerateWebAppImageTemplateData

type GenerateWebAppImageTemplateData struct {
	*GenerateGithubAppImageTemplateData
}

GenerateWebAppImageTemplateData reuses the Github AppImage workflow data but renders using a different template for non-GitHub downloads.

func (*GenerateWebAppImageTemplateData) GetDownloadPipeline added in v0.1.43

func (gwatd *GenerateWebAppImageTemplateData) GetDownloadPipeline() string

func (*GenerateWebAppImageTemplateData) PipelineScriptBase64 added in v0.1.43

func (gwatd *GenerateWebAppImageTemplateData) PipelineScriptBase64() string

func (*GenerateWebAppImageTemplateData) TemplateFileName

func (gwatd *GenerateWebAppImageTemplateData) TemplateFileName() string

TemplateFileName returns the template used for arbitrary website downloads.

type GenerateWebBinaryTemplateData added in v0.1.27

type GenerateWebBinaryTemplateData struct {
	*GenerateGithubBinaryTemplateData
}

GenerateWebBinaryTemplateData reuses the Github Binary workflow data but renders using a different template for non-GitHub downloads.

func (*GenerateWebBinaryTemplateData) GetVersionPipeline added in v0.1.43

func (gwbtd *GenerateWebBinaryTemplateData) GetVersionPipeline() string

func (*GenerateWebBinaryTemplateData) PipelineScriptBase64 added in v0.1.43

func (gwbtd *GenerateWebBinaryTemplateData) PipelineScriptBase64() string

func (*GenerateWebBinaryTemplateData) TemplateFileName added in v0.1.27

func (gwbtd *GenerateWebBinaryTemplateData) TemplateFileName() string

TemplateFileName returns the template used for arbitrary website binary downloads.

type GroupedFilenamePartMeaning

type GroupedFilenamePartMeaning struct {
	*FilenamePartMeaning
	Key string
}

func (*GroupedFilenamePartMeaning) Match

type InputConfig

type InputConfig struct {
	GeneratedEbuildGentooAuthors *bool
	GeneratedEbuildSourceLicense *string
	GentooAuthors                *bool
	SourceLicense                *string
	EbuildInclude                map[string][]string
	Symlinks                     map[string]string
	EntryNumber                  int
	Type                         string
	GithubProjectUrl             string
	DownloadPageUrl              string
	DownloadRedirect             string
	DownloadBaseUrl              string
	DownloadMatch                string
	VersionPipeline              string
	DownloadPipeline             string
	DownloadRegex                string
	DownloadXPath                string
	TagsCommand                  string
	CustomDownloadUrl            string
	CustomVersionSource          string
	CustomBuildSteps             string
	PreVersionSteps              string
	CustomJobSteps               string
	Category                     string
	EbuildName                   string
	Description                  string
	Homepage                     string
	GithubRepo                   string
	GithubOwner                  string
	License                      string
	MaintainerEmail              string
	MaintainerName               string
	Features                     map[string]string
	Workarounds                  map[string]string
	Programs                     map[string]*Program
	IUse                         []string
	RequiredUse                  []string
}

InputConfig represents a single configuration entry.

func CreateSanitizeAndAppendInputConfig

func CreateSanitizeAndAppendInputConfig(parsedFields map[string][]string, parsedProgramFields map[string]map[string][]string, configs []*InputConfig) ([]*InputConfig, error)

func GenerateAppImageGithubReleaseConfigEntry

func GenerateAppImageGithubReleaseConfigEntry(gitRepo, tagOverride, tagPrefix string) (*InputConfig, error)

func GenerateBinaryGithubReleaseConfigEntry

func GenerateBinaryGithubReleaseConfigEntry(gitRepo, tagOverride, prefix string) (*InputConfig, error)

func GenerateWebAppImageConfigEntry

func GenerateWebAppImageConfigEntry(pageURL, matchExpr, linkExt string) (*InputConfig, []util.AppImageLink, error)

GenerateWebAppImageConfigEntry builds a configuration entry for a web-hosted AppImage by inspecting the download page and deriving sensible defaults.

func ParseInputConfigReader

func ParseInputConfigReader(file io.Reader) ([]*InputConfig, error)

ParseInputConfigReader parses the given configuration file and returns a slice of InputConfig structures.

func ReadConfigurationFile

func ReadConfigurationFile(configFn string) ([]*InputConfig, error)

func (*InputConfig) CreateAndSanitizeInputConfigProgram

func (ic *InputConfig) CreateAndSanitizeInputConfigProgram(programName string, programFields map[string][]string) (*Program, error)

func (*InputConfig) Cron

func (ic *InputConfig) Cron() string

func (*InputConfig) FeatureGenerateMd5Cache added in v0.1.34

func (ic *InputConfig) FeatureGenerateMd5Cache() bool

func (*InputConfig) FeatureGenerateOverlay added in v0.1.40

func (ic *InputConfig) FeatureGenerateOverlay() bool

func (*InputConfig) FeatureString added in v0.1.34

func (ic *InputConfig) FeatureString() []string

func (*InputConfig) FeatureUpsertOverlayRepoName added in v0.1.46

func (ic *InputConfig) FeatureUpsertOverlayRepoName() bool

func (*InputConfig) GenerateGithubWorkflow

func (ic *InputConfig) GenerateGithubWorkflow(file string, now time.Time, templates *template.Template, outputDir, version string, ops ...any) error

func (*InputConfig) GetDownloadPipeline added in v0.1.43

func (ic *InputConfig) GetDownloadPipeline() string

func (*InputConfig) GetPrograms

func (ic *InputConfig) GetPrograms() map[string]*Program

func (*InputConfig) GetVersionPipeline added in v0.1.43

func (ic *InputConfig) GetVersionPipeline() string

func (*InputConfig) ProgramsString

func (ic *InputConfig) ProgramsString() []string

func (*InputConfig) RenderGithubWorkflow added in v0.1.47

func (ic *InputConfig) RenderGithubWorkflow(file string, now time.Time, templates *template.Template, outputDir, version string, ops ...any) (string, []byte, error)

RenderGithubWorkflow renders and normalizes the GitHub Actions workflow YAML for the InputConfig without writing it to disk. It returns the calculated target file path within outputDir, the rendered bytes, and any validation or template execution error.

func (*InputConfig) ResolveHeaderPolicy added in v0.1.46

func (ic *InputConfig) ResolveHeaderPolicy(ops ...any) (gentooAuthors bool, sourceLicense string, hasExplicitSourceLicense bool)

ResolveHeaderPolicy combines global options with per-entry overrides. The third result distinguishes an explicitly configured source license from the default MIT source header (which controls the Gentoo Authors GPL-2 header).

func (*InputConfig) String

func (ic *InputConfig) String() string

String serializes the InputConfig struct back into the configuration file format.

func (*InputConfig) Validate

func (ic *InputConfig) Validate() error

func (*InputConfig) WorkaroundCheckAssetSize added in v0.1.32

func (ic *InputConfig) WorkaroundCheckAssetSize() bool

func (*InputConfig) WorkaroundGentooVersionRegularExpression added in v0.1.32

func (ic *InputConfig) WorkaroundGentooVersionRegularExpression() string

func (*InputConfig) WorkaroundSemanticVersionPrereleaseHack1

func (ic *InputConfig) WorkaroundSemanticVersionPrereleaseHack1() bool

func (*InputConfig) WorkaroundSemanticVersionWithoutV

func (ic *InputConfig) WorkaroundSemanticVersionWithoutV() bool

func (*InputConfig) WorkaroundString

func (ic *InputConfig) WorkaroundString() []string

func (*InputConfig) WorkaroundTagPrefix

func (ic *InputConfig) WorkaroundTagPrefix() string

func (*InputConfig) WorkaroundVersionReplacement added in v0.1.32

func (ic *InputConfig) WorkaroundVersionReplacement() string

type KeywordGrouped

type KeywordGrouped[T any] struct {
	Keyword string
	Grouped []T
}

func KeywordGroupCompressor

func KeywordGroupCompressor[T any](ggbtd *GenerateGithubBinaryTemplateData, result []KeywordGrouped[T], comparerFunc func(reference T, reference2 T) bool) []KeywordGrouped[T]

type KeywordedFilenameReference

type KeywordedFilenameReference struct {
	Filepath []string
	Keyword  string
}

func (*KeywordedFilenameReference) DestinationFilename

func (kr *KeywordedFilenameReference) DestinationFilename() string

func (*KeywordedFilenameReference) SourceFilepath

func (kr *KeywordedFilenameReference) SourceFilepath() string

type KeywordedManualPageReference

type KeywordedManualPageReference KeywordedFilenameReference

func (KeywordedManualPageReference) Compressed

func (kmpr KeywordedManualPageReference) Compressed() bool

func (KeywordedManualPageReference) Decompressor

func (kmpr KeywordedManualPageReference) Decompressor() string

func (KeywordedManualPageReference) DestinationFilename

func (kmpr KeywordedManualPageReference) DestinationFilename() string

func (KeywordedManualPageReference) Page

func (kmpr KeywordedManualPageReference) Page() int

func (KeywordedManualPageReference) SourceFilepath

func (kmpr KeywordedManualPageReference) SourceFilepath() string

func (KeywordedManualPageReference) UncompressedSourceFilepath

func (kmpr KeywordedManualPageReference) UncompressedSourceFilepath() string

type NextGenerate added in v0.1.27

type NextGenerate func(file string, outputDir string, version string, ops ...any) error

type OptGenerateMd5Cache added in v0.1.40

type OptGenerateMd5Cache bool

type OptGenerateOverlay added in v0.1.40

type OptGenerateOverlay bool

type OptGeneratedEbuildGentooAuthors added in v0.1.46

type OptGeneratedEbuildGentooAuthors bool

type OptGeneratedEbuildSourceLicense added in v0.1.46

type OptGeneratedEbuildSourceLicense string

type OptGentooAuthors added in v0.1.46

type OptGentooAuthors bool

type OptOverlayRepoName added in v0.1.45

type OptOverlayRepoName string

type OptSourceLicense added in v0.1.46

type OptSourceLicense string

type OptUpsertOverlayRepoName added in v0.1.46

type OptUpsertOverlayRepoName bool

type Program

type Program struct {
	ProgramName            string
	Binary                 map[string][]string
	DesktopFile            string
	Icons                  []string
	Documents              map[string][][]string
	ManualPage             map[string][][]string
	ShellCompletionScripts map[string]map[string][]string
	Dependencies           []string
}

func (*Program) FirstIcons

func (p *Program) FirstIcons() string

func (*Program) HasCompressedManualPages

func (p *Program) HasCompressedManualPages() bool

func (*Program) HasDesktopFile

func (p *Program) HasDesktopFile() bool

func (*Program) HasDocuments

func (p *Program) HasDocuments() bool

func (*Program) HasManualPage

func (p *Program) HasManualPage() bool

func (*Program) HasShellCompletion

func (p *Program) HasShellCompletion(shell string) bool

func (*Program) InstalledFilename

func (p *Program) InstalledFilename() string

func (*Program) IsArchived

func (p *Program) IsArchived(arch string) bool

func (*Program) IsEmpty

func (p *Program) IsEmpty() bool

func (*Program) ShellCompletion

func (p *Program) ShellCompletion(shell string) (result []*KeywordedFilenameReference)

func (*Program) String

func (p *Program) String() string

type ReverseProgramAlternative added in v0.1.43

type ReverseProgramAlternative struct {
	UseFlag       string
	Architectures []string
}

Directories

Path Synopsis
cmd
generate command

Jump to

Keyboard shortcuts

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