Hello community,

here is the log from the commit of package flatpak-builder for openSUSE:Factory 
checked in at 2019-02-01 11:45:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/flatpak-builder (Old)
 and      /work/SRC/openSUSE:Factory/.flatpak-builder.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "flatpak-builder"

Fri Feb  1 11:45:19 2019 rev:9 rq:669854 version:1.0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/flatpak-builder/flatpak-builder.changes  
2018-12-24 11:47:02.705152102 +0100
+++ 
/work/SRC/openSUSE:Factory/.flatpak-builder.new.28833/flatpak-builder.changes   
    2019-02-01 11:45:23.304555998 +0100
@@ -1,0 +2,19 @@
+Mon Jan 28 21:04:56 UTC 2019 - [email protected]
+
+- Update to version 1.0.3:
+  + Compress changes in cache, fixing the build of large
+    applications like libreoffice in some cases.
+  + Add new default-branch manifest option to allow overridable
+    branch name.
+- Changes from version 1.0.2:
+  + Print a warning when a YAML document has a float-like string
+    value.
+  + Handle .txz archive suffixes.
+  + Set SOURCE_DATE_EPOCH to the mtime of the manifest in the
+    build.
+  + Update python post-processor to handle python 3.7 pyc files.
+  + Allow unsetting env vars in the build options by setting them
+    to null.
+  + Documentation improvements.
+
+-------------------------------------------------------------------

Old:
----
  flatpak-builder-1.0.1.tar.xz

New:
----
  flatpak-builder-1.0.3.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ flatpak-builder.spec ++++++
--- /var/tmp/diff_new_pack.8UVecC/_old  2019-02-01 11:45:23.804555484 +0100
+++ /var/tmp/diff_new_pack.8UVecC/_new  2019-02-01 11:45:23.804555484 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package flatpak-builder
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           flatpak-builder
-Version:        1.0.1
+Version:        1.0.3
 Release:        0
 Summary:        Tool to build flatpaks from source
 License:        LGPL-2.1-or-later

++++++ flatpak-builder-1.0.1.tar.xz -> flatpak-builder-1.0.3.tar.xz ++++++
++++ 5009 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/NEWS new/flatpak-builder-1.0.3/NEWS
--- old/flatpak-builder-1.0.1/NEWS      2018-10-04 14:59:28.000000000 +0200
+++ new/flatpak-builder-1.0.3/NEWS      2019-01-28 12:52:14.000000000 +0100
@@ -1,3 +1,20 @@
+Changes in 1.0.3
+================
+
+ * Compress changes in cache, fixing the build of large applications like 
libreoffice in
+   some cases.
+ * Add new default-branch manifest option to allow overridable branch name.
+
+Changes in 1.0.2
+================
+
+ * Print a warning when a YAML document has a float-like string value.
+ * Handle .txz archive suffixes.
+ * Set SOURCE_DATE_EPOCH to the mtime of the manifest in the build.
+ * Update python post-processor to handle python 3.7 pyc files.
+ * Allow unsetting env vars in the build options by setting them to null.
+ * Documentation improvements
+
 Changes in 1.0.1
 ================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/compile new/flatpak-builder-1.0.3/compile
--- old/flatpak-builder-1.0.1/compile   2018-09-25 14:29:35.000000000 +0200
+++ new/flatpak-builder-1.0.3/compile   2019-01-11 16:32:13.000000000 +0100
@@ -1,9 +1,9 @@
-#!/bin/sh
+#! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 # Written by Tom Tromey <[email protected]>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -340,7 +340,7 @@
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/configure.ac new/flatpak-builder-1.0.3/configure.ac
--- old/flatpak-builder-1.0.1/configure.ac      2018-10-04 14:59:59.000000000 
+0200
+++ new/flatpak-builder-1.0.3/configure.ac      2019-01-28 12:51:04.000000000 
+0100
@@ -15,7 +15,7 @@
 
 m4_define([flatpak_builder_major_version], [1])
 m4_define([flatpak_builder_minor_version], [0])
-m4_define([flatpak_builder_micro_version], [1])
+m4_define([flatpak_builder_micro_version], [3])
 m4_define([flatpak_builder_version],
           
[flatpak_builder_major_version.flatpak_builder_minor_version.flatpak_builder_micro_version])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/doc/flatpak-builder.xml 
new/flatpak-builder-1.0.3/doc/flatpak-builder.xml
--- old/flatpak-builder-1.0.1/doc/flatpak-builder.xml   2018-08-08 
14:12:15.000000000 +0200
+++ new/flatpak-builder-1.0.3/doc/flatpak-builder.xml   2019-01-11 
16:15:29.000000000 +0100
@@ -112,7 +112,7 @@
     <refsect1>
         <title>Manifest</title>
 
-        <para>The manifest file is a json file whose format is described in 
detail in its own manual page.</para>
+        <para>The manifest file is a json or yaml file whose format is 
described in detail in its own manual page.</para>
     </refsect1>
 
     <refsect1>
@@ -623,7 +623,7 @@
     "runtime-version": "1.2",
     "sdk": "org.freedesktop.Sdk",
     "command": "test",
