Browse Source

build: remember configuration after building

master
Lephenixnoir 7 months ago
parent
commit
0ecfed4351
Signed by untrusted user: Lephenixnoir GPG Key ID: 1BBA026E13FC0495
  1. 1
      .gitignore
  2. 4
      giteapc.make
  3. 3
      giteapc/repo.py
  4. 8
      giteapc/repos.py

1
.gitignore

@ -1,2 +1,3 @@
__pycache__
giteapc-config.make
giteapc-config-*.make

4
giteapc.make

@ -1,8 +1,6 @@
# giteapc: version=1
ifneq ($(GITEAPC_CONFIG),)
include giteapc-config-$(GITEAPC_CONFIG).make
endif
-include giteapc-config.make
configure:
@ true

3
giteapc/repo.py

@ -286,7 +286,8 @@ def build(*args, install=False, skip_configure=False):
env = os.environ.copy()
if s.config:
env["GITEAPC_CONFIG"] = config
env["GITEAPC_CONFIG"] = s.config
r.set_config(s.config)
env["GITEAPC_PREFIX"] = PREFIX_FOLDER
if not skip_configure:

8
giteapc/repos.py

@ -141,6 +141,14 @@ class LocalRepo:
with ChangeDirectory(self.folder):
return run(["make", "-f", "giteapc.make", target], env=env)
def set_config(self, config):
source = self.folder + f"/giteapc-config.make"
target = self.folder + f"/giteapc-config-{config}.make"
if os.path.exists(source):
os.remove(source)
os.symlink(target, source)
# Metadata
def metadata(self):

Loading…
Cancel
Save