update, fix

This commit is contained in:
Laura Hausmann 2020-06-26 00:16:53 +02:00
parent 6ca140cbbd
commit e2de7f209e
Signed by: zotan
GPG Key ID: 5EC1D38FFC321311
3 changed files with 10 additions and 6 deletions

View File

@ -39,7 +39,7 @@
{
<td><span class="badge badge-danger">Build failing</span></td>
}
@if (System.IO.File.Exists(System.IO.Path.Combine(Program.Repo._pkgpath, p.Name, "buildlog.txt")))
@if (System.IO.File.Exists(System.IO.Path.Combine(Program.Repo._logpath, $"{p.Name}.log")))
{
<td><a role="button" class="btn btn-sm btn-info" target="_blank" href="/Log?package=@HttpUtility.UrlEncode(p.Name)">View Build log</a></td>
}

View File

@ -6,7 +6,7 @@
Response.Headers["Content-Type"] = "text/plain";
if (Program.Repo._repo.Packages.Any(p => p.Name.Equals(Request.Query["package"])))
{
var logfile = System.IO.Path.Combine(Program.Repo._pkgpath, Request.Query["package"], "buildlog.txt");
var logfile = System.IO.Path.Combine(Program.Repo._logpath, $"{Request.Query["package"]}.log");
if (System.IO.File.Exists(logfile))
{
@Html.Raw(System.IO.File.ReadAllText(logfile))

View File

@ -10,17 +10,21 @@ namespace repomgr {
public class RepoMgr {
public RepoMgr(string buildpath) {
_buildpath = Path.GetFullPath(buildpath);
_pkgpath = Path.Combine(_buildpath, "pkg");
_pkgpath = Path.Combine(_buildpath, "pkg");
_logpath = Path.Combine(_buildpath, "log");
}
public readonly string _buildpath;
public readonly string _pkgpath;
public readonly string _pkgpath;
public readonly string _logpath;
public Repository _repo;
public void Init(string repopath, string reponame) {
_repo = new Repository(repopath, reponame);
if (!Directory.Exists(repopath))
Directory.CreateDirectory(repopath);
if (!Directory.Exists(_logpath))
Directory.CreateDirectory(repopath);
WriteIndex();
Console.WriteLine("Initialized.");
}
@ -70,9 +74,9 @@ namespace repomgr {
package.CurrentVersion = Shell.ExecR("source PKGBUILD; echo \"$pkgver-$pkgrel\"", Path.Combine(_pkgpath, package.Name));
WriteIndex();
if (force)
Shell.Exec("makepkg -Ccsf --sign --noconfirm 2>&1| tee buildlog.txt", Path.Combine(_pkgpath, package.Name));
Shell.Exec($"makepkg -Ccsf --sign --noconfirm 2>&1| tee ../log/{package.Name}.log", Path.Combine(_pkgpath, package.Name));
else if (package.CurrentVersion != package.RepoVersion)
Shell.Exec("makepkg -Ccs --sign --noconfirm 2>&1| tee buildlog.txt", Path.Combine(_pkgpath, package.Name));
Shell.Exec($"makepkg -Ccs --sign --noconfirm 2>&1| tee ../log/{package.Name}.log", Path.Combine(_pkgpath, package.Name));
else
return;