-    "clean": [ "/include", "*.la" ],
+    "cleanup": [ "/include", "*.la" ],
     "build-options" : {
         "cflags": "-O2 -g",
         "cxxflags": "-O2 -g",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/doc/flatpak-manifest.xml 
new/flatpak-builder-1.0.3/doc/flatpak-manifest.xml
--- old/flatpak-builder-1.0.1/doc/flatpak-manifest.xml  2018-08-20 
10:57:46.000000000 +0200
+++ new/flatpak-builder-1.0.3/doc/flatpak-manifest.xml  2019-01-25 
16:50:51.000000000 +0100
@@ -58,7 +58,24 @@
                 </varlistentry>
                 <varlistentry>
                     <term><option>branch</option> (string)</term>
-                    <listitem><para>The branch of the application, defaults to 
master.</para></listitem>
+                    <listitem><para>The branch to use when exporting
+                    the application. If this is unset the defaults
+                    come from the default-branch option.</para>
+                    <para>This key overrides both the default-branch
+                    key, and the --default-branch commandline
+                    option. Unless you need a very specific branchname
+                    (like for a runtime or an extension) it is
+                    recommended to use the default-branch key instead, because
+                    you can then override the default using --default-branch 
when
+                    building for instance a test build.</para></listitem>
+                </varlistentry>
+                <varlistentry>
+                    <term><option>default-branch</option> (string)</term>
+                    <listitem><para>The default branch to use when
+                    exporting the application. Defaults to master. </para>
+                    <para>This key can be overriden by the
+                    --default-branch commandline
+                    option.</para></listitem>
                 </varlistentry>
                 <varlistentry>
                     <term><option>collection-id</option> (string)</term>
@@ -106,7 +123,16 @@
                 </varlistentry>
                 <varlistentry>
                     <term><option>command</option> (string)</term>
-                    <listitem><para>The filename or path to the main binary of 
the application. Note that this is really just a single file, not a 
commandline. If you want to pass arguments, install a shell script wrapper and 
use that as the command.</para></listitem>
+                    <listitem><para>
+                        The filename or path to the main binary of the 
application. Note that this
+                        is really just a single file, not a commandline. If 
you want to pass arguments,
+                        install a shell script wrapper and use that as the 
command.
+                    </para><para>
+                        Also note that the command is used when the 
application is run via
+                        <command>flatpak run</command>, and does not affect 
what gets executed when
+                        the application is run in other ways, e.g. via the 
desktop file or D-Bus
+                        activation.
+                    </para></listitem>
                 </varlistentry>
                 <varlistentry>
                     <term><option>build-runtime</option> (boolean)</term>
@@ -340,7 +366,7 @@
                 </varlistentry>
                 <varlistentry>
                     <term><option>env</option> (object)</term>
-                    <listitem><para>This is a dictionary defining environment 
variables to be set during the build. Elements in this override the properties 
that set the environment, like cflags and ldflags.</para></listitem>
+                    <listitem><para>This is a dictionary defining environment 
variables to be set during the build. Elements in this override the properties 
that set the environment, like cflags and ldflags. Keys with a null value unset 
the corresponding variable. </para></listitem>
                 </varlistentry>
                 <varlistentry>
                     <term><option>build-args</option> (array of strings)</term>
@@ -661,7 +687,7 @@
                     </varlistentry>
                     <varlistentry>
                         <term><option>url</option> (string)</term>
-                        <listitem><para>URL of the git repository. This 
overrides path if both are specified.</para></listitem>
+                        <listitem><para>URL of the git repository. This 
overrides path if both are specified. When using git via SSH, the correct 
syntax is ssh://user@domain/path/to/repo.git.</para></listitem>
                     </varlistentry>
                     <varlistentry>
                         <term><option>branch</option> (string)</term>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/missing new/flatpak-builder-1.0.3/missing
--- old/flatpak-builder-1.0.1/missing   2018-09-25 14:29:35.000000000 +0200
+++ new/flatpak-builder-1.0.3/missing   2019-01-11 16:32:13.000000000 +0100
@@ -1,9 +1,9 @@
-#!/bin/sh
+#! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <[email protected]>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@
   exit $st
 fi
 
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
 
 program_details ()
 {
@@ -207,7 +207,7 @@
 exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-cache.c 
new/flatpak-builder-1.0.3/src/builder-cache.c
--- old/flatpak-builder-1.0.1/src/builder-cache.c       2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-cache.c       2019-01-25 
15:13:40.000000000 +0100
@@ -588,6 +588,10 @@
   g_autoptr(GPtrArray) removals = NULL;
   g_autoptr(GVariantDict) metadata_dict = NULL;
   g_autoptr(GVariant) metadata = NULL;
+  g_autoptr(GVariant) changesv = NULL;
+  g_autoptr(GVariant) removalsv = NULL;
+  g_autoptr(GVariant) changesvz = NULL;
+  g_autoptr(GVariant) removalsvz = NULL;
 
   g_print ("Committing stage %s to cache\n", self->stage);
 
@@ -615,11 +619,17 @@
     goto out;
 
   changes = builder_cache_get_changes_to (self, root, &removals, NULL);
+
   metadata_dict = g_variant_dict_new (NULL);
-  g_variant_dict_insert_value (metadata_dict, "changes",
-                               g_variant_new_strv ((const gchar * const  *) 
changes->pdata, changes->len));
-  g_variant_dict_insert_value (metadata_dict, "removals",
-                               g_variant_new_strv ((const gchar * const  *) 
removals->pdata, removals->len));
+
+  changesv = g_variant_ref_sink (g_variant_new_strv ((const gchar * const  *) 
changes->pdata, changes->len));
+  changesvz = flatpak_variant_compress (changesv);
+  g_variant_dict_insert_value (metadata_dict, "changesz", changesvz);
+
+  removalsv = g_variant_ref_sink (g_variant_new_strv ((const gchar * const  *) 
removals->pdata, removals->len));
+  removalsvz = flatpak_variant_compress (removalsv);
+  g_variant_dict_insert_value (metadata_dict, "removalsz", removalsvz);
+
   metadata = g_variant_ref_sink (g_variant_dict_end (metadata_dict));
 
   current = self->current_checksum;
@@ -1162,6 +1172,7 @@
   g_autoptr(GVariant) variant = NULL;
   g_autoptr(GVariant) commit_metadata = NULL;
   g_autofree char *parent_commit = NULL;
+  g_autoptr(GVariant) changesz_v = NULL;
   g_autoptr(GVariant) changes_v = NULL;
 
   if (!ostree_repo_read_commit (self->repo, self->last_parent, &current_root, 
NULL, NULL, error))
@@ -1172,7 +1183,12 @@
     return NULL;
 
   commit_metadata = g_variant_get_child_value (variant, 0);
-  changes_v = g_variant_lookup_value (commit_metadata, "changes", 
G_VARIANT_TYPE ("as"));
+  changesz_v = g_variant_lookup_value (commit_metadata, "changesz", 
G_VARIANT_TYPE_BYTESTRING);
+
+  if (changesz_v)
+    changes_v = flatpak_variant_uncompress (changesz_v, G_VARIANT_TYPE ("as"));
+  else
+    changes_v = g_variant_lookup_value (commit_metadata, "changes", 
G_VARIANT_TYPE ("as"));
 
   if (changes_v)
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-context.c 
new/flatpak-builder-1.0.3/src/builder-context.c
--- old/flatpak-builder-1.0.1/src/builder-context.c     2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-context.c     2019-01-25 
17:18:28.000000000 +0100
@@ -48,7 +48,9 @@
   SoupSession    *soup_session;
   CURL           *curl_session;
   char           *arch;
+  char           *default_branch;
   char           *stop_at;
+  gint64          source_date_epoch;
 
   GFile          *download_dir;
   GPtrArray      *sources_dirs;
@@ -118,6 +120,7 @@
   g_clear_object (&self->options);
   g_clear_object (&self->sdk_config);
   g_free (self->arch);
+  g_free (self->default_branch);
   g_free (self->state_subdir);
   g_free (self->stop_at);
   g_strfreev (self->cleanup);
@@ -566,6 +569,27 @@
 }
 
 const char *
+builder_context_get_default_branch (BuilderContext *self)
+{
+  return (const char *) self->default_branch;
+}
+
+void
+builder_context_set_default_branch (BuilderContext *self,
+                                    const char     *default_branch)
+{
+  g_free (self->default_branch);
+  self->default_branch = g_strdup (default_branch);
+}
+
+void
+builder_context_set_source_date_epoch (BuilderContext *self,
+                                       gint64 source_date_epoch)
+{
+  self->source_date_epoch = source_date_epoch;
+}
+
+const char *
 builder_context_get_stop_at (BuilderContext *self)
 {
   return self->stop_at;
@@ -1005,8 +1029,21 @@
 }
 
 char **
-builder_context_extend_env (BuilderContext *self,
-                            char          **envp)
+builder_context_extend_env_pre (BuilderContext *self,
+                                char          **envp)
+{
+  if (self->source_date_epoch != 0)
+    {
+      g_autofree char *s_d_e = g_strdup_printf ("%" G_GUINT64_FORMAT, 
self->source_date_epoch);
+      envp = g_environ_setenv (envp, "SOURCE_DATE_EPOCH", s_d_e, FALSE);
+    }
+
+  return envp;
+}
+
+char **
+builder_context_extend_env_post (BuilderContext *self,
+                                 char          **envp)
 {
   g_autofree char *path = NULL;
   const char *ccache_dir = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-context.h 
new/flatpak-builder-1.0.3/src/builder-context.h
--- old/flatpak-builder-1.0.1/src/builder-context.h     2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-context.h     2019-01-25 
17:09:48.000000000 +0100
@@ -74,6 +74,11 @@
 const char *    builder_context_get_arch (BuilderContext *self);
 void            builder_context_set_arch (BuilderContext *self,
                                           const char     *arch);
+const char *    builder_context_get_default_branch (BuilderContext *self);
+void            builder_context_set_default_branch (BuilderContext *self,
+                                                    const char     
*default_branch);
+void            builder_context_set_source_date_epoch (BuilderContext *self,
+                                                       gint64 
source_date_epoch);
 const char *    builder_context_get_stop_at (BuilderContext *self);
 void            builder_context_set_stop_at (BuilderContext *self,
                                              const char     *module);
@@ -140,8 +145,10 @@
 void            builder_context_set_no_shallow_clone (BuilderContext *self,
                                                       gboolean        
no_shallow_clone);
 gboolean        builder_context_get_no_shallow_clone (BuilderContext *self);
-char **         builder_context_extend_env (BuilderContext *self,
-                                            char          **envp);
+char **         builder_context_extend_env_pre (BuilderContext *self,
+                                                 char          **envp);
+char **         builder_context_extend_env_post (BuilderContext *self,
+                                                 char          **envp);
 
 gboolean        builder_context_load_sdk_config (BuilderContext       *self,
                                                  const char           
*sdk_path,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-main.c 
new/flatpak-builder-1.0.3/src/builder-main.c
--- old/flatpak-builder-1.0.1/src/builder-main.c        2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-main.c        2019-01-25 
17:13:41.000000000 +0100
@@ -253,6 +253,46 @@
 }
 
 static gboolean
+flatpak_version_check (int major,
+                       int minor,
+                       int micro)
+{
+  static int flatpak_major = 0;
+  static int flatpak_minor = 0;
+  static int flatpak_micro = 0;
+
+  if (flatpak_major == 0 &&
+      flatpak_minor == 0 &&
+      flatpak_micro == 0)
+    {
+      const char * argv[] = { "flatpak", "--version", NULL };
+      g_autoptr(GSubprocess) subp = NULL;
+      g_autofree char *out = NULL;
+ 
+      subp = g_subprocess_newv (argv, G_SUBPROCESS_FLAGS_STDOUT_PIPE, NULL);
+      g_subprocess_communicate_utf8 (subp, NULL, NULL, &out, NULL, NULL);
+
+      if (sscanf (out, "Flatpak %d.%d.%d", &flatpak_major, &flatpak_minor, 
&flatpak_micro) != 3)
+        g_warning ("Failed to get flatpak version");
+
+      g_debug ("Using Flatpak version %d.%d.%d", flatpak_major, flatpak_minor, 
flatpak_micro);
+    }
+
+  if (flatpak_major > major)
+    return TRUE;
+  if (flatpak_major < major)
+    return FALSE;
+  if (flatpak_minor > minor)
+    return TRUE;
+  if (flatpak_minor < minor)
+    return FALSE;
+  if (flatpak_micro >= micro)
+    return TRUE;
+
+  return FALSE;
+}
+
+static gboolean
 do_install (BuilderContext *build_context,
             const gchar    *repodir,
             const gchar    *id,
@@ -276,7 +316,8 @@
     g_ptr_array_add (args, g_strdup ("--system"));
 
   g_ptr_array_add (args, g_strdup ("-y"));
-
+  if (flatpak_version_check (1, 2, 0))
+    g_ptr_array_add (args, g_strdup ("--noninteractive"));
   g_ptr_array_add (args, g_strdup ("--reinstall"));
 
   ref = flatpak_build_untyped_ref (id, branch,
@@ -401,6 +442,7 @@
   int i, first_non_arg, orig_argc;
   int argnr;
   char *p;
+  struct stat statbuf;
 
   setlocale (LC_ALL, "");
 
@@ -417,7 +459,6 @@
   else
     g_unsetenv ("GIO_USE_VFS");
 
-
   /* Work around libsoup/glib race condition, as per:
      https://bugzilla.gnome.org/show_bug.cgi?id=796031 and
      https://bugzilla.gnome.org/show_bug.cgi?id=674885#c87 */
@@ -619,6 +660,9 @@
       return 1;
     }
 
+  if (stat (flatpak_file_get_path_cached (manifest_file), &statbuf) == 0)
+    builder_context_set_source_date_epoch (build_context, 
(gint64)statbuf.st_mtime);
+
   manifest_sha256 = g_compute_checksum_for_string (G_CHECKSUM_SHA256, 
manifest_contents, -1);
 
   if (opt_skip_if_unchanged)
@@ -646,7 +690,7 @@
     }
 
   if (opt_default_branch)
-    builder_manifest_set_default_branch (manifest, opt_default_branch);
+    builder_context_set_default_branch (build_context, opt_default_branch);
 
   if (opt_collection_id)
     builder_manifest_set_default_collection_id (manifest, opt_collection_id);
@@ -884,7 +928,7 @@
   if (opt_mirror_screenshots_url && !opt_export_only)
     {
       g_autofree char *screenshot_subdir = g_strdup_printf ("%s-%s", 
builder_manifest_get_id (manifest),
-                                                            
builder_manifest_get_branch (manifest));
+                                                            
builder_manifest_get_branch (manifest, build_context));
       g_autofree char *url = g_build_filename (opt_mirror_screenshots_url, 
screenshot_subdir, NULL);
       g_autofree char *xml_relpath = g_strdup_printf 
("files/share/app-info/xmls/%s.xml.gz", builder_manifest_get_id (manifest));
       g_autoptr(GFile) xml = g_file_resolve_relative_path (app_dir, 
xml_relpath);
@@ -966,7 +1010,7 @@
       if (!do_export (build_context, &error,
                       FALSE,
                       flatpak_file_get_path_cached (export_repo),
-                      app_dir_path, exclude_dirs, builder_manifest_get_branch 
(manifest),
+                      app_dir_path, exclude_dirs, builder_manifest_get_branch 
(manifest, build_context),
                       builder_manifest_get_collection_id (manifest),
                       "--exclude=/lib/debug/*",
                       "--include=/lib/debug/app",
@@ -1000,7 +1044,7 @@
                                    "/share/runtime/locale/", NULL);
           if (!do_export (build_context, &error, TRUE,
                           flatpak_file_get_path_cached (export_repo),
-                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest),
+                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest, build_context),
                           builder_manifest_get_collection_id (manifest),
                           metadata_arg,
                           files_arg,
@@ -1020,7 +1064,7 @@
 
           if (!do_export (build_context, &error, TRUE,
                           flatpak_file_get_path_cached (export_repo),
-                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest),
+                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest, build_context),
                           builder_manifest_get_collection_id (manifest),
                           "--metadata=metadata.debuginfo",
                           builder_context_get_build_runtime (build_context) ? 
"--files=usr/lib/debug" : "--files=files/lib/debug",
@@ -1051,7 +1095,7 @@
 
           if (!do_export (build_context, &error, TRUE,
                           flatpak_file_get_path_cached (export_repo),
-                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest),
+                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest, build_context),
                           builder_manifest_get_collection_id (manifest),
                           metadata_arg, files_arg,
                           NULL))
@@ -1070,7 +1114,7 @@
 
           if (!do_export (build_context, &error, TRUE,
                           flatpak_file_get_path_cached (export_repo),
-                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest),
+                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest, build_context),
                           builder_manifest_get_collection_id (manifest),
                           "--metadata=metadata.sources",
                           "--files=sources",
@@ -1090,7 +1134,7 @@
 
           if (!do_export (build_context, &error, TRUE,
                           flatpak_file_get_path_cached (export_repo),
-                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest),
+                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest, build_context),
                           builder_manifest_get_collection_id (manifest),
                           "--metadata=metadata.platform",
                           "--files=platform",
@@ -1124,7 +1168,7 @@
           files_arg = g_strconcat ("--files=platform/share/runtime/locale/", 
NULL);
           if (!do_export (build_context, &error, TRUE,
                           flatpak_file_get_path_cached (export_repo),
-                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest),
+                          app_dir_path, NULL, builder_manifest_get_branch 
(manifest, build_context),
                           builder_manifest_get_collection_id (manifest),
                           metadata_arg,
                           files_arg,
@@ -1144,7 +1188,7 @@
         g_printerr ("NOTE: No export due to --require-changes, ignoring 
--install\n");
       else if (!do_install (build_context, flatpak_file_get_path_cached 
(export_repo),
                             builder_manifest_get_id (manifest),
-                            builder_manifest_get_branch (manifest),
+                            builder_manifest_get_branch (manifest, 
build_context),
                             &error))
         {
           g_printerr ("Install failed: %s\n", error->message);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-manifest.c 
new/flatpak-builder-1.0.3/src/builder-manifest.c
--- old/flatpak-builder-1.0.1/src/builder-manifest.c    2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-manifest.c    2019-01-25 
17:15:59.000000000 +0100
@@ -61,6 +61,7 @@
   char           *id;
   char           *id_platform;
   char           *branch;
+  char           *default_branch;
   char           *collection_id;
   char           *extension_tag;
   char           *type;
@@ -123,6 +124,7 @@
   PROP_ID,
   PROP_ID_PLATFORM,
   PROP_BRANCH,
+  PROP_DEFAULT_BRANCH,
   PROP_RUNTIME,
   PROP_RUNTIME_VERSION,
   PROP_RUNTIME_COMMIT,
@@ -175,6 +177,7 @@
 
   g_free (self->id);
   g_free (self->branch);
+  g_free (self->default_branch);
   g_free (self->collection_id);
   g_free (self->extension_tag);
   g_free (self->runtime);
@@ -284,6 +287,10 @@
       g_value_set_string (value, self->branch);
       break;
 
+    case PROP_DEFAULT_BRANCH:
+      g_value_set_string (value, self->default_branch);
+      break;
+
     case PROP_RUNTIME:
       g_value_set_string (value, self->runtime);
       break;
@@ -488,6 +495,11 @@
       self->branch = g_value_dup_string (value);
       break;
 
+    case PROP_DEFAULT_BRANCH:
+      g_free (self->default_branch);
+      self->default_branch = g_value_dup_string (value);
+      break;
+
     case PROP_RUNTIME:
       g_free (self->runtime);
       self->runtime = g_value_dup_string (value);
@@ -749,6 +761,13 @@
                                                         NULL,
                                                         G_PARAM_READWRITE));
   g_object_class_install_property (object_class,
+                                   PROP_DEFAULT_BRANCH,
+                                   g_param_spec_string ("default-branch",
+                                                        "",
+                                                        "",
+                                                        NULL,
+                                                        G_PARAM_READWRITE));
+  g_object_class_install_property (object_class,
                                    PROP_RUNTIME,
                                    g_param_spec_string ("runtime",
                                                         "",
@@ -1366,20 +1385,20 @@
 }
 
 const char *
-builder_manifest_get_branch (BuilderManifest *self)
+builder_manifest_get_branch (BuilderManifest *self,
+                             BuilderContext  *context)
 {
   if (self->branch)
     return self->branch;
 
-  return "master";
-}
+  if (context &&
+      builder_context_get_default_branch (context))
+    return builder_context_get_default_branch (context);
 
-void
-builder_manifest_set_default_branch (BuilderManifest *self,
-                                     const char *default_branch)
-{
-  if (self->branch == NULL)
-    self->branch = g_strdup (default_branch);
+  if (self->default_branch)
+    return self->default_branch;
+
+  return "master";
 }
 
 const char *
@@ -1405,7 +1424,7 @@
 static const char *
 builder_manifest_get_base_version (BuilderManifest *self)
 {
-  return self->base_version ? self->base_version : builder_manifest_get_branch 
(self);
+  return self->base_version ? self->base_version : builder_manifest_get_branch 
(self, NULL);
 }
 
 G_GNUC_NULL_TERMINATED
@@ -2713,7 +2732,7 @@
 
       ref = flatpak_compose_ref (!self->build_runtime && 
!self->build_extension,
                                  builder_manifest_get_id (self),
-                                 builder_manifest_get_branch (self),
+                                 builder_manifest_get_branch (self, context),
                                  builder_context_get_arch (context));
 
       if (self->metadata)
@@ -3132,7 +3151,7 @@
 
       ref = flatpak_compose_ref (!self->build_runtime && 
!self->build_extension,
                                  builder_manifest_get_id_platform (self),
-                                 builder_manifest_get_branch (self),
+                                 builder_manifest_get_branch (self, context),
                                  builder_context_get_arch (context));
 
       platform_dir = g_file_get_child (app_dir, "platform");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-manifest.h 
new/flatpak-builder-1.0.3/src/builder-manifest.h
--- old/flatpak-builder-1.0.1/src/builder-manifest.h    2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-manifest.h    2019-01-25 
17:11:56.000000000 +0100
@@ -59,9 +59,8 @@
 GList *         builder_manifest_get_modules (BuilderManifest *self);
 GList *         builder_manifest_get_add_extensions (BuilderManifest *self);
 GList *         builder_manifest_get_add_build_extensions (BuilderManifest 
*self);
-const char *    builder_manifest_get_branch (BuilderManifest *self);
-void            builder_manifest_set_default_branch (BuilderManifest *self,
-                                                     const char 
*default_branch);
+const char *    builder_manifest_get_branch (BuilderManifest *self,
+                                             BuilderContext  *context);
 const char *    builder_manifest_get_collection_id (BuilderManifest *self);
 const char *    builder_manifest_get_extension_tag (BuilderManifest *self);
 void            builder_manifest_set_default_collection_id (BuilderManifest 
*self,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-options.c 
new/flatpak-builder-1.0.3/src/builder-options.c
--- old/flatpak-builder-1.0.1/src/builder-options.c     2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-options.c     2019-01-15 
16:14:23.000000000 +0100
@@ -645,23 +645,24 @@
 
           for (i = 0; self->env[i] != NULL; i++)
             {
-              JsonNode *str = json_node_new (JSON_NODE_VALUE);
+              JsonNode *val = NULL;
               const char *equal;
               g_autofree char *member = NULL;
 
               equal = strchr (self->env[i], '=');
               if (equal)
                 {
-                  json_node_set_string (str, equal + 1);
+                  val = json_node_new (JSON_NODE_VALUE);
+                  json_node_set_string (val, equal + 1);
                   member = g_strndup (self->env[i], equal - self->env[i]);
                 }
               else
                 {
-                  json_node_set_string (str, "");
+                  val = json_node_new (JSON_NODE_NULL);
                   member = g_strdup (self->env[i]);
                 }
 
-              json_object_set_member (object, member, str);
+              json_object_set_member (object, member, val);
             }
 
           retval = json_node_init_object (json_node_alloc (), object);
@@ -743,11 +744,19 @@
               const char *val_str;
 
               val = json_object_get_member (object, member_name);
-              val_str = json_node_get_string (val);
-              if (val_str == NULL)
-                return FALSE;
 
-              g_ptr_array_add (env, g_strdup_printf ("%s=%s", member_name, 
val_str));
+              if (JSON_NODE_TYPE (val) == JSON_NODE_NULL)
+                {
+                  g_ptr_array_add (env, g_strdup_printf ("%s", member_name));
+                }
+              else
+                {
+                  val_str = json_node_get_string (val);
+                  if (val_str == NULL)
+                    return FALSE;
+
+                  g_ptr_array_add (env, g_strdup_printf ("%s=%s", member_name, 
val_str));
+                }
             }
 
           g_ptr_array_add (env, NULL);
@@ -1084,51 +1093,53 @@
   char **envp = NULL;
   const char *cflags, *cppflags, *cxxflags, *ldflags;
 
-  for (l = options; l != NULL; l = l->next)
+  envp = builder_context_extend_env_pre (context, envp);
+
+  cflags = builder_options_get_cflags (self, context);
+  if (cflags)
+    envp = g_environ_setenv (envp, "CFLAGS", cflags, FALSE);
+
+  cppflags = builder_options_get_cppflags (self, context);
+  if (cppflags)
+    envp = g_environ_setenv (envp, "CPPFLAGS", cppflags, FALSE);
+
+  cxxflags = builder_options_get_cxxflags (self, context);
+  if (cxxflags)
+    envp = g_environ_setenv (envp, "CXXFLAGS", cxxflags, FALSE);
+
+  ldflags = builder_options_get_ldflags (self, context);
+  if (ldflags)
+    envp = g_environ_setenv (envp, "LDFLAGS", ldflags, FALSE);
+
+  /* We traverse in reverse order because the list is "last first" */
+  for (l = g_list_last (options); l != NULL; l = l->prev)
     {
       BuilderOptions *o = l->data;
 
       if (o->env)
         {
-          for (i = 0; o->env[i] != NULL; i++)
+          for (i = g_strv_length (o->env) - 1; i >= 0; i--)
             {
               const char *line = o->env[i];
               const char *eq = strchr (line, '=');
-              const char *value = "";
-              g_autofree char *key = NULL;
 
               if (eq)
                 {
-                  key = g_strndup (line, eq - line);
-                  value = eq + 1;
+                  g_autofree char *key = g_strndup (line, eq - line);
+                  const char *value = eq + 1;
+
+                  envp = g_environ_setenv (envp, key, value, TRUE);
                 }
               else
                 {
-                  key = g_strdup (key);
+                  envp = g_environ_unsetenv (envp, line);
                 }
 
-              envp = g_environ_setenv (envp, key, value, FALSE);
             }
         }
     }
 
-  envp = builder_context_extend_env (context, envp);
-
-  cflags = builder_options_get_cflags (self, context);
-  if (cflags)
-    envp = g_environ_setenv (envp, "CFLAGS", cflags, FALSE);
-
-  cppflags = builder_options_get_cppflags (self, context);
-  if (cppflags)
-    envp = g_environ_setenv (envp, "CPPFLAGS", cppflags, FALSE);
-
-  cxxflags = builder_options_get_cxxflags (self, context);
-  if (cxxflags)
-    envp = g_environ_setenv (envp, "CXXFLAGS", cxxflags, FALSE);
-
-  ldflags = builder_options_get_ldflags (self, context);
-  if (ldflags)
-    envp = g_environ_setenv (envp, "LDFLAGS", ldflags, FALSE);
+  envp = builder_context_extend_env_post (context, envp);
 
   envp = builder_options_update_path (self, context, envp);
   envp = builder_options_update_ld_path (self, context, envp);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-post-process.c 
new/flatpak-builder-1.0.3/src/builder-post-process.c
--- old/flatpak-builder-1.0.1/src/builder-post-process.c        2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-post-process.c        2019-01-14 
11:18:13.000000000 +0100
@@ -112,6 +112,9 @@
   return TRUE;
 }
 
+/* We need to read at least 12 bytes to get both magic + optional flags + 
mtime */
+#define PYTHON_HEADER_SIZE 12
+
 static gboolean
 fixup_python_time_stamp (const char *path,
                          const char *rel_path,
@@ -119,9 +122,11 @@
 {
   glnx_fd_close int fd = -1;
   g_auto(GLnxTmpfile) tmpf = { 0 };
-  guint8 buffer[8];
+  guint8 buffer[PYTHON_HEADER_SIZE];
   ssize_t res;
   guint32 pyc_mtime;
+  guint32 magic, header_flag;
+  gsize mtime_offset;
   g_autofree char *py_path = NULL;
   struct stat stbuf;
   gboolean remove_pyc = FALSE;
@@ -136,8 +141,8 @@
       return TRUE;
     }
 
-  res = pread (fd, buffer, 8, 0);
-  if (res != 8)
+  res = pread (fd, buffer, PYTHON_HEADER_SIZE, 0);
+  if (res != PYTHON_HEADER_SIZE)
     {
       g_warning ("Short read for %s", rel_path);
       return TRUE;
@@ -149,11 +154,48 @@
       return TRUE;
     }
 
+  magic = buffer[0] + (buffer[1] << 8);
+
+  /* All magic listed here: 
https://github.com/python/cpython/blob/HEAD/Lib/importlib/_bootstrap_external.py#L167
+   * 3392 is the first (3.7) which added an extra flags field in the header.
+   * 20121 is the first higher major listed (1.5), and all other non-py3 ones 
are higher.
+   */
+  if (magic >= 3392 && magic < 20121)
+    {
+      /* From the spec:
+       * The pyc header currently consists of 3 32-bit words. We will expand 
it to 4.
+       * The first word will continue to be the magic number, versioning the 
bytecode and pyc format.
+       * The second word, conceptually the new word, will be a bit field.
+       * The interpretation of the rest of the header and invalidation 
behavior of the pyc depends on the contents of the bit field.
+       */
+      header_flag =
+        (buffer[4] << 8*0) |
+        (buffer[5] << 8*1) |
+        (buffer[6] << 8*2) |
+        (buffer[7] << 8*3);
+
+      /* If the bit field is 0, the pyc is a traditional timestamp-based pyc. 
I.e., the third
+         and forth words will be the timestamp and file size respectively, and 
invalidation
+         will be done by comparing the metadata of the source file  with that 
in the header. */
+      if (header_flag != 0)
+        {
+          /* Non-mtime based verification, like hash if low bit is 1,
+           * or other future added methods.  No need to do anything*/
+          return TRUE;
+        }
+
+      mtime_offset = 8;
+    }
+  else
+    {
+      mtime_offset = 4;
+    }
+
   pyc_mtime =
-    (buffer[4] << 8*0) |
-    (buffer[5] << 8*1) |
-    (buffer[6] << 8*2) |
-    (buffer[7] << 8*3);
+    (buffer[mtime_offset+0] << 8*0) |
+    (buffer[mtime_offset+1] << 8*1) |
+    (buffer[mtime_offset+2] << 8*2) |
+    (buffer[mtime_offset+3] << 8*3);
 
   if (strcmp (dir_basename, "__pycache__") == 0)
     {
@@ -233,11 +275,11 @@
     return glnx_throw_errno_prefix (error, "copyfile");
 
   /* Change to mtime 0 which is what ostree uses for checkouts */
-  buffer[4] = OSTREE_TIMESTAMP;
-  buffer[5] = buffer[6] = buffer[7] = 0;
+  buffer[mtime_offset+0] = OSTREE_TIMESTAMP;
+  buffer[mtime_offset+1] = buffer[mtime_offset+2] = buffer[mtime_offset+3] = 0;
 
-  res = pwrite (tmpf.fd, buffer, 8, 0);
-  if (res != 8)
+  res = pwrite (tmpf.fd, buffer, PYTHON_HEADER_SIZE, 0);
+  if (res != PYTHON_HEADER_SIZE)
     {
       glnx_set_error_from_errno (error);
       return FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-source-archive.c 
new/flatpak-builder-1.0.3/src/builder-source-archive.c
--- old/flatpak-builder-1.0.1/src/builder-source-archive.c      2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-source-archive.c      2019-01-11 
16:15:29.000000000 +0100
@@ -504,7 +504,8 @@
   if (g_str_has_suffix (lower, ".tar.lzo"))
     return TAR_LZOP;
 
-  if (g_str_has_suffix (lower, ".tar.xz"))
+  if (g_str_has_suffix (lower, ".tar.xz") ||
+      g_str_has_suffix (lower, ".txz"))
     return TAR_XZ;
 
   if (g_str_has_suffix (lower, ".zip"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-utils.c 
new/flatpak-builder-1.0.3/src/builder-utils.c
--- old/flatpak-builder-1.0.1/src/builder-utils.c       2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-utils.c       2019-01-25 
14:55:29.000000000 +0100
@@ -408,14 +408,29 @@
               json_node_init_boolean (json, FALSE);
               break;
             }
-
-          gchar *endptr;
-          gint64 num = g_ascii_strtoll (scalar, &endptr, 10);
-          if (*scalar != '\0' && *endptr == '\0')
+          else if (strcmp (scalar, "null") == 0)
             {
-              json_node_init_int (json, num);
+              json_node_init_null (json);
               break;
             }
+
+          if (*scalar != '\0')
+            {
+              gchar *endptr;
+              gint64 num = g_ascii_strtoll (scalar, &endptr, 10);
+              if (*endptr == '\0')
+                {
+                  json_node_init_int (json, num);
+                  break;
+                }
+              else if (*endptr == '.')
+                {
+                  g_ascii_strtoll (endptr + 1, &endptr, 10);
+                  if (*endptr == '\0')
+                    g_warning ("%zu:%zu: '%s' will be parsed as a number by 
many YAML parsers",
+                               node->start_mark.line + 1, 
node->start_mark.column + 1, scalar);
+                }
+            }
         }
 
       json_node_init_string (json, scalar);
@@ -2524,3 +2539,71 @@
 
   return g_steal_pointer (&xml_root);
 }
+
+GBytes *
+flatpak_read_stream (GInputStream *in,
+                     gboolean      null_terminate,
+                     GError      **error)
+{
+  g_autoptr(GOutputStream) mem_stream = NULL;
+
+  mem_stream = g_memory_output_stream_new_resizable ();
+  if (g_output_stream_splice (mem_stream, in,
+                              0, NULL, error) < 0)
+    return NULL;
+
+  if (null_terminate)
+    {
+      if (!g_output_stream_write (G_OUTPUT_STREAM (mem_stream), "\0", 1, NULL, 
error))
+        return NULL;
+    }
+
+  if (!g_output_stream_close (G_OUTPUT_STREAM (mem_stream), NULL, error))
+    return NULL;
+
+  return g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM 
(mem_stream));
+}
+
+GVariant *
+flatpak_variant_uncompress (GVariant *variant,
+                            const GVariantType *type)
+{
+  g_autoptr(GInputStream) input_stream = NULL;
+  g_autoptr(GZlibDecompressor) decompressor = NULL;
+  g_autoptr(GInputStream) converter = NULL;
+  g_autoptr(GBytes) decompressed_bytes = NULL;
+  const guint8 *compressed;
+  gsize compressed_size;
+
+  g_assert (g_variant_is_of_type (variant, G_VARIANT_TYPE_BYTESTRING));
+
+  compressed = g_variant_get_data (variant);
+  compressed_size = g_variant_get_size (variant);
+
+  input_stream = g_memory_input_stream_new_from_data (compressed, 
compressed_size, NULL);
+  decompressor = g_zlib_decompressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP);
+  converter = g_converter_input_stream_new (G_INPUT_STREAM (input_stream), 
G_CONVERTER (decompressor));
+  decompressed_bytes = flatpak_read_stream (converter, FALSE, NULL);
+  return g_variant_ref_sink (g_variant_new_from_bytes (type, 
decompressed_bytes, TRUE));
+}
+
+GVariant *
+flatpak_variant_compress (GVariant *variant)
+{
+  g_autoptr(GInputStream) input_stream = NULL;
+  g_autoptr(GZlibCompressor) compressor = NULL;
+  g_autoptr(GInputStream) converter = NULL;
+  g_autoptr(GBytes) compressed_bytes = NULL;
+  const guint8 *decompressed;
+  gsize decompressed_size;
+
+  decompressed = g_variant_get_data (variant);
+  decompressed_size = g_variant_get_size (variant);
+
+  input_stream = g_memory_input_stream_new_from_data (decompressed, 
decompressed_size, NULL);
+  compressor = g_zlib_compressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP, -1);
+  converter = g_converter_input_stream_new (G_INPUT_STREAM (input_stream), 
G_CONVERTER (compressor));
+  compressed_bytes = flatpak_read_stream (converter, FALSE, NULL);
+
+  return g_variant_ref_sink (g_variant_new_from_bytes 
(G_VARIANT_TYPE_BYTESTRING, compressed_bytes, TRUE));
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/src/builder-utils.h 
new/flatpak-builder-1.0.3/src/builder-utils.h
--- old/flatpak-builder-1.0.1/src/builder-utils.h       2018-10-04 
14:48:07.000000000 +0200
+++ new/flatpak-builder-1.0.3/src/builder-utils.h       2019-01-25 
14:54:53.000000000 +0100
@@ -170,6 +170,13 @@
                               const char  *type,
                               FlatpakXml **prev_child_out);
 
+GBytes *   flatpak_read_stream (GInputStream *in,
+                                gboolean      null_terminate,
+                                GError      **error);
+GVariant * flatpak_variant_compress (GVariant *variant);
+GVariant * flatpak_variant_uncompress (GVariant *variant, const GVariantType 
*type);
+
+
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakXml, flatpak_xml_free);
 
 G_END_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/flatpak-builder-1.0.1/test-driver new/flatpak-builder-1.0.3/test-driver
--- old/flatpak-builder-1.0.1/test-driver       2018-09-25 14:29:35.000000000 
+0200
+++ new/flatpak-builder-1.0.3/test-driver       2019-01-11 16:32:13.000000000 
+0100
@@ -1,9 +1,9 @@
-#!/bin/sh
+#! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -140,7 +140,7 @@
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"


Reply via email to