This release greatly improves version and package name detection and
adds over 1900 package URL tests for this feature. Package metadata is
now written to options.conf under the 'package' section. A Makefile is
still being written to, but this is deprecated and will be removed in
the future. The mock command is now detected in a manner compatible with
linux distributions other than Clear Linux.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Fix up several regular expressions and remove unused ones. Move as much
string replacing to string.replace() functions instead of slow regular
expressions.
Remove the pypi.python.org -> pypi.debian.net url conversion
(pypi.debian.net keeps going down).
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
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>
Rename set_mock to get_mock_cmd, and return the value instead of
setting a global variable.
This patch should not change any behavior.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Use 'sudo' unless /usr/bin/mock points to consolehelper. This is a
simpler heuristic than checking for the group membership and will let
us use the group membership in Clear Linux to give sudo permissions.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Instead of requiring the url argument and guessing where to put the
results from an autospec run, read metadata from options.conf. The
'package' section in options.conf defines the package name, url, and
archives when available.
If options.conf is present and there is at least one match between
detected metadata from the source tarball and the metadata in the
configuration, assume that the target directory is the current
directory. This is overridable with the -t/--target option. If nothing
matches the target directory is <current_dir>/<package_name>.
This functionality allows user to run autospec within the target
directory without passing any arguments, including the previously
required "url" argument if the metadata is present.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Deprecate writing to a Makefile in the package directory and write to
the options.conf file instead. Any other infrastructure that needs a
Makefile should write it itself.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
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>
Debian is down again, and we've seen them go down in the past. We
shouldn't be running these tests in Travis.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This release adds the "-C/--cleanup" flag to clean up the mock chroots
after a build. It also ensures that mock will build unique chroots for
each build, useful for automation environments where autospec is run in
parallel.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Add -C/--cleanup to tell mock to clean up the chroot after it completes
the build. This is useful for wrapping programs which run several
instances of autospec automatically. Use this flag to determine when we
actually need a unique uniqueext (automation environments) and when
those uniquexts can be reused (developer running one-offs).
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This prevents collisions when two instances are trying to build the same
package in parallel. Unit tests added as well.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Allow users to specify requires that are not dropped during existence
detection and os-packages list checking.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Several platforms are using Python 3.5 or lower. Replace the new f"..."
style strings with the traditional "...".format() style strings.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Fixes#14
Instead of adding the entire URL to the upstream file, only add the
archive basename after the sha1.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
These tests regularly fail in Travis for unknown reasons. Skip them
until the tests can be rewritten.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Instead of calling each test target individually, call the unittest
target to run all available tests in the test directory.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This allows python3 unittest to properly generate the tests when running
all the tests in the tests directory.
Also adds a fix to test_test.py to reset buildpattern.default_pattern
every test. This was a bug introduced by running all tests at once -
this was not being cleared correctly.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Asciidoc being in the configure log should not cause it to be added to
the build requires automatically. This is also intended to enable
asciidoc to be removed from use entirely.
The lib submodule requiring the config submodule was an artifact of
how autospec used to work before the stateless implementation in Clear
Linux. config is now mostly used for systemd configuration and unit
files which do not need to be pulled in for library use cases. So to
avoid having lib pull in systemd units that need the bin submodule,
stop having lib require config.
Instead of throwing an exception when pycurl errors are encountered
(such as timeouts), gracefully handle the error and exit. This helps
calling processes understand the error it is seeing and either retry or
continue without interruption.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>