update, fix
This commit is contained in:
parent
6ca140cbbd
commit
e2de7f209e
|
@ -39,7 +39,7 @@
|
||||||
{
|
{
|
||||||
<td><span class="badge badge-danger">Build failing</span></td>
|
<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>
|
<td><a role="button" class="btn btn-sm btn-info" target="_blank" href="/Log?package=@HttpUtility.UrlEncode(p.Name)">View Build log</a></td>
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
Response.Headers["Content-Type"] = "text/plain";
|
Response.Headers["Content-Type"] = "text/plain";
|
||||||
if (Program.Repo._repo.Packages.Any(p => p.Name.Equals(Request.Query["package"])))
|
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))
|
if (System.IO.File.Exists(logfile))
|
||||||
{
|
{
|
||||||
@Html.Raw(System.IO.File.ReadAllText(logfile))
|
@Html.Raw(System.IO.File.ReadAllText(logfile))
|
||||||
|
|
|
@ -11,16 +11,20 @@ namespace repomgr {
|
||||||
public RepoMgr(string buildpath) {
|
public RepoMgr(string buildpath) {
|
||||||
_buildpath = Path.GetFullPath(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 _buildpath;
|
||||||
public readonly string _pkgpath;
|
public readonly string _pkgpath;
|
||||||
|
public readonly string _logpath;
|
||||||
public Repository _repo;
|
public Repository _repo;
|
||||||
|
|
||||||
public void Init(string repopath, string reponame) {
|
public void Init(string repopath, string reponame) {
|
||||||
_repo = new Repository(repopath, reponame);
|
_repo = new Repository(repopath, reponame);
|
||||||
if (!Directory.Exists(repopath))
|
if (!Directory.Exists(repopath))
|
||||||
Directory.CreateDirectory(repopath);
|
Directory.CreateDirectory(repopath);
|
||||||
|
if (!Directory.Exists(_logpath))
|
||||||
|
Directory.CreateDirectory(repopath);
|
||||||
WriteIndex();
|
WriteIndex();
|
||||||
Console.WriteLine("Initialized.");
|
Console.WriteLine("Initialized.");
|
||||||
}
|
}
|
||||||
|
@ -70,9 +74,9 @@ namespace repomgr {
|
||||||
package.CurrentVersion = Shell.ExecR("source PKGBUILD; echo \"$pkgver-$pkgrel\"", Path.Combine(_pkgpath, package.Name));
|
package.CurrentVersion = Shell.ExecR("source PKGBUILD; echo \"$pkgver-$pkgrel\"", Path.Combine(_pkgpath, package.Name));
|
||||||
WriteIndex();
|
WriteIndex();
|
||||||
if (force)
|
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)
|
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
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue