From 3900a1ef183757de4a11445df10d8df83752eabc Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 12 Jul 2010 09:51:15 +0200 Subject: [PATCH] [molecule.plugins] in remaster_plugin, tar_plugin add support for release_version, release_desc, release_string, release_file metadata --- examples/specs/5-x86-g-remaster-add-games.spec | 12 ++++++++++++ examples/specs/sabayon/lxde.common | 6 ++++++ .../specs/sabayon/sabayon-amd64-corecdx.spec | 8 ++++++-- examples/specs/sabayon/sabayon-amd64-lxde.spec | 6 ++++++ examples/specs/sabayon/sabayon-amd64-xfce.spec | 6 ++++++ examples/specs/sabayon/sabayon-x86-corecdx.spec | 8 ++++++-- examples/specs/sabayon/sabayon-x86-lxde.spec | 6 ++++++ examples/specs/sabayon/sabayon-x86-xfce.spec | 6 ++++++ examples/specs/sabayon/xfce.common | 6 ++++++ molecule/specs/plugins/remaster_plugin.py | 16 ++++++++++++++++ molecule/specs/plugins/tar_plugin.py | 16 ++++++++++++++++ 11 files changed, 92 insertions(+), 4 deletions(-) diff --git a/examples/specs/5-x86-g-remaster-add-games.spec b/examples/specs/5-x86-g-remaster-add-games.spec index 709166e..4b40b0d 100644 --- a/examples/specs/5-x86-g-remaster-add-games.spec +++ b/examples/specs/5-x86-g-remaster-add-games.spec @@ -15,6 +15,18 @@ prechroot: linux32 # Path to source ISO file (MANDATORY) source_iso: /sabayon/iso_images/Sabayon_5.0_G.iso +# Release Version +# release_version: 5.0 + +# Release Version string description +# release_desc: amd64 GAMING + +# Release string +# release_string: Sabayon Linux + +# Release file (inside chroot) +# release_file: /etc/sabayon-edition + # Error script command, executed when something went wrong and molecule has to terminate the execution # environment variables exported: # - CHROOT_DIR: path to chroot directory, if any diff --git a/examples/specs/sabayon/lxde.common b/examples/specs/sabayon/lxde.common index d7cceb4..8beca96 100644 --- a/examples/specs/sabayon/lxde.common +++ b/examples/specs/sabayon/lxde.common @@ -5,6 +5,12 @@ execution_strategy: iso_remaster # ISO Image title iso_title: Sabayon LXDE +# Release string +release_string: Sabayon Linux + +# File to write release string +release_file: /etc/sabayon-edition + # Outer chroot script command, to be executed outside destination chroot before # before entering it (and before inner_chroot_script) outer_chroot_script: /sabayon/scripts/remaster_pre.sh diff --git a/examples/specs/sabayon/sabayon-amd64-corecdx.spec b/examples/specs/sabayon/sabayon-amd64-corecdx.spec index f9e467e..153b7b5 100644 --- a/examples/specs/sabayon/sabayon-amd64-corecdx.spec +++ b/examples/specs/sabayon/sabayon-amd64-corecdx.spec @@ -1,10 +1,14 @@ # Use abs path, otherwise daily iso build won't work %import /sabayon/molecules/corecdx.common -release_desc: amd64 CoreCDX - # Path to source ISO file (MANDATORY) source_iso: /sabayon/iso/Sabayon_Linux_SpinBase_DAILY_amd64.iso +# Release Version +release_version: 5.4 + +# Release Version string description +release_desc: amd64 CoreCDX + # Destination ISO image name, call whatever you want.iso, not mandatory destination_iso_image_name: Sabayon_Linux_CoreCDX_5.3_amd64.iso diff --git a/examples/specs/sabayon/sabayon-amd64-lxde.spec b/examples/specs/sabayon/sabayon-amd64-lxde.spec index ef7e051..ef0e189 100644 --- a/examples/specs/sabayon/sabayon-amd64-lxde.spec +++ b/examples/specs/sabayon/sabayon-amd64-lxde.spec @@ -4,5 +4,11 @@ # Path to source ISO file (MANDATORY) source_iso: /sabayon/iso/Sabayon_Linux_SpinBase_DAILY_amd64.iso +# Release Version +release_version: 5.4 + +# Release Version string description +release_desc: amd64 LXDE + # Destination ISO image name, call whatever you want.iso, not mandatory destination_iso_image_name: Sabayon_Linux_5.3_amd64_LXDE.iso diff --git a/examples/specs/sabayon/sabayon-amd64-xfce.spec b/examples/specs/sabayon/sabayon-amd64-xfce.spec index 746104d..6880aeb 100644 --- a/examples/specs/sabayon/sabayon-amd64-xfce.spec +++ b/examples/specs/sabayon/sabayon-amd64-xfce.spec @@ -4,5 +4,11 @@ # Path to source ISO file (MANDATORY) source_iso: /sabayon/iso/Sabayon_Linux_SpinBase_DAILY_amd64.iso +# Release Version +release_version: 5.4 + +# Release Version string description +release_desc: amd64 XFCE + # Destination ISO image name, call whatever you want.iso, not mandatory destination_iso_image_name: Sabayon_Linux_5.3_amd64_XFCE.iso diff --git a/examples/specs/sabayon/sabayon-x86-corecdx.spec b/examples/specs/sabayon/sabayon-x86-corecdx.spec index 1b0d592..49219b1 100644 --- a/examples/specs/sabayon/sabayon-x86-corecdx.spec +++ b/examples/specs/sabayon/sabayon-x86-corecdx.spec @@ -1,12 +1,16 @@ # use abs path, otherwise daily iso build automagic won't work %import /sabayon/molecules/corecdx.common -release_desc: x86 CoreCDX - # pre chroot command, example, for 32bit chroots on 64bit system, you always # have to append "linux32" this is useful for inner_chroot_script prechroot: linux32 +# Release Version +release_version: 5.4 + +# Release Version string description +release_desc: x86 CoreCDX + # Path to source ISO file (MANDATORY) source_iso: /sabayon/iso/Sabayon_Linux_SpinBase_DAILY_x86.iso diff --git a/examples/specs/sabayon/sabayon-x86-lxde.spec b/examples/specs/sabayon/sabayon-x86-lxde.spec index d85205d..31ef3cc 100644 --- a/examples/specs/sabayon/sabayon-x86-lxde.spec +++ b/examples/specs/sabayon/sabayon-x86-lxde.spec @@ -4,6 +4,12 @@ # 32bit chroot prechroot: linux32 +# Release Version +release_version: 5.4 + +# Release Version string description +release_desc: x86 LXDE + # Path to source ISO file (MANDATORY) source_iso: /sabayon/iso/Sabayon_Linux_SpinBase_DAILY_x86.iso diff --git a/examples/specs/sabayon/sabayon-x86-xfce.spec b/examples/specs/sabayon/sabayon-x86-xfce.spec index 157ca9d..73540f5 100644 --- a/examples/specs/sabayon/sabayon-x86-xfce.spec +++ b/examples/specs/sabayon/sabayon-x86-xfce.spec @@ -4,6 +4,12 @@ # 32bit chroot prechroot: linux32 +# Release Version +release_version: 5.4 + +# Release Version string description +release_desc: x86 XFCE + # Path to source ISO file (MANDATORY) source_iso: /sabayon/iso/Sabayon_Linux_SpinBase_DAILY_x86.iso diff --git a/examples/specs/sabayon/xfce.common b/examples/specs/sabayon/xfce.common index 6068b0d..7d125f9 100644 --- a/examples/specs/sabayon/xfce.common +++ b/examples/specs/sabayon/xfce.common @@ -5,6 +5,12 @@ execution_strategy: iso_remaster # ISO Image title iso_title: Sabayon XFCE +# Release string +release_string: Sabayon Linux + +# File to write release string +release_file: /etc/sabayon-edition + # Outer chroot script command, to be executed outside destination chroot before # before entering it (and before inner_chroot_script) outer_chroot_script: /sabayon/scripts/remaster_pre.sh diff --git a/molecule/specs/plugins/remaster_plugin.py b/molecule/specs/plugins/remaster_plugin.py index 83588b7..b0a7367 100644 --- a/molecule/specs/plugins/remaster_plugin.py +++ b/molecule/specs/plugins/remaster_plugin.py @@ -328,6 +328,22 @@ class RemasterSpec(GenericSpec): 'cb': self.valid_exec_first_list_item, 've': self.ve_string_splitter, }, + 'release_string': { + 'cb': self.ne_string, # validation callback + 've': self.ve_string_stripper, # value extractor + }, + 'release_version': { + 'cb': self.ne_string, + 've': self.ve_string_stripper, + }, + 'release_desc': { + 'cb': self.ne_string, + 've': self.ve_string_stripper, + }, + 'release_file': { + 'cb': self.ne_string, + 've': self.ve_string_stripper, + }, 'source_iso': { 'cb': self.valid_path_string, 've': self.ve_string_stripper, diff --git a/molecule/specs/plugins/tar_plugin.py b/molecule/specs/plugins/tar_plugin.py index 8c53b63..ec09dac 100644 --- a/molecule/specs/plugins/tar_plugin.py +++ b/molecule/specs/plugins/tar_plugin.py @@ -129,6 +129,22 @@ class IsoToTarSpec(GenericSpec): 'cb': self.valid_exec_first_list_item, 've': self.ve_string_splitter, }, + 'release_string': { + 'cb': self.ne_string, # validation callback + 've': self.ve_string_stripper, # value extractor + }, + 'release_version': { + 'cb': self.ne_string, + 've': self.ve_string_stripper, + }, + 'release_desc': { + 'cb': self.ne_string, + 've': self.ve_string_stripper, + }, + 'release_file': { + 'cb': self.ne_string, + 've': self.ve_string_stripper, + }, 'source_iso': { 'cb': self.valid_path_string, 've': self.ve_string_stripper,