Skip to content

Commit

Permalink
Set DISTRIBUTION= and RELEASE= when invoking scripts
Browse files Browse the repository at this point in the history
Until now once could simply source /etc/os-release to figure this
out but this is not possible in sync scripts, so add two new env
variables to expose the distribution and release config options.
  • Loading branch information
DaanDeMeyer authored and behrmann committed Feb 23, 2024
1 parent aedcd51 commit 5597b39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ def run_sync_scripts(context: Context) -> None:
return

env = dict(
DISTRIBUTION=str(context.config.distribution),
RELEASE=context.config.release,
ARCHITECTURE=str(context.config.architecture),
SRCDIR="/work/src",
MKOSI_UID=str(INVOKING_USER.uid),
Expand Down Expand Up @@ -466,6 +468,8 @@ def run_prepare_scripts(context: Context, build: bool) -> None:
return

env = dict(
DISTRIBUTION=str(context.config.distribution),
RELEASE=context.config.release,
ARCHITECTURE=str(context.config.architecture),
BUILDROOT=str(context.root),
SRCDIR="/work/src",
Expand Down Expand Up @@ -536,6 +540,8 @@ def run_build_scripts(context: Context) -> None:
return

env = dict(
DISTRIBUTION=str(context.config.distribution),
RELEASE=context.config.release,
ARCHITECTURE=str(context.config.architecture),
BUILDROOT=str(context.root),
DESTDIR="/work/dest",
Expand Down Expand Up @@ -623,6 +629,8 @@ def run_postinst_scripts(context: Context) -> None:
return

env = dict(
DISTRIBUTION=str(context.config.distribution),
RELEASE=context.config.release,
ARCHITECTURE=str(context.config.architecture),
BUILDROOT=str(context.root),
OUTPUTDIR="/work/out",
Expand Down Expand Up @@ -685,6 +693,8 @@ def run_finalize_scripts(context: Context) -> None:
return

env = dict(
DISTRIBUTION=str(context.config.distribution),
RELEASE=context.config.release,
ARCHITECTURE=str(context.config.architecture),
BUILDROOT=str(context.root),
OUTPUTDIR="/work/out",
Expand Down

0 comments on commit 5597b39

Please sign in to comment.