25 Commits

Author SHA1 Message Date
William Douglas a62a849262 Add github url handling for tags with slashes
vectorscan uses 'vectorscan/' as a tag prefix which confuses our
version parsing (even more so with v being the tag prefix). Add
support for matching any '*/version' tag names as the top priority.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-09-09 12:42:57 -07:00
Brett T. Warden dbfbd6e3f1 Fix parsing for ezix tarballs 2023-03-23 16:27:56 -07:00
William Douglas 74c0833cf4 Remove ruby, golang and cargo build patterns
These patterns are being removed as they are not used or are going to
be reworked.

This change also removes support for multi-versioned packages which
were considered for go and cargo purposes.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-17 12:14:20 -07:00
Brett T. Warden 8043039d97 Add name/version parser for dovecot pigeonhole packages
Example:
https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3-pigeonhole-0.5.20.tar.gz

Parse as name=pigeonhole, version=0.5.20
2023-02-10 14:00:38 -08:00
Patrick McCarty 145938d342 tarball: support another version prefix for gitlab URLs
Two gitlab URLs had mis-parsed versions that are derived from upstream
tags with a `VERSION_` prefix...

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-04-05 10:25:15 -07:00
William Douglas 0c780b3205 Remove support for the java build systems
These are no longer used in Clear Linux so the code can be removed
without issue.

Signed-off-by: William Douglas <william.douglas@intel.com>
2021-12-17 11:56:08 -08:00
Patrick McCarty 31897081fc Improve parsing of Gitlab URLs
Strip the optional leading character matching "[vVrR]" from a version extracted
from a Gitlab URL.

Update a packageurl test case to accommodate.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2021-06-01 16:16:47 -07:00
Patrick McCarty edef7aa7c6 Support new github archive tarball patterns
The Github API endpoint for generating tarballs from tags recently changed, so
teach autospec about the new URL format.

Also add a new packageurl for testing to confirm correct operation of the
regexp that matches the new format.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2021-06-01 16:16:47 -07:00
Patrick McCarty 080a96a37d Fix minor bug with github URL version mangling
The `v` prefix failed to be stripped off of the current URL for
`libarchive` because `archive` is a substring of `libarchive`. The
intended match should be for `/archive/` instead.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-05-26 14:15:53 -07:00
Athenas Jimenez 808b7d7224 Consolidate source management in Source class.
This patch consolidates the code that manages the sources
(.zip, .tar, etc) in Source class. This class is written in a way
that allows the reuse of code for all current supported types of
sources and at the same time, it allows the easy addition of new
ones.

Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2020-02-21 16:15:22 -08:00
Anselmo L. S. Melo bf4e3cbb9e Update SQLite tarball tests 2019-09-17 21:52:03 -07:00
William Douglas f54c485076 Fixups for github url name and version detection
Improve version detection for the release pattern of github by using
the release tag specifically rather than the package filename.
2018-07-20 16:32:14 -07:00
Leandro Dorileo af19c7e567 add new url pattern
Consider package names with an underscore separator.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2017-12-14 14:50:03 -08:00
Caio Marcelo de Oliveira Filho 25724b09a1 Extra case for name/version extraction with GitHub
In this case, the project uses one GitHub repo to distribute different
packages. The existing extraction rules are not enough

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-11-29 17:55:47 -08:00
Matthew Johnson 7acd27bea2 Add the world to tests/packageurls
Test almost 2000 URLs for proper version and name detection. This list
is sorted by the second column (expected name).

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-18 12:39:12 -07:00
Matthew Johnson 1f0545ccaa Add regex to handle font packages
Adobe font packages have -nndpi as part of the name. Add tests and a
regular expression to capture these.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-16 15:26:34 -07:00
Matthew Johnson 37021b8505 Remove architecture string from version string 2017-07-31 13:56:11 -07:00
Matthew Johnson 7a648c8e66 Add another version pattern for stack 2017-07-17 16:01:42 -07:00
Matthew Johnson 9ba5bd1e05 Detect 'alpha' version similar to 'beta'
Add 'alpha' to acceptable version suffixes and add a test URL to
packageurls.
2017-04-04 12:56:35 -07:00
Matthew Johnson 5580b46e43 Allow http github URLs when parsing for version
This shortcoming was identified when a github package URL was changed to
http from https. The 's' character is made optional when parsing the
github URL and two test cases are added to the packageurl list for
testing.
2017-03-09 11:05:59 -08:00
Matthew Johnson a0bad7923b Simplify version detection logic
Version detection could be considerably simplified using builtin python
functions such as strip, replace, and list comprehension. The logic was
also modified a bit to provide more consistent version strings
containing only numbers and periods '.'. More unit tested urls were
added to tests.

9.11.0-P1 -> 9.11.0.1
1.0.0-rc1 -> 1.0.0.1
7_4_2     -> 7.4.2
2.1-3     -> 2.1.3

Some non-digit strings are conserved for upstream version update detection:

2.1-beta1 -> 2.1.beta1
2.1-pre8  -> 2.1.pre8
3.5.0b2   -> 3.5.0b2
2017-03-07 13:39:34 -08:00
Matthew Johnson ec43846860 Add lmdb tarball version and name testcase
Testing for bug reported in CLEAR-1817
2017-01-20 14:37:32 -08:00
Matthew Johnson 7853ee1602 Improve version detection when dash is found in string
Previously, it was assumed if a dash appeared in the version string the
actual version information was after the dash. This is not always the
case, so check if the second part of the string is formatted like a
version before using it. If not, try the first part. If neither look
like the version just remove the dash so it is at least a valid version
string.

Add a test case to packageurls to test this.
2017-01-19 14:43:42 -08:00
Matthew Johnson c4a2816cda Improve name/version detection to pass tests
Make several small improvements to package name and version detection.
Unit test now passes for a sampling of >100 package URLs. This patch
also adds several package URLs for testing.

Some of the improvements to name/version detection include:

- Reordering of patterns so specific patterns come first - these are our
  edge cases but they will not be checked if they are at the end of the
  list.
- Add conversion from 7_4_2 formatted versions to the more-common 7.4.2
  format.
- Remove release candidate tag (-rc#) from the end of version tags.
- Remove leading 'r' or 'v' even if it is capitalized.
- Remove package name from beginning of version if present.
2016-12-14 16:52:21 -08:00
Matthew Johnson e0111cc30e Add a unit test for version detection
This unit test reads test cases from tests/packageurls and attempts to
determine the version and name from the url specified. tests/packageurls
defines these cases and their expected results in the format:

<package url>,<expected name>,<expected version>

There are currently some test cases that fail. This unit test will make
it easier to make changes to the tarball.name_and_version() function.
2016-12-14 15:06:35 -08:00