Documentation
¶
Overview ¶
Package source provides source file download and management functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSSHPassword ¶
func GetSSHPassword() string
GetSSHPassword returns the SSH password used for authenticated git clone operations.
func SetSSHPassword ¶
func SetSSHPassword(password string)
SetSSHPassword sets the SSH password used for authenticated git clone operations.
Types ¶
type Source ¶
type Source struct {
// Hash is the integrity hashsum for a source item
Hash string
// PkgName is the package name for component logging
PkgName string
// RefKey is the reference name for a VCS fragment (branch, tag) declared in the
// URI. i.e: "myfile::git+https://example.com/example.git#branch=example"
RefKey string
// RefValue is the reference value for a VCS fragment declared in the URI. i.e:
// myfile::git+https://example.com/example.git#branch=refvalue
RefValue string
// SSHPassword is used to store the password for SSH authentication.
// SSHPassword contains the SSH password for authentication.
SSHPassword string
// SourceItemPath is the absolute path to a source item (folder or file)
SourceItemPath string
// SourceItemURI it the full source item URI. i.e:
// "myfile::git+https://example.com/example.git#branch=example" i.e:
// "https://example.com/example.tar.gz"
SourceItemURI string
// SrcDir is the directory where all the source items are symlinked, extracted
// and processed by packaging functions.
SrcDir string
// StartDir is the root where a copied PKGBUILD lives and all the source items
// are downloaded. It generally contains the src and pkg folders.
StartDir string
// NoExtract is the list of filenames that should NOT be extracted from
// their archives, matching makepkg's noextract semantics: exact basename
// match, file is still symlinked into $srcdir but archive.Extract is skipped.
NoExtract []string
// SkipHashCheck disables sha256/sha512 integrity verification for this
// source item. Equivalent to setting the checksum to SKIP in the PKGBUILD.
SkipHashCheck bool
}
Source defines all the fields accepted by a source item.
func (*Source) Get ¶
Get retrieves the source file from the specified URI.
It parses the URI and determines the source file path and type. If the source file does not exist, it retrieves it from the specified URI. It validates the source file and symlinks any additional source files. Finally, it extracts the source file if necessary.
Returns an error if any step fails.