Skip to content

Commit bfcd4d9

Browse files
committed
scripts/build-deb: support preparing sources via the script
In order to build upstream mesa snapshot we need to manually prepare source directory. Add support for using the external script instead of just fetching the dsc from Debian. Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 95a5a9b commit bfcd4d9

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

scripts/build-deb.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,24 @@
5959
)
6060
print("✅ Checksum of original source package matched.")
6161

62-
# Unpack the source package
63-
subprocess.run(['dpkg-source', '-x', dsc_file], cwd=temp_dir, check=True)
62+
script = config.get('script')
63+
if script:
64+
if not os.path.isabs(script):
65+
config_dir = os.path.dirname(args.config)
66+
script = os.path.abspath(os.path.join(config_dir, script))
67+
68+
env = os.environ.copy()
69+
env['DSC_FILE'] = dsc_file
70+
env.update(config.get('env', {}))
71+
72+
subprocess.run(script, cwd=temp_dir, check=True, env=env)
73+
74+
print("✅ Successfully executed the script.")
75+
else:
76+
# Unpack the source package
77+
subprocess.run(['dpkg-source', '-x', dsc_file],
78+
cwd=temp_dir,
79+
check=True)
6480

6581
# Find the unpacked directory
6682
unpacked_dirs = [

0 commit comments

Comments
 (0)