Commit 693e8e85 authored by Felix Exner's avatar Felix Exner Committed by Oskar Roesler
Browse files

Log build output into file if no verbose mode

parent fb06179d
from datetime import datetime
import subprocess
import os
import sys
......@@ -24,6 +25,10 @@ class Packages(Routines):
self.localrepo_path = os.path.join(self.cache_path, 'repo')
self.log_root = os.path.join(self.cache_path, 'logs')
def makepkg(self):
if os.path.isfile(os.path.join(self.pkgrepo_path, "PKGBUILD")):
......@@ -32,9 +37,12 @@ class Packages(Routines):
check=True)[MAKECHROOTPKG_BIN, '-c', '-d', self.localrepo_path, '-r',
self.chroot], stdout=(None if self.verbosity else subprocess.DEVNULL),
stderr=subprocess.STDOUT, cwd=self.pkgrepo_path, check=True)
now =
with open(os.path.join(self.log_root, self.package + "_"
+ now.strftime("%Y%m%d_%H%M%S")), 'w') as log:[MAKECHROOTPKG_BIN, '-c', '-d', self.localrepo_path, '-r',
self.chroot], stdout=(None if self.verbosity else log),
stderr=subprocess.STDOUT, cwd=self.pkgrepo_path, check=True)
with open("success.txt", "a") as fobj:
fobj.write(self.package + "\n")
if self.output:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment