tarballname

package
v0.0.0-...-cf07509 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ACCEPTABLE_TARBALL_EXTENSIONS                          []string
	ACCEPTABLE_SOURCE_NAME_EXTENSIONS_REV_SORTED_BY_LENGTH []string
	KNOWN_SIGNING_EXTENSIONS                               []string
	ALL_DELIMITERS                                         []string
	STATUS_DELIMITERS                                      []string

	TARBALL_NAME_SEPARATION *regexp.Regexp = regexp.MustCompile(
		`[a-zA-Z]+|\d+|[\.\-\_\~\+]`,
	)
)
View Source
var DIFFICULT_NAMES = []string{
	"GeSHi-1.0.2-beta-1.tar.bz2",
	"Perl-Dist-Strawberry-BuildPerl-5101-2.11_10.tar.gz",
	"bind-9.9.1-P2.tar.gz",
	"boost_1_25_1.tar.bz2",
	"dahdi-linux-complete-2.1.0.3+2.1.0.2.tar.gz",
	"dhcp-4.1.2rc1.tar.gz",
	"dvd+rw-tools-5.5.4.3.4.tar.gz",
	"fontforge_full-20120731-b.tar.bz2",
	"gtk+-3.12.0.tar.xz",
	"lynx2.8.7rel.1.tar.bz2",
	"name.tar.gz",
	"ogre_src_v1-8-1.tar.bz2",
	"openjdk-8-src-b132-03_mar_2014.zip",
	"openssl-0.9.7a.tar.gz",
	"org.apache.felix.ipojo.manipulator-1.8.4-project.tar.gz",
	"pa_stable_v19_20140130.tgz",
	"pkcs11-helper-1.05.tar.bz2",
	"qca-pkcs11-0.1-20070425.tar.bz2",
	"tcl8.4.19-src.tar.gz",
	"wmirq-0.1-source.tar.gz",
	"xc-1.tar.gz",
	"xf86-input-acecad-1.5.0.tar.bz2",
	"xf86-input-elo2300-1.1.2.tar.bz2",
	"ziplock-1.7.3-source-release.zip",

	"unzip60.tar.gz",
	"zip30.tar.gz",
	"zip30c.tar.gz",
}

Functions

func DefaultVersionSplitter

func DefaultVersionSplitter(
	name_sliced SlicedName,
	most_possible_version Slice,
) *versionorstatus.ParsedVersionOrStatus

func InfoZipVersionSplitter

func InfoZipVersionSplitter(
	name_sliced SlicedName,
	most_possible_version Slice,
) *versionorstatus.ParsedVersionOrStatus

func InfoZipVersionsFunctionSelector

func InfoZipVersionsFunctionSelector(
	tarballbasename string,
) (VersionFinderFunction, VersionSplitterFunction)

func IsDecimal

func IsDecimal(val string) bool

TODO: need to find better solution, or write separate module for

functions like this

func IsPossibleTarballName

func IsPossibleTarballName(filename string) bool

func IsPossibleTarballNameErr

func IsPossibleTarballNameErr(filename string) error

func RemoveItemsList

func RemoveItemsList(data []string, what_to_remove []string) []string

func StrictVersionsFunctionSelector

func StrictVersionsFunctionSelector(
	tarballbasename string,
) (VersionFinderFunction, VersionSplitterFunction)

func StripList

func StripList(data []string, what_to_remove []string) []string

TODO: Move this function to separate module

Types

type MapOfSinglesAndMultiples

type MapOfSinglesAndMultiples (map[string](*SinglesAndMultiples))

func FindAllVersionsAndSingles

func FindAllVersionsAndSingles(
	name_sliced SlicedName,
) MapOfSinglesAndMultiples

type MapOfSinglesOrMultiples

type MapOfSinglesOrMultiples (map[string](*SinglesOrMultiples))

type ParsedTarballName

type ParsedTarballName struct {
	Basename           string
	Name               string
	Version            *versionorstatus.ParsedVersionOrStatus
	Status             *versionorstatus.ParsedVersionOrStatus
	Extension          string
	OriginalInputValue string
}

func ParseEx

func ParseEx(
	full_path_or_basename string,
	acceptable_extensions []string,
	versions_selector_function VersionsSelectorFunction,
) (*ParsedTarballName, error)

func ParseInfoZip

func ParseInfoZip(full_path_or_basename string) (*ParsedTarballName, error)

func ParseStrict

func ParseStrict(full_path_or_basename string) (*ParsedTarballName, error)

func (*ParsedTarballName) InfoText

func (self *ParsedTarballName) InfoText() string

func (*ParsedTarballName) Render

func (self *ParsedTarballName) Render(apply_extension bool) (string, error)

type SinglesAndMultiples

type SinglesAndMultiples struct {
	Singles   SinglesOrMultiples
	Multiples SinglesOrMultiples
}

func FindPossibleCharedSinglesAndMultiples

func FindPossibleCharedSinglesAndMultiples(
	name_sliced SlicedName,
	separator string,
) *SinglesAndMultiples

type SinglesOrMultiples

type SinglesOrMultiples SlicesSlice

type Slice

type Slice [2]uint64

func DefaultVersionFinder

func DefaultVersionFinder(
	name_sliced SlicedName,
) (
	*Slice,
	bool,
)

func InfoZipVersionFinder

func InfoZipVersionFinder(
	name_sliced SlicedName,
) (
	*Slice,
	bool,
)

type SlicedName

type SlicedName []string

type SlicesSlice

type SlicesSlice []Slice

func FindPossibleCharedSinglesAndMultiplesSub0

func FindPossibleCharedSinglesAndMultiplesSub0(
	slices SlicesSlice,
	version_started int64,
	version_ended int64,
) SlicesSlice

type VersionFinderFunction

type VersionFinderFunction func(name_sliced SlicedName) (*Slice, bool)

type VersionSplitterFunction

type VersionSplitterFunction func(
	name_sliced SlicedName,
	most_possible_version Slice,
) *versionorstatus.ParsedVersionOrStatus

type VersionsSelectorFunction

type VersionsSelectorFunction func(tarballbasename string) (
	VersionFinderFunction,
	VersionSplitterFunction,
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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