Updated logging for multi-repo setup

main
Jef Roosens 2022-03-27 18:22:30 +02:00
parent 014ade5092
commit cb2ba86200
Signed by untrusted user: Jef Roosens
GPG Key ID: B75D4F293C7052DB
5 changed files with 19 additions and 13 deletions

View File

@ -18,17 +18,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Very basic build system
* Build is triggered by separate cron container
* Packages build on cron container's system
* Packages are always rebuilt, even if they haven't changed
* A HEAD request is used to determine whether a package should be rebuilt
or not
* Hardcoded planning of builds
* Builds are sequential
* API for managing Git repositories to build
* CLI to list, add & remove Git repos to build
* Published packages on my Vieter instance
* Support for multiple repositories
* Support for multiple architectures per repository
## Fixed
* Each package can now only have one version in the repository at once
(required by Pacman)
* Packages with unknown fields in .PKGINFO are now allowed
## [0.1.0](https://git.rustybever.be/Chewing_Bever/vieter/src/tag/0.1.0)

View File

@ -81,15 +81,16 @@ fn (r &RepoGroupManager) add_pkg_in_repo(repo string, pkg &package.Pkg) ?bool {
arch_repos << r.default_arch
}
for arch in arch_repos {
r.add_pkg_in_arch_repo(repo, arch, pkg) ?
}
}else{
r.add_pkg_in_arch_repo(repo, pkg.info.arch, pkg) ?
}
mut added := false
// TODO properly handle this
return true
for arch in arch_repos {
added = added || r.add_pkg_in_arch_repo(repo, arch, pkg) ?
}
return added
}else{
return r.add_pkg_in_arch_repo(repo, pkg.info.arch, pkg)
}
}
// add_pkg_in_repo adds the given package to the specified repo. A repo is an

View File

@ -86,15 +86,16 @@ fn (mut app App) put_package(repo string) web.Result {
return app.text('Failed to add package.')
}
if !res.added {
os.rm(pkg_path) or { app.lerror("Failed to remove download '$pkg_path': $err.msg") }
app.lwarn("Duplicate package '$res.pkg.full_name()'.")
app.lwarn("Duplicate package '$res.pkg.full_name()' in repo '$repo ($res.pkg.info.arch)'.")
return app.text('File already exists.')
}
app.linfo("Added '$res.pkg.full_name()' to repository.")
app.linfo("Added '$res.pkg.full_name()' to repo '$repo ($res.pkg.info.arch)'.")
return app.text('Package added successfully.')
}

View File

@ -46,7 +46,7 @@ def create_random_pkginfo(words, name_min_len, name_max_len):
"pkgname": name,
"pkgbase": name,
"pkgver": ver,
"arch": "any"
"arch": "x86_64"
}
return "\n".join(f"{key} = {value}" for key, value in data.items())
@ -97,7 +97,7 @@ async def upload_random_package(tar_path, sem):
async with sem:
with open(tar_path, 'rb') as f:
async with aiohttp.ClientSession() as s:
async with s.post("http://localhost:8000/vieter/publish", data=f.read(), headers={"x-api-key": "test"}) as r:
async with s.post("http://localhost:8000/vieter2/publish", data=f.read(), headers={"x-api-key": "test"}) as r:
return await check_output(r)