From c667b8149438117062cdf9e92139ee935bb3c082 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <karel.koci@nic.cz>
Date: Thu, 16 May 2019 11:06:27 +0200
Subject: [PATCH] lists: Report target Turris OS

This should help us to debug system configuration better to see what
exactly was targeted version. This also helps users to see what they are
dealing with. It in some sense informs them if they are upgrading to new
version or if that is just packages change (because of configuration
change) in same release.
---
 generate_lists          | 1 +
 lists/repository.lua.m4 | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/generate_lists b/generate_lists
index a092e118d..35ecb3c4b 100755
--- a/generate_lists
+++ b/generate_lists
@@ -72,6 +72,7 @@ mkdir -p "$output_path"
 
 listsdir="$tb/lists$obsolete"
 m4args=( "--include=$listsdir" "-D_INCLUDE_=$listsdir/" "-D_FEEDS_=$tb/feeds.conf" )
+m4args+=( "-D_TURRIS_OS_VERSION_=$("${0%/*}/helpers/turris-version.sh" version)" )
 
 find "$listsdir" -name '*.lua.m4' -print0 | while read -r -d '' f; do
 	output="$output_path/${f##$listsdir/}"
diff --git a/lists/repository.lua.m4 b/lists/repository.lua.m4
index 07c488030..02299b1f1 100644
--- a/lists/repository.lua.m4
+++ b/lists/repository.lua.m4
@@ -14,3 +14,6 @@ for _, feed in ipairs(feeds) do
 	-- Standard Turris OS package repository
 	Repository(feed, rroot .. "/packages/" .. feed)
 end
+
+INFO("Target Turris OS: _TURRIS_OS_VERSION_")
+DBG("Current Turris OS: " .. tostring(os_release.VERSION))
-- 
GitLab