From 48fa680ef5982cc59d1f4683aeed2865be7225bf Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Mon, 26 Nov 2012 17:40:47 +0000 Subject: Add a target to normalize json And run it --- diff --git a/Makefile b/Makefile index f8e002c..e80ab2f 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ HELPERS_DIR=$(COMMANDS_DIR)/helpers all: build +include Makefile.config include Makefile.commands include Makefile.helpers include Makefile.buildbot diff --git a/Makefile.config b/Makefile.config new file mode 100644 index 0000000..dde82f2 --- /dev/null +++ b/Makefile.config @@ -0,0 +1,32 @@ +JSON_NORMALIZE=$(HELPERS_DIR)/json-normalize + +CONFIG_DEPS_DIR=config/deps + +CONFIG_DEPS= \ + $(CONFIG_DEPS_DIR)/prerequisites.json \ + $(CONFIG_DEPS_DIR)/sugar-build.json \ + $(CONFIG_DEPS_DIR)/sugar-buildtime-3.4.json \ + $(CONFIG_DEPS_DIR)/sugar-buildtime-3.6.json \ + $(CONFIG_DEPS_DIR)/sugar-runtime-3.4.json \ + $(CONFIG_DEPS_DIR)/sugar-runtime-3.6.json \ + $(CONFIG_DEPS_DIR)/system.json + +CONFIG_MODULES_DIR=config/modules + +CONFIG_MODULES= \ + $(CONFIG_MODULES_DIR)/activities.json \ + $(CONFIG_MODULES_DIR)/sugar.json \ + $(CONFIG_MODULES_DIR)/system-3.4.json \ + $(CONFIG_MODULES_DIR)/system-3.6.json + +CONFIG_PACKAGES_DIR=config/packages + +OONFIG_PACKAGES= \ + $(CONFIG_PACKAGES_DIR)/basesystem.json \ + $(CONFIG_PACKAGES_DIR)/buildslave.json \ + $(CONFIG_PACKAGES_DIR)/deps-3.4.json \ + $(CONFIG_PACKAGES_DIR)/deps-3.6.json + +json-normalize: + @$(JSON_NORMALIZE) $(CONFIG_MODULES) $(OONFIG_PACKAGES) + @$(JSON_NORMALIZE) --sort-by name $(CONFIG_DEPS) diff --git a/commands/helpers/json-normalize b/commands/helpers/json-normalize new file mode 100755 index 0000000..ec6bd0f --- /dev/null +++ b/commands/helpers/json-normalize @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import argparse +import json +from operator import itemgetter + +parser = argparse.ArgumentParser() +parser.add_argument("paths", nargs="+", help="path to the json file") +parser.add_argument("--sort-by", help="dictionary key to sort by") +args = parser.parse_args() + +for path in args.paths: + in_file = open(path, "rb") + data = json.load(in_file) + in_file.close() + + if args.sort_by is not None: + data.sort(key=itemgetter(args.sort_by)) + + out_file = open(path, "wb") + json.dump(data, out_file, sort_keys=True, indent=4) + out_file.write('\n') + out_file.close() diff --git a/config/deps/prerequisites.json b/config/deps/prerequisites.json index d1ade06..b055a68 100644 --- a/config/deps/prerequisites.json +++ b/config/deps/prerequisites.json @@ -9,4 +9,4 @@ "checker": "binary", "name": "pkg-config" } -] \ No newline at end of file +] diff --git a/config/deps/sugar-build.json b/config/deps/sugar-build.json index 0bec31b..993a379 100644 --- a/config/deps/sugar-build.json +++ b/config/deps/sugar-build.json @@ -49,4 +49,4 @@ "checker": "binary", "name": "xz" } -] \ No newline at end of file +] diff --git a/config/deps/sugar-buildtime-3.4.json b/config/deps/sugar-buildtime-3.4.json index 2a56c4f..6be6ac4 100644 --- a/config/deps/sugar-buildtime-3.4.json +++ b/config/deps/sugar-buildtime-3.4.json @@ -124,4 +124,4 @@ "checker": "binary", "name": "xrdb" } -] \ No newline at end of file +] diff --git a/config/deps/sugar-buildtime-3.6.json b/config/deps/sugar-buildtime-3.6.json index 3c3a0dd..71df305 100644 --- a/config/deps/sugar-buildtime-3.6.json +++ b/config/deps/sugar-buildtime-3.6.json @@ -134,4 +134,4 @@ "checker": "binary", "name": "xrdb" } -] \ No newline at end of file +] diff --git a/config/deps/sugar-runtime-3.4.json b/config/deps/sugar-runtime-3.4.json index 7baf0ef..860742f 100644 --- a/config/deps/sugar-runtime-3.4.json +++ b/config/deps/sugar-runtime-3.4.json @@ -154,4 +154,4 @@ "checker": "python", "name": "xapian python" } -] \ No newline at end of file +] diff --git a/config/deps/sugar-runtime-3.6.json b/config/deps/sugar-runtime-3.6.json index 21dab06..5401991 100644 --- a/config/deps/sugar-runtime-3.6.json +++ b/config/deps/sugar-runtime-3.6.json @@ -169,4 +169,4 @@ "checker": "python", "name": "xapian python" } -] \ No newline at end of file +] diff --git a/config/deps/system.json b/config/deps/system.json index 5369c95..9c76096 100644 --- a/config/deps/system.json +++ b/config/deps/system.json @@ -54,4 +54,4 @@ "checker": "binary", "name": "yasm" } -] \ No newline at end of file +] diff --git a/config/modules/activities.json b/config/modules/activities.json index 1e4e094..4766f7f 100644 --- a/config/modules/activities.json +++ b/config/modules/activities.json @@ -1,29 +1,46 @@ -[{ "name": "browse", - "repo": "git://git.sugarlabs.org/browse/mainline.git", - "out-of-source": false }, - { "name": "chat", - "repo": "git://git.sugarlabs.org/chat/mainline.git", - "branch": "gtk3", - "out-of-source": false }, - { "name": "read", - "repo": "git://git.sugarlabs.org/read/mainline.git", - "out-of-source": false }, - { "name": "log", - "repo": "git://git.sugarlabs.org/log/mainline.git", - "out-of-source": false }, - { "name": "terminal", - "repo": "git://git.sugarlabs.org/terminal/mainline.git", - "branch": "gtk3", - "out-of-source": false }, - { "name": "pippy", - "repo": "git://git.sugarlabs.org/pippy/mainline.git", - "branch": "gtk3", - "out-of-source": false }, - { "name": "imageviewer", - "repo": "git://git.sugarlabs.org/imageviewer/mainline.git", - "branch": "gtk3", - "out-of-source": false }, - { "name": "jukebox", - "repo": "git://git.sugarlabs.org/jukebox/mainline.git", - "out-of-source": false } +[ + { + "name": "browse", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/browse/mainline.git" + }, + { + "branch": "gtk3", + "name": "chat", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/chat/mainline.git" + }, + { + "name": "read", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/read/mainline.git" + }, + { + "name": "log", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/log/mainline.git" + }, + { + "branch": "gtk3", + "name": "terminal", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/terminal/mainline.git" + }, + { + "branch": "gtk3", + "name": "pippy", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/pippy/mainline.git" + }, + { + "branch": "gtk3", + "name": "imageviewer", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/imageviewer/mainline.git" + }, + { + "name": "jukebox", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/jukebox/mainline.git" + } ] diff --git a/config/modules/sugar.json b/config/modules/sugar.json index 6511ee3..511455a 100644 --- a/config/modules/sugar.json +++ b/config/modules/sugar.json @@ -1,21 +1,46 @@ -[{ "name": "sugar-docs", - "repo": "git://git.sugarlabs.org/sugar-docs/sugar-docs.git", - "out-of-source": false }, - { "name": "sugar-base", - "repo": "git://git.sugarlabs.org/sugar-base/mainline.git" }, - { "name": "sugar-toolkit", - "repo": "git://git.sugarlabs.org/sugar-toolkit/mainline.git" }, - { "name": "sugar-toolkit-gtk3", - "repo": "git://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3.git", - "auto-install": ["src"] }, - { "name": "sugar", - "repo": "git://git.sugarlabs.org/sugar/mainline.git", - "auto-install": ["src", "extensions"] }, - { "name": "sugar-artwork", - "repo": "git://git.sugarlabs.org/sugar-artwork/mainline.git" }, - { "name": "sugar-datastore", - "repo": "git://git.sugarlabs.org/sugar-datastore/mainline.git", - "auto-install": ["src"] }, - { "name": "gst-plugins-espeak", - "repo": "git://git.sugarlabs.org/gst-plugins-espeak/mainline.git", - "out-of-source": false }] +[ + { + "name": "sugar-docs", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/sugar-docs/sugar-docs.git" + }, + { + "name": "sugar-base", + "repo": "git://git.sugarlabs.org/sugar-base/mainline.git" + }, + { + "name": "sugar-toolkit", + "repo": "git://git.sugarlabs.org/sugar-toolkit/mainline.git" + }, + { + "auto-install": [ + "src" + ], + "name": "sugar-toolkit-gtk3", + "repo": "git://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3.git" + }, + { + "auto-install": [ + "src", + "extensions" + ], + "name": "sugar", + "repo": "git://git.sugarlabs.org/sugar/mainline.git" + }, + { + "name": "sugar-artwork", + "repo": "git://git.sugarlabs.org/sugar-artwork/mainline.git" + }, + { + "auto-install": [ + "src" + ], + "name": "sugar-datastore", + "repo": "git://git.sugarlabs.org/sugar-datastore/mainline.git" + }, + { + "name": "gst-plugins-espeak", + "out-of-source": false, + "repo": "git://git.sugarlabs.org/gst-plugins-espeak/mainline.git" + } +] diff --git a/config/modules/system-3.4.json b/config/modules/system-3.4.json index b0b4d7d..719e1df 100644 --- a/config/modules/system-3.4.json +++ b/config/modules/system-3.4.json @@ -1,45 +1,83 @@ -[{ "name": "glib", - "repo": "git://git.gnome.org/glib", - "branch": "2.34.2", - "options": ["--disable-modular-tests"] }, - { "name": "gobject-introspection", - "repo": "git://git.gnome.org/gobject-introspection", - "branch": "GOBJECT_INTROSPECTION_1_34_1_1", - "options": ["--disable-tests"] }, - { "name": "pygobject", - "repo": "git://github.com/dnarvaez/pygobject.git", - "branch": "pygobject-3-4" }, - { "name": "atk", - "repo": "git://git.gnome.org/atk", - "branch": "ATK_2_6_0" }, - { "name": "at-spi2-core", - "repo": "git://git.gnome.org/at-spi2-core", - "branch": "AT_SPI2_CORE_2_6_1" }, - { "name": "at-spi2-atk", - "repo": "git://git.gnome.org/at-spi2-atk", - "branch": "AT_SPI2_ATK_2_6_1" }, - { "name": "gtk+", - "repo": "git://git.gnome.org/gtk+", - "branch": "3.6.1" }, - { "name": "gstreamer", - "repo": "git://anongit.freedesktop.org/gstreamer/gstreamer", - "branch": "1.0.2", - "out-of-source": false, - "options": ["--disable-gtk-doc-html"] }, - { "name": "gst-plugins-base", - "repo": "git://anongit.freedesktop.org/gstreamer/gst-plugins-base", - "branch": "1.0.2", - "out-of-source": false, - "options": ["--disable-gtk-doc-html"] }, - { "name": "gst-plugins-good", - "repo": "git://anongit.freedesktop.org/gstreamer/gst-plugins-good", - "branch": "1.0.2", - "out-of-source": false, - "options": ["--disable-gtk-doc-html"] }, - { "name": "libxklavier", - "repo": "git://anongit.freedesktop.org/libxklavier", - "branch": "libxklavier-5.3" }, - { "name": "metacity", - "repo": "git://git.gnome.org/metacity", - "branch": "METACITY_2_34_13", - "options": ["--disable-themes-documentation"] }] +[ + { + "branch": "2.34.2", + "name": "glib", + "options": [ + "--disable-modular-tests" + ], + "repo": "git://git.gnome.org/glib" + }, + { + "branch": "GOBJECT_INTROSPECTION_1_34_1_1", + "name": "gobject-introspection", + "options": [ + "--disable-tests" + ], + "repo": "git://git.gnome.org/gobject-introspection" + }, + { + "branch": "pygobject-3-4", + "name": "pygobject", + "repo": "git://github.com/dnarvaez/pygobject.git" + }, + { + "branch": "ATK_2_6_0", + "name": "atk", + "repo": "git://git.gnome.org/atk" + }, + { + "branch": "AT_SPI2_CORE_2_6_1", + "name": "at-spi2-core", + "repo": "git://git.gnome.org/at-spi2-core" + }, + { + "branch": "AT_SPI2_ATK_2_6_1", + "name": "at-spi2-atk", + "repo": "git://git.gnome.org/at-spi2-atk" + }, + { + "branch": "3.6.1", + "name": "gtk+", + "repo": "git://git.gnome.org/gtk+" + }, + { + "branch": "1.0.2", + "name": "gstreamer", + "options": [ + "--disable-gtk-doc-html" + ], + "out-of-source": false, + "repo": "git://anongit.freedesktop.org/gstreamer/gstreamer" + }, + { + "branch": "1.0.2", + "name": "gst-plugins-base", + "options": [ + "--disable-gtk-doc-html" + ], + "out-of-source": false, + "repo": "git://anongit.freedesktop.org/gstreamer/gst-plugins-base" + }, + { + "branch": "1.0.2", + "name": "gst-plugins-good", + "options": [ + "--disable-gtk-doc-html" + ], + "out-of-source": false, + "repo": "git://anongit.freedesktop.org/gstreamer/gst-plugins-good" + }, + { + "branch": "libxklavier-5.3", + "name": "libxklavier", + "repo": "git://anongit.freedesktop.org/libxklavier" + }, + { + "branch": "METACITY_2_34_13", + "name": "metacity", + "options": [ + "--disable-themes-documentation" + ], + "repo": "git://git.gnome.org/metacity" + } +] diff --git a/config/modules/system-3.6.json b/config/modules/system-3.6.json index 8b9b6a8..fcd7a76 100644 --- a/config/modules/system-3.6.json +++ b/config/modules/system-3.6.json @@ -1,16 +1,31 @@ -[{ "name": "glib", - "repo": "git://git.gnome.org/glib", - "branch": "2.34.2", - "options": ["--disable-modular-tests"] }, - { "name": "gobject-introspection", - "repo": "git://git.gnome.org/gobject-introspection", - "branch": "GOBJECT_INTROSPECTION_1_34_1_1", - "options": ["--disable-tests"] }, - { "name": "pygobject", - "repo": "git://github.com/dnarvaez/pygobject.git", - "branch": "pygobject-3-4" }, - { "name": "metacity", - "repo": "git://git.gnome.org/metacity", - "branch": "METACITY_2_34_13", - "options": ["--disable-themes-documentation"] }] - +[ + { + "branch": "2.34.2", + "name": "glib", + "options": [ + "--disable-modular-tests" + ], + "repo": "git://git.gnome.org/glib" + }, + { + "branch": "GOBJECT_INTROSPECTION_1_34_1_1", + "name": "gobject-introspection", + "options": [ + "--disable-tests" + ], + "repo": "git://git.gnome.org/gobject-introspection" + }, + { + "branch": "pygobject-3-4", + "name": "pygobject", + "repo": "git://github.com/dnarvaez/pygobject.git" + }, + { + "branch": "METACITY_2_34_13", + "name": "metacity", + "options": [ + "--disable-themes-documentation" + ], + "repo": "git://git.gnome.org/metacity" + } +] diff --git a/config/packages/basesystem.json b/config/packages/basesystem.json index 9418714..a0fa326 100644 --- a/config/packages/basesystem.json +++ b/config/packages/basesystem.json @@ -84,4 +84,4 @@ "ncurses-base" ] } -} \ No newline at end of file +} diff --git a/config/packages/buildslave.json b/config/packages/buildslave.json index 3526595..afc3e26 100644 --- a/config/packages/buildslave.json +++ b/config/packages/buildslave.json @@ -8,4 +8,4 @@ "buildbot-slave" ] } -} \ No newline at end of file +} diff --git a/config/packages/deps-3.4.json b/config/packages/deps-3.4.json index 74c7570..6ad9785 100644 --- a/config/packages/deps-3.4.json +++ b/config/packages/deps-3.4.json @@ -623,4 +623,4 @@ "yasm" ] } -} \ No newline at end of file +} diff --git a/config/packages/deps-3.6.json b/config/packages/deps-3.6.json index 07defc4..c228531 100644 --- a/config/packages/deps-3.6.json +++ b/config/packages/deps-3.6.json @@ -672,4 +672,4 @@ "yasm" ] } -} \ No newline at end of file +} -- cgit v0.9.1