From f13017d0674f5bc61ad4ae1f5e7a4888ed9ef6c1 Mon Sep 17 00:00:00 2001
From: Sebastien Luttringer <sebastien.luttringer@smartjog.com>
Date: Thu, 13 Oct 2011 16:10:14 +0200
Subject: [PATCH] Add isversion inside images

Add a isversion field inside isimage which tell which version of installsystems was used to build image
---
 installsystems/image.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/installsystems/image.py b/installsystems/image.py
index 844adb0..2f6e353 100644
--- a/installsystems/image.py
+++ b/installsystems/image.py
@@ -19,6 +19,7 @@ import shutil
 import gzip
 import gzipstream #until python support gzip not seekable
 import cStringIO
+import installsystems
 import installsystems.template as istemplate
 import installsystems.tools as istools
 from installsystems.printer import *
@@ -320,6 +321,8 @@ class SourceImage(Image):
         # timestamp image
         arrow("Timestamping")
         desc["date"] = int(time.time())
+        # watermark
+        desc["isversion"] = installsystems.version
         # append payload infos
         arrow("Checksumming")
         desc["payload"] = {}
@@ -486,6 +489,11 @@ class PackageImage(Image):
         out('#yellow#Date:#reset# %s' % time.ctime(self.date))
         out('#yellow#Description:#reset# %s' % self.description)
         out('#yellow#Author:#reset# %s' % self.author)
+        # field isversion is new in version 5. I can be absent.
+        try:
+            out('#yellow#IS version:#reset# %s' % self.isversion)
+        except AttributeError:
+            pass
         out('#yellow#MD5:#reset# %s' % self.md5)
         if verbose:
             payloads = self.payload
-- 
GitLab