summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-07-12 12:15:06 (GMT)
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-07-13 14:23:29 (GMT)
commitff314df1be6585beb2e40e3f28f6d719a09b76e9 (patch)
tree69fef102b5c2dfcab3b83495c057451791a215a2
parent4e16af96a4f0d9dfd101ec6bf9ce9ea7d76497a4 (diff)
downloaddefinitions-sam/buildstream-2.tar.gz
convert: Improvementssam/buildstream-2
-rwxr-xr-xconvert107
1 files changed, 34 insertions, 73 deletions
diff --git a/convert b/convert
index b4d0a7e..7179ff1 100755
--- a/convert
+++ b/convert
@@ -1,83 +1,44 @@
#!/usr/bin/bash
+set -eu
+
# Hacked up script to produce BuildStream conversions of some Baserock systems.
CONVERTER=../defs2bst/defs2bst.py
YBD=../ybd/ybd.py
-mkdir -p elements
+mkdir -p elements/
+mkdir -p elements/systems/
# Convert a selection of the Baserock x86_64 reference systems.
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- systems/base-system-x86_64-generic.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- systems/build-system-x86_64.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- systems/devel-system-x86_64-generic.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- systems/minimal-system-x86_64-generic.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- gnome/systems/gnome-system-x86_64.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- ivi/systems/ivi-system-x86_64.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- trove/systems/trove-system-x86_64.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- weston/systems/weston-system-x86_64.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- weston/systems/weston-qt5-system-x86_64.morph x86_64
-
-$CONVERTER --ybd $YBD \
- --definitions ./old \
- --output ./elements \
- --rebase strata/build-essential.morph gnu-toolchain.bst \
- unmaintained/systems/openstack-system-x86_64.morph x86_64
-
-mkdir -p elements/systems
-
-mv elements/base-system-x86_64-generic-content.bst elements/systems/base-system-content.bst
-mv elements/build-system-x86_64-content.bst elements/systems/build-system-content.bst
-mv elements/devel-system-x86_64-generic-content.bst elements/systems/devel-system-content.bst
-mv elements/minimal-system-x86_64-generic-content.bst elements/systems/minimal-system-content.bst
-mv elements/gnome/gnome-system-x86_64-content.bst elements/systems/gnome-system-content.bst
-mv elements/ivi/ivi-system-x86_64-content.bst elements/systems/ivi-system-content.bst
-mv elements/trove/trove-system-x86_64-content.bst elements/systems/trove-system-content.bst
-mv elements/weston/weston-system-x86_64-content.bst elements/systems/weston-system-content.bst
-mv elements/weston/weston-qt5-system-x86_64-content.bst elements/systems/weston-qt5-system-content.bst
-mv elements/unmaintained/openstack-system-x86_64.bst elements/systems/openstack-system-content.bst
+systems="
+ systems/base-system-x86_64-generic.morph
+ systems/build-system-x86_64.morph
+ systems/devel-system-x86_64-generic.morph
+ systems/minimal-system-x86_64-generic.morph
+ gnome/systems/gnome-system-x86_64.morph
+ genivi/systems/genivi-demo-platform-x86_64-generic.morph
+ ivi/systems/ivi-system-x86_64.morph
+ trove/systems/trove-system-x86_64.morph
+ weston/systems/weston-system-x86_64-generic.morph
+ weston/systems/weston-qt5-system-x86_64.morph
+ unmaintained/systems/openstack-system-x86_64.morph"
+
+for baserock_system in $systems; do
+ $CONVERTER --ybd $YBD \
+ --definitions ./old \
+ --output ./elements \
+ --rebase strata/build-essential.morph gnu-toolchain.bst \
+ $baserock_system x86_64
+
+ buildstream_system_initial=$(echo $baserock_system | sed -e 's@systems/@@' -e 's@\.morph$@-content.bst@')
+
+ # Remove x86_64 from the name; BuildStream allows architecture conditionals
+ # so we don't need to duplicate everything per platform.
+ # Take the opportunity to remove -generic as well.
+ buildstream_system=$(basename $buildstream_system_initial | sed -e 's@-x86_64@@' -e 's@-generic@@')
+
+ # All systems go in their own subdirectory
+ mv elements/$buildstream_system_initial elements/systems/$buildstream_system
+done