chore: ran v fmt for v 0.3.3 changes

This commit is contained in:
Jef Roosens 2023-02-08 11:00:17 +01:00
parent e10b450abd
commit b3a119f221
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
37 changed files with 179 additions and 175 deletions

View file

@ -31,11 +31,15 @@ pub:
// new creates a new RepoGroupManager & creates the directories as needed
pub fn new(repos_dir string, pkg_dir string, default_arch string) !RepoGroupManager {
if !os.is_dir(repos_dir) {
os.mkdir_all(repos_dir) or { return error('Failed to create repos directory: $err.msg()') }
os.mkdir_all(repos_dir) or {
return error('Failed to create repos directory: ${err.msg()}')
}
}
if !os.is_dir(pkg_dir) {
os.mkdir_all(pkg_dir) or { return error('Failed to create package directory: $err.msg()') }
os.mkdir_all(pkg_dir) or {
return error('Failed to create package directory: ${err.msg()}')
}
}
return RepoGroupManager{
@ -51,7 +55,7 @@ pub fn new(repos_dir string, pkg_dir string, default_arch string) !RepoGroupMana
// the right subdirectories in r.pkg_dir if it was successfully added.
pub fn (r &RepoGroupManager) add_pkg_from_path(repo string, pkg_path string) !RepoAddResult {
pkg := package.read_pkg_archive(pkg_path) or {
return error('Failed to read package file: $err.msg()')
return error('Failed to read package file: ${err.msg()}')
}
archs := r.add_pkg_in_repo(repo, pkg)!
@ -129,7 +133,7 @@ fn (r &RepoGroupManager) add_pkg_in_repo(repo string, pkg &package.Pkg) ![]strin
// files, and afterwards updates the db & files archives to reflect these
// changes.
fn (r &RepoGroupManager) add_pkg_in_arch_repo(repo string, arch string, pkg &package.Pkg) ! {
pkg_dir := os.join_path(r.repos_dir, repo, arch, '$pkg.info.name-$pkg.info.version')
pkg_dir := os.join_path(r.repos_dir, repo, arch, '${pkg.info.name}-${pkg.info.version}')
// Remove the previous version of the package, if present
r.remove_pkg_from_arch_repo(repo, arch, pkg.info.name, false)!