Release 0.2.0 #121

Merged
Jef Roosens merged 125 commits from release-0.2.0 into main 2022-04-11 09:41:43 +02:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit ebe01c2d44 - Show all commits

View file

@ -93,7 +93,7 @@ fn build(conf Config) ? {
'source PKGBUILD', 'source PKGBUILD',
// The build container checks whether the package is already // The build container checks whether the package is already
// present on the server // present on the server
'curl --head --fail $conf.address/$repo.repo/$build_arch/\$pkgname-\$pkgver-\$pkgrel-${build_arch}.pkg.tar.zst && exit 0', 'curl --head --fail $conf.address/$repo.repo/$build_arch/\$pkgname-\$pkgver-\$pkgrel && exit 0',
'MAKEFLAGS="-j\$(nproc)" makepkg -s --noconfirm --needed && for pkg in \$(ls -1 *.pkg*); do curl -XPOST -T "\$pkg" -H "X-API-KEY: \$API_KEY" $conf.address/$repo.repo/publish; done', 'MAKEFLAGS="-j\$(nproc)" makepkg -s --noconfirm --needed && for pkg in \$(ls -1 *.pkg*); do curl -XPOST -T "\$pkg" -H "X-API-KEY: \$API_KEY" $conf.address/$repo.repo/publish; done',
] ]

View file

@ -22,7 +22,9 @@ fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Re
db_exts := ['.db', '.files', '.db.tar.gz', '.files.tar.gz'] db_exts := ['.db', '.files', '.db.tar.gz', '.files.tar.gz']
if db_exts.any(filename.ends_with(it)) { // There's no point in having the ability to serve db archives with wrong
// filenames
if db_exts.any(filename == '$repo$it') {
full_path = os.join_path(app.repo.repos_dir, repo, arch, filename) full_path = os.join_path(app.repo.repos_dir, repo, arch, filename)
// repo-add does this using symlinks, but we just change the requested // repo-add does this using symlinks, but we just change the requested
@ -30,8 +32,14 @@ fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Re
if !full_path.ends_with('.tar.gz') { if !full_path.ends_with('.tar.gz') {
full_path += '.tar.gz' full_path += '.tar.gz'
} }
} else { } else if filename.contains('.pkg') {
full_path = os.join_path_single(app.repo.pkg_dir, filename) full_path = os.join_path_single(app.repo.pkg_dir, filename)
// Default behavior is to return the desc file for the package, if present.
// This can then also be used by the build system to properly check whether
// a package is present in an arch-repo.
} else {
full_path = os.join_path(app.repo.repos_dir, repo, arch, filename, 'desc')
} }
// Scuffed way to respond to HEAD requests // Scuffed way to respond to HEAD requests