forked from ubuntu/gnome-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing dependencies and a tool to check it
- Loading branch information
1 parent
7f7aae4
commit 2070ba6
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import yaml | ||
|
||
# Ensure that "deb" part depends on all previous parts | ||
|
||
config_file = "snapcraft.yaml" | ||
if not os.path.exists(config_file): | ||
config_file = os.path.join("snap", "snapcraft.yaml") | ||
|
||
data = yaml.safe_load(open(config_file, "r")) | ||
|
||
parts = {} | ||
|
||
for part in data['parts']: | ||
if part == "debs": | ||
break | ||
parts[part] = False | ||
|
||
def filldeps(part): | ||
global data | ||
global parts | ||
if 'after' not in data['parts'][part]: | ||
return | ||
|
||
deps = data['parts'][part]['after'] | ||
for dep in deps: | ||
parts[dep] = True | ||
filldeps(dep) | ||
|
||
filldeps("debs") | ||
failed = False | ||
for part in parts: | ||
if parts[part]: | ||
continue | ||
print(f"DEBS must depend on {part}") | ||
failed = True | ||
|
||
if failed: | ||
sys.exit(1) | ||
print("All dependencies are correct") |