mirror of
https://git.planet-casio.com/Lephenixnoir/GiteaPC.git
synced 2024-12-28 04:23:40 +01:00
Compare commits
2 commits
36bb5ba31e
...
416564d40a
Author | SHA1 | Date | |
---|---|---|---|
|
416564d40a | ||
|
c3b6148d34 |
2 changed files with 14 additions and 5 deletions
|
@ -79,6 +79,10 @@ def print_repo(r, branches=None, tags=None, has_giteapc=True):
|
|||
print(" ->", os.readlink(r.folder))
|
||||
else:
|
||||
print("")
|
||||
print(" {W}Configs:{_}".format(**colors()), end="")
|
||||
for c in r.configs():
|
||||
print(" " + c, end="")
|
||||
print("")
|
||||
branches = r.branches()
|
||||
tags = r.tags()
|
||||
|
||||
|
|
|
@ -57,7 +57,11 @@ class LocalRepo:
|
|||
self.owner, self.name = fullname.split("/")
|
||||
self.folder = REPO_FOLDER + "/" + fullname
|
||||
self.remote = False
|
||||
self.makefile = self.folder + "/giteapc.make"
|
||||
|
||||
if os.path.exists(self.folder + "/.giteapc/giteapc.make"):
|
||||
self.makefile = self.folder + "/.giteapc/giteapc.make"
|
||||
else:
|
||||
self.makefile = self.folder + "/giteapc.make"
|
||||
|
||||
@staticmethod
|
||||
def path(fullname):
|
||||
|
@ -159,16 +163,17 @@ class LocalRepo:
|
|||
command = "make"
|
||||
|
||||
with ChangeDirectory(self.folder):
|
||||
return run([command, "-f", "giteapc.make", target], env=env)
|
||||
return run([command, "-f", self.makefile, target], env=env)
|
||||
|
||||
def configs(self):
|
||||
RE_NAME = re.compile(r'giteapc-config-(.*)\.make')
|
||||
files = glob.glob(self.folder + "/giteapc-config-*.make")
|
||||
files += glob.glob(self.folder + "/.giteapc/giteapc-config-*.make")
|
||||
return sorted(RE_NAME.match(os.path.basename(x))[1] for x in files)
|
||||
|
||||
def set_config(self, config):
|
||||
source = self.folder + f"/giteapc-config.make"
|
||||
target = self.folder + f"/giteapc-config-{config}.make"
|
||||
source = os.path.dirname(self.makefile) + f"/giteapc-config.make"
|
||||
target = os.path.dirname(self.makefile) + f"/giteapc-config-{config}.make"
|
||||
|
||||
if config == "":
|
||||
if os.path.islink(source):
|
||||
|
@ -191,7 +196,7 @@ class LocalRepo:
|
|||
RE_METADATA = re.compile(r'^\s*#\s*giteapc\s*:\s*(.*)$')
|
||||
metadata = dict()
|
||||
|
||||
with open(self.folder + "/giteapc.make", "r") as fp:
|
||||
with open(self.makefile, "r") as fp:
|
||||
makefile = fp.read()
|
||||
|
||||
for line in makefile.split("\n"):
|
||||
|
|
Loading…
Reference in a new issue