Commit Graph

510 Commits

Author SHA1 Message Date
Matthew Johnson a2967f2ea2 Add --prep-only option to run preparatory work only
For non-autospec enabled packages this option can be used to download
the upstream tarball, any specified archives, extract them and put the
archives at their destination, and update the upstream file, but not
actually attempt to build a specfile.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-23 15:33:19 -07:00
Matthew Johnson 32aa9c70ff Ignore bare excepts with flake8
The previous ignore, import not at top of file (E402) was unneeded. Bare
excepts are handy when we want to fail gracefully from any error. This
is a script, not an imported library.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-23 12:08:01 -07:00
Arjan van de Ven 9f049a5dcc add an empty line in order to make git happy 2017-10-23 08:19:25 -07:00
Arjan van de Ven 6d2bf1f784 improve guess heuristics to add exact matches for tags 2017-10-23 08:19:25 -07:00
Arjan van de Ven 557c0473a2 deal with git repos that do not match the package name 2017-10-23 08:19:25 -07:00
Arjan van de Ven 2f84e0eaa4 fix CI errors 2017-10-23 08:19:25 -07:00
Arjan van de Ven dc36372472 support git shortlog from upstream git for creating commit messages 2017-10-23 08:19:25 -07:00
Arjan van de Ven e378f9dfa9 add support for a giturl to autospec 2017-10-21 19:29:17 +00:00
Matthew Johnson 8bc25eebe3 Release v1.1.1
This release adds quoting ("") around filenames with whitespace in them.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v1.1.1
2017-10-19 14:23:45 -07:00
Brett T. Warden 4004cffc23 specfiles: Quote filenames
In %files sections, double-quote any filenames containing a space or
tab. Uses a regex to detect and not quote rpm directive prefixes.

Fixes #32.

Signed-off-by: Brett T. Warden <brett.t.warden@intel.com>
2017-10-19 14:05:39 -07:00
Brett T. Warden a3589e1a70 tests: add leading slash to test filenames
Tests for the %files section use bare file names. Since rpmbuild
requires leading slashes anyway, adding slashes to some of the tests.

Adding new tests for filenames with white space and/or rpm directives.

Signed-off-by: Brett T. Warden <brett.t.warden@intel.com>
2017-10-19 14:05:39 -07:00
Matthew Johnson 1e1a8af5d3 Release v1.1.0
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>
v1.1.0
2017-10-18 12:50:09 -07:00
Matthew Johnson 4c9004d398 Simplify URL version and name detection
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>
2017-10-18 12:39:12 -07: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
Caio Marcelo de Oliveira Filho cc57b39872 Remove use of global variable for mock_cmd
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>
2017-10-18 12:33:15 -07:00
Caio Marcelo de Oliveira Filho 1574477167 Change how to decide whether use sudo or not with mock
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>
2017-10-18 12:33:15 -07:00
Simental Magana, Marcos c61c9328ff keyring: add TingPing key for hexchat package sig.
Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2017-10-18 08:52:42 -07:00
Matthew Johnson a972ddf932 Read metadata from options.conf for local run
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>
2017-10-16 16:07:14 -07:00
Matthew Johnson b9017aba4a Write package metadata to options.conf
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>
2017-10-16 16:07:14 -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 673ba4fd4c Skip debian pkg_integrity tests in Travis
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>
2017-10-16 14:54:34 -07:00
Matthew Johnson 82f816a731 Release v1.0.3
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>
v1.0.3
2017-10-11 15:43:31 -07:00
Matthew Johnson 6576660c5e Enable sudo in travis and fix linter error
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-11 15:38:14 -07:00
Matthew Johnson 91df2fc823 Add argument to make mock clean up after itself
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>
2017-10-11 15:38:14 -07:00
Matthew Johnson 8b56c225b1 Create mock chroot with a unique uniqueext
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>
2017-10-11 15:38:14 -07:00
Matthew Johnson e621984478 Release v1.0.2
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>
v1.0.2
2017-10-10 14:41:21 -07:00
William Douglas fa1e7951fe Allow manual override of requires
Allow developers to specify Requres that will not be dropped during
existence detection normally done for auto-detecting runtime
requirements.
2017-10-10 14:40:50 -07:00
Matthew Johnson ba58a1fd70 Release v1.0.1
Officially release all changes since 1.0.0 to begin regular release
cadence.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v1.0.1
2017-10-06 14:44:29 -07:00
Matthew Johnson 46445fb3ed Deprecate use of Python 3.6 style format strings
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>
2017-10-06 14:10:22 -07:00
William Douglas e2b9e04981 Add slang config test
Add slang-dev when packages are probing for slang.h.
2017-10-03 15:27:37 -07:00
Matthew Johnson 7f39ff646b Code style fix: remove extra line
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-02 11:14:58 -07:00
Ben Allen aebec79340 Set config.os_packages to an empty set instead of None 2017-10-02 09:05:00 -07:00
Arjan van de Ven ce439d8c93 autorequire python 2017-10-01 16:41:13 +00:00
Arjan van de Ven bd1b079a94 add python workaround 2017-10-01 16:36:17 +00:00
Arjan van de Ven 469563f638 Merge branch 'master' of git://kojiclear.jf.intel.com/projects/autospec 2017-10-01 14:06:57 +00:00
Arjan van de Ven 1b9ce5236f two more failed_commands 2017-10-01 14:06:50 +00:00
Arjan van de Ven b0fca15f47 -fno-common breaks for now 2017-10-01 14:06:32 +00:00
Arjan van de Ven 0f541cf3f9 print only interesting test results to be more concise 2017-10-01 14:06:18 +00:00
Matthew Johnson 5704872032 Add "Dual" to license_blacklist
For "Dual GPL/BSD/CPL" in DAPL package.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-29 10:27:59 -07:00
Matthew Johnson 7477d54978 Only add archive basename to upstream
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>
2017-09-28 12:32:45 -07:00
Matthew Johnson a09ea7005e Skip two more trouble tests in Travis
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-26 15:38:23 -07:00
Matthew Johnson adaea4202a Skip problem tests on Travis CI only
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>
2017-09-26 15:30:45 -07:00
Matthew Johnson 0e8dd48ab0 Update travis.yml to call unittests target
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>
2017-09-26 15:30:34 -07:00
Matthew Johnson 2552c9786f Move test generators out of name guard
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>
2017-09-26 15:30:34 -07:00
William Douglas 6a6ee3ddbd Add travis status to the readme 2017-09-26 14:24:37 -07:00
William Douglas fc17f898ac Remove asciidoc from failed_commands
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.
2017-09-22 15:21:02 -07:00
William Douglas d5db022992 Don't ignore all hidden files 2017-09-22 15:20:17 -07:00
William Douglas de97576f4e Cleanups for make check to pass 2017-09-22 15:20:17 -07:00
William Douglas 57280362e0 Add travis config 2017-09-22 15:20:17 -07:00
William Douglas 9b39e2b5cb Add runtime requirements in pip installable format 2017-09-22 15:20:17 -07:00