Commit Graph

34 Commits

Author SHA1 Message Date
Fabian Ebner
4bdd6a5148 clippy fixes
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-03 08:55:42 +01:00
Fabian Ebner
9caae7d49e upgrade to edition 2021
std::convert::{TryFrom, TryInto} are now part of the prelude.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-03 08:55:08 +01:00
Wolfgang Bumiller
c7b17de1b5 update to proxmox split and bump version to 0.8.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 12:00:19 +02:00
Wolfgang Bumiller
f9c6f7a18c bump versionto 0.7.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-08-24 15:41:08 +02:00
Thomas Lamprecht
4174305528 bump version to 0.6.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-29 18:11:24 +02:00
Fabian Ebner
fb51dcf9db add type DebianCodename
which allows to get rid of an possible error with check_suites, and
easily detect unexpected values with get_current_release_codename.

The check_repos function needs to be adapted, since the type does
not include suite names like oldstable,experimental,etc.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-29 18:00:38 +02:00
Fabian Ebner
51c69d76a5 repo: remove has_suite_variant helper
by exchanging loops in the check_suites function, which was the only
user. Exchanging loops also helps for introducing a type for Debian condenames.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-29 18:00:38 +02:00
Fabian Ebner
13cdf8d1df check repos: have caller specify the current suite
Like that, a potential error is further up the stack, and it's more
consistent with what the standard_repository functions do.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-29 18:00:38 +02:00
Fabian Ebner
c7f6163e2b repo: make suite_variant helper more general
use the first appearance of '-' or '/' to detect the variant instead
of keeping a list of possible variants, which would need to include
things like "-proposed-updates-debug".

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-29 18:00:38 +02:00
Fabian Ebner
f48c12b00a standard repos: add suite parameter for stricter detection
Require that the suite matches too when detecting standard
repositories, since no or invalid updates will be obtained when the
suite is wrong. Thus, it should not be considered to be the same
repository.

Add the parameter for get_standard_repository too, so that the two
related calls have more similar parameters, and the detection of the
current release code name can be done once in the caller once.

This also will fix an issue with the front-end, where adding a
standard repository would end up just enabling an already present
repository with the wrong suite.

Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-29 18:00:38 +02:00
Thomas Lamprecht
68064f65bc buildsys: indent continued command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-20 18:08:49 +02:00
Thomas Lamprecht
606eac1db7 cargo: disable default-features for proxmox
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-20 17:54:03 +02:00
Dietmar Maurer
39f12a8c05 depend on proxmox 0.12.0, bump version to 0.5.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-20 17:25:09 +02:00
Thomas Lamprecht
7d88081e0d bump version to 0.5.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-16 16:19:28 +02:00
Fabian Ebner
5581858b30 code cleanup: use contains()
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-16 15:22:51 +02:00
Fabian Ebner
2a1fb9bfdd standard repo detection: handle alternative URI for PVE repos
For PVE, URIs without the final "/pve" are also valid.

Make the single URL response a vector and iterate over it, lower
index is preferred.

Reported in the community forum:
https://forum.proxmox.com/threads/pve-7-0-9-no-proxmox-ve-repository-enabled.92427/

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
[ Thomas: extend commit message slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-16 15:21:21 +02:00
Fabian Ebner
652f52a1f2 bump proxmox dependency
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-16 15:18:45 +02:00
Fabian Ebner
9a51a30f46 tests: parse and write the result again
A cheap way to "double" the number of test cases.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-02 13:04:00 +02:00
Thomas Lamprecht
4b0935c621 bump version to 0.4.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-01 18:35:09 +02:00
Fabian Ebner
ae7e2360b7 support quote-word parsing for one-line format
so that parsing CD ROM repositories with spaces in the name works too.
But it's not limited to that, and should make one-line parsing rather
similar to what APT does (stanza parsing in APT doesn't use
ParseQuoteWord at all AFAICS).

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-01 18:27:27 +02:00
Fabian Ebner
8265d0ce33 avoid backtick unicode symbol in string
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-01 18:27:27 +02:00
Thomas Lamprecht
fd99aa062e bump version to 0.3.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 20:45:27 +02:00
Thomas Lamprecht
34074c1b80 slightly adapt repository text
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 20:42:31 +02:00
Fabian Ebner
3c4e441d7c standard repos: allow conversion from handle and improve information
Add a description for the handle, which can be useful to display
alongside the name. The descriptions are essentially the first
sentence from PVE's "Package Repositories" docs, but without the
product name.

Also drop the " Repository" suffix from the names, as it's not useful,
but can be ugly: e.g. for the UI when the label already is
'Repository:'.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 20:38:05 +02:00
Thomas Lamprecht
47c2c350b4 bump version to 0.3.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 13:34:37 +02:00
Thomas Lamprecht
082c868535 buildsys: upload: switch product to devel and dist to bullseye
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 13:34:37 +02:00
Fabian Ebner
3f7152383b standard repos: drop product acronym from repo name
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 13:24:42 +02:00
Fabian Ebner
87ea23ec83 check: return 'origin' property instead of 'badge' for official host
which is obtained from the cached InRelease file and also works for
mirrors, host aliases, direct IPs.

The has_official_uri function was replaced by origin_from_uris.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 13:24:42 +02:00
Fabian Ebner
bb0ff2ac73 add get_cached_origin method and an initial config module
Allows obtaining the 'Origin' property from the cached InRelease file.

Used the once_cell crate for the config module, because it is already
used in proxmox-backup and seemed to be the right fit here.

For now, the config module is just used to be able to override the
path for the test environment, but those are actual APT config
variables, and in the future, it can be extended and used to actually
parse the apt.conf(.d/*) on the system.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 13:24:42 +02:00
Fabian Ebner
c8f0c006e7 bump version to 0.2.0-1
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 16:00:30 +02:00
Fabian Ebner
8ada17854d add handling of Proxmox standard repositories
Get handles for the available repositories along with their current
configuration status and make it possible to add them.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 16:00:30 +02:00
Fabian Ebner
76d3a5ba1f add more functions to check repositories
Currently includes check for suites and check for official URIs

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 16:00:30 +02:00
Fabian Ebner
5bf8ddece7 add files for Debian packaging
The Makefile is based on the one from Mira's conntrack series, as it already got
some review.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 16:00:30 +02:00
Fabian Ebner
b6be0f3940 initial commit
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 16:00:30 +02:00