[gnome-software] flatpak: Use the full path to the source dir, make build.py py3



commit a462c5d727eb7e8c7a3753317539069218939644
Author: Iain Lane <iain orangesquash org uk>
Date:   Wed Mar 8 14:54:04 2017 +0000

    flatpak: Use the full path to the source dir, make build.py py3
    
    We were failing to find tests/ in some situations; use a full path to
    fix that.
    
    /bin/python doesn't exist on all distros - use /usr/bin/python which
    does. While we're there, make the script use python3.

 plugins/flatpak/Makefile.am    |    2 +-
 plugins/flatpak/tests/build.py |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/plugins/flatpak/Makefile.am b/plugins/flatpak/Makefile.am
index 4f19029..23640d0 100644
--- a/plugins/flatpak/Makefile.am
+++ b/plugins/flatpak/Makefile.am
@@ -37,7 +37,7 @@ gs_self_test_CFLAGS = $(GS_PRIVATE_CFLAGS)
 TESTS = gs-self-test
 
 tests/app-with-runtime/repo: tests/app-with-runtime
-       $(AM_V_GEN) cd tests && ./build.py && cd -
+       $(AM_V_GEN) cd "$(srcdir)/tests" && ./build.py && cd -
 
 BUILT_SOURCES =                                                \
        tests/app-with-runtime/repo
diff --git a/plugins/flatpak/tests/build.py b/plugins/flatpak/tests/build.py
index 67fa6d2..ae9f3f1 100755
--- a/plugins/flatpak/tests/build.py
+++ b/plugins/flatpak/tests/build.py
@@ -1,21 +1,21 @@
-#!/bin/python
+#!/usr/bin/python3
 
 import subprocess
 import os
 import shutil
 
 def build_flatpak(appid, srcdir, repodir, cleanrepodir=True):
-    print 'Building %s from %s into %s' % (appid, srcdir, repodir)
+    print('Building %s from %s into %s' % (appid, srcdir, repodir))
 
     # delete repodir
     if cleanrepodir and os.path.exists(repodir):
-        print "Deleting %s" % repodir
+        print("Deleting %s" % repodir)
         shutil.rmtree(repodir)
 
     # delete exportdir
     exportdir = os.path.join(srcdir, appid, 'export')
     if os.path.exists(exportdir):
-        print "Deleting %s" % exportdir
+        print("Deleting %s" % exportdir)
         shutil.rmtree(exportdir)
 
     # use git master where available
@@ -60,7 +60,7 @@ def build_flatpak(appid, srcdir, repodir, cleanrepodir=True):
 def copy_repo(srcdir, destdir):
     srcdir_repo = os.path.join(srcdir, 'repo')
     destdir_repo = os.path.join(destdir, 'repo')
-    print "Copying %s to %s" % (srcdir_repo, destdir_repo)
+    print("Copying %s to %s" % (srcdir_repo, destdir_repo))
     if os.path.exists(destdir_repo):
         shutil.rmtree(destdir_repo)
     shutil.copytree(srcdir_repo, destdir_repo)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]