Skip to content

Commit

Permalink
Merge pull request #301 from mid-kid/pr-subproject-lock
Browse files Browse the repository at this point in the history
Specify exact commit in subproject files
  • Loading branch information
lhearachel authored Nov 13, 2024
2 parents 44bc33a + b340dbc commit 6544b87
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 5 deletions.
3 changes: 2 additions & 1 deletion subprojects/NitroDWC.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[wrap-git]
url = https://github.com/Nomura-RH/NitroDWC.git
revision = main
revision = 8220c8bdec2e8b5252ee710cf3cc0c148228a03a
depth = 1
directory = NitroDWC-2.2.30008

[provide]
dependency_names = NitroDWC

3 changes: 2 additions & 1 deletion subprojects/NitroSDK.wrap
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[wrap-git]
url = https://github.com/Nomura-RH/NitroSDK.git
revision = main
revision = 0082ec3dd5e951a7ee7c2067595a4fa0e9496d36
depth = 1
directory = NitroSDK-4.2.30001

[provide]
dependency_names = NitroSDK
program_names = makelcf

3 changes: 2 additions & 1 deletion subprojects/NitroSystem.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[wrap-git]
url = https://github.com/Nomura-RH/NitroSystem.git
revision = main
revision = 507acff1585505bdac3f996551ca5123f8408073
depth = 1
directory = NitroSystem-071126.1

[provide]
dependency_names = NitroSystem

3 changes: 2 additions & 1 deletion subprojects/NitroWiFi.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[wrap-git]
url = https://github.com/Nomura-RH/NitroWiFi.git
revision = main
revision = 0d74e5de275952680962237da9d592e80815679a
depth = 1
directory = NitroWiFi-2.1.30003

[provide]
dependency_names = NitroWiFi

3 changes: 2 additions & 1 deletion subprojects/libvct.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[wrap-git]
url = https://github.com/Nomura-RH/libvct.git
revision = main
revision = dd9f89d7c0a52e74a3c4b25552ea05cdc127a011
depth = 1
directory = libvct-1.3.1

[provide]
dependency_names = libvct

14 changes: 14 additions & 0 deletions subprojects/update.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[NitroDWC]
revision = main

[NitroSDK]
revision = main

[NitroSystem]
revision = main

[NitroWiFi]
revision = main

[libvct]
revision = main
27 changes: 27 additions & 0 deletions subprojects/update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3

from configparser import ConfigParser
from subprocess import run
from os.path import dirname, realpath, join

def update_wrap(wrap, revision):
cfg = ConfigParser()
cfg.read(wrap)
git = cfg["wrap-git"]
url = git["url"]
cmd = run(["git", "ls-remote", url, revision],
check=True, capture_output=True)
rev = cmd.stdout.decode().split()[0]
print(" - Revision:", rev)
git["revision"] = rev
with open(wrap, "w") as f:
cfg.write(f)

if __name__ == "__main__":
subprojects = dirname(realpath(__file__))
cfg = ConfigParser()
cfg.read(join(subprojects, "update.ini"))
for wrap in cfg.sections():
print("Updating:", wrap)
revision = cfg[wrap]["revision"]
update_wrap(join(subprojects, wrap + ".wrap"), revision)

0 comments on commit 6544b87

Please sign in to comment.