Marek Marczykowski-Górecki
6c376d68c4
qvm-template: fix installing already cached templates
...
And also enhance tests to verify download() function return value.
2021-04-02 03:50:11 +02:00
Marek Marczykowski-Górecki
9020f2e1fd
qvm-template: fix downloading template for install
...
Donwload a template into a cache dir, not into default of `qvm-template
download` (current directory).
2021-04-01 01:48:29 +02:00
WillyPillow
fc520f8ed4
qvm-template: update comments to reflect e424c7d
2021-02-21 02:11:23 +08:00
WillyPillow
dedf5ac6e6
qvm-template: only ask for confirmation during install if something is being done
2021-02-21 02:09:23 +08:00
WillyPillow
60f5ba0e23
qvm-template: test != 1 instead of == 0 for template-dummy feature
2021-02-20 09:57:59 +08:00
WillyPillow
ed3e368673
tests: add tests for qvm-template remove
2021-02-20 09:46:56 +08:00
Marek Marczykowski-Górecki
f4e826e65d
qvm-template: mute pylint complains about typing.NamedTuple
...
This is false positive, PyCQA/pylint#3732
2021-02-19 17:21:39 +01:00
Marek Marczykowski-Górecki
e6360da22e
qvm-template: default confirm to 'n'
...
Capital 'N' in the prompt suggests it is the default - really make it
the default.
2021-02-19 01:12:26 +01:00
Marek Marczykowski-Górecki
e424c7df9c
qvm-template: verify template package signature directly at download
...
Make the download() function save the package into a temporary space and
move to the target location only after checking the signature. This is
safer option than requiring all callers to explicitly verify the
signature. Also, make the download() function verify if the template
name inside the package matches what was requested.
Especially, make `qvm-template download` action verify the signature
too.
On `qvm-template install` avoid checking the signature again for
downloaded packages, by passing extra argument to the verify_rpm()
function. But still verify signature of packages loaded from disk.
2021-02-18 21:43:57 +01:00
Marek Marczykowski-Górecki
ce36dc55c5
qvm-template: improve error reporting
...
Do not print the whole traceback by default - do that only when
--verbose is used.
2021-02-07 03:35:17 +01:00
Marek Marczykowski-Górecki
b7446afe3b
qvm-template: use key specified in the repo definition if possible
...
This makes the package verified against _only_ the key specified in the
repo config, not all the trusted keys.
If repo does not specify a key, use the default one (change this to a
single file, instead of the whole directory). Existing 'gpgkey' entry
pointing at non-existing file will result in an error.
2021-02-07 03:35:16 +01:00
Marek Marczykowski-Górecki
4f9757ca88
qvm-template: by default list only latest available template
...
But add --all-versions option to get all the available versions.
2021-02-07 03:35:16 +01:00
Marek Marczykowski-Górecki
86326b53c4
qvm-template: factor filter_version() out of get_dl_list()
...
This allows reusing version filtering (getting only a single version per
template) in other places.
For equal versions packages, prefer the one from non-testing repository.
2021-02-07 03:35:16 +01:00
Marek Marczykowski-Górecki
10bea1b77e
qvm-template: allow global arguments after action name
...
It's convenient to use for example
`qvm-template list --enablerepo=*-testing`
Previously, _some_ options needed to be before action name.
2021-02-07 03:35:16 +01:00
Marek Marczykowski-Górecki
e0063d8808
qvm-template: use QubesArgumentParser
...
It produces consistent help for subcommands and already handles
--verbose/--quiet.
2021-02-07 03:35:15 +01:00
Marek Marczykowski-Górecki
6980e7ba14
Store template repo configuration in /etc
...
This way it's easier to permanently enable repos.
2021-02-06 16:03:40 +01:00
Marek Marczykowski-Górecki
f053f51644
qvm-template: remove downloaded package after installation
...
At least by default. Otherwise they will pile up in the cache dir.
2021-02-06 16:03:39 +01:00
Marek Marczykowski-Górecki
fe369ce523
qvm-template: cleanup install function
...
Remove now unused try/finally in install() and reduce indentation.
No functional change.
2021-02-06 16:03:39 +01:00
Marek Marczykowski-Górecki
f1424812b0
qvm-template: improve install lock
...
Use fcntl.flock() instead of just file existence check, so it won't fail
on a stale lock file. While at it, move locking to a function decorator,
to de-clutter the install function a bit. This will allow reducing
indentation level, but don't do it yet, to make the patch readable.
Move lock testing into a separate test, and remove it from install
tests.
QubesOS/qubes-issues#2534
2021-02-06 16:03:39 +01:00
Marek Marczykowski-Górecki
940124948a
qvm-template: minor improvements
...
- rename parser_gen to get_parser - for consistency with other tools
- clarify 'storage pool'
- move '-' to the end in regex characters list
QubesOS/qubes-issues#2534
2021-02-06 16:03:38 +01:00
Marek Marczykowski-Górecki
8aede943cc
qvm-template: add copyright header
2021-02-06 16:03:38 +01:00
Marek Marczykowski-Górecki
aeeb3daa80
qvm-template: handle template extraction failure
...
QubesOS/qubes-issues#2534
2021-02-06 16:03:38 +01:00
Marek Marczykowski-Górecki
f3954fb225
qvm-template: download templates to a temporary directory
...
Avoid risk of conflicting downloads to the same directory, reusing
partial downloads, leaving broken files etc. Move template package out
of temporary directory only after its verified.
QubesOS/qubes-issues#2534
2021-02-06 16:03:38 +01:00
Marek Marczykowski-Górecki
f3f6750a3f
qvm-template: call rpmkeys --checksig for signature verification
...
RPM API is confusing and it's easy to get it wrong when verifying
package signatures.
Call 'rpmkeys --checksig' which is more rebust here - RPM authors should
know how to use their API.
QubesOS/qubes-issues#2534
2021-02-06 16:03:38 +01:00
Marek Marczykowski-Górecki
b500462abb
qvm-template: use UpdateVM by default
...
Do not hardcode sys-firewall
2021-02-06 16:03:37 +01:00
WillyPillow
1671b4216f
qvm-template: Add tests for download function and fix minor bugs
2020-10-04 03:05:14 +08:00
WillyPillow
5f03640467
qvm-template: Fix broken indention
2020-09-15 01:30:57 +08:00
WillyPillow
7facc7d35f
qvm-template: Fix minor bugs
...
* Incomprehensive spec filtering in `list_templates`
* Type error of `install_time` in `list_templates`
* Incorrect version comparision in `search`
2020-09-15 00:23:06 +08:00
WillyPillow
b9f1d4c633
qvm-template: Make pylint happy
2020-09-07 02:12:22 +08:00
WillyPillow
554459ef42
qvm-template: Fix compatibility with Python 3.6
2020-09-07 01:53:43 +08:00
WillyPillow
3fac2097eb
qvm-template: Add partial tests for qrexec_repoquery
2020-09-07 01:52:56 +08:00
WillyPillow
89895038b5
qvm-template: Fix date formats to "%Y-%m-%d %H:%M:%S"
2020-09-06 23:57:42 +08:00
WillyPillow
f8032b0f5a
Revert "qvm-template: Fix compatibility with Python 3.6"
...
This reverts commit 199996e7b8
.
2020-09-05 02:25:26 +08:00
WillyPillow
199996e7b8
qvm-template: Fix compatibility with Python 3.6
2020-09-05 02:06:53 +08:00
WillyPillow
205eee4d80
qvm-template: Fix timezone issues by storing timezone explictly in features
2020-09-05 01:51:45 +08:00
WillyPillow
5a1e1b7fdd
qvm-template: Update docs for --updatevm
2020-09-04 01:59:28 +08:00
WillyPillow
757bb33329
Add stubs for rpm module and initial tests for qvm-template install
2020-09-04 01:56:15 +08:00
WillyPillow
3a42564af2
qvm-template: Make pylint happy
2020-08-31 02:22:39 +08:00
WillyPillow
6b3858314d
qvm-template: Improve help message for --upgrades
2020-08-30 02:54:43 +08:00
WillyPillow
d65d3c741a
qvm-template: Replace "template-install-time" with "template-installtime" for consistency
2020-08-30 02:01:19 +08:00
WillyPillow
32a38c7183
qvm-template: Eliminate use of lsb_release
2020-08-30 01:58:25 +08:00
WillyPillow
2e06e300e6
qvm-template: Tweak machine-readable output format.
2020-08-26 01:31:33 +08:00
WillyPillow
6efd85afba
qvm-template: Initial manpage.
2020-08-25 23:00:08 +08:00
WillyPillow
e9e198cc10
qvm-template: Make sure that template-dummy is set and used properly.
2020-08-25 01:43:11 +08:00
WillyPillow
55a3982bf6
qvm-template: Add option to disable download progress bar.
2020-08-19 02:00:19 +08:00
WillyPillow
d09695658f
qvm-template: Add support for JSON output.
2020-08-19 01:59:51 +08:00
WillyPillow
c6d5ac7c8c
qvm-template: Add option to specify RPM keyring location.
2020-08-14 14:27:36 +08:00
WillyPillow
3314500a83
qvm-template: Add purge operation.
2020-08-14 11:38:30 +08:00
WillyPillow
b7a603b9fe
qvm-template: Slight improvements to package verification.
2020-08-10 01:30:31 +08:00
WillyPillow
ed8fca6494
qvm-template: Fix type hints.
2020-08-08 15:31:25 +08:00