Add no-dbus parameter in case of local test 17/227517/3
authorHyokeun Jeon <hyokeun.jeon@samsung.com>
Thu, 12 Mar 2020 08:46:29 +0000 (17:46 +0900)
committerHyokeun Jeon <hyokeun.jeon@samsung.com>
Thu, 12 Mar 2020 08:56:41 +0000 (17:56 +0900)
Change-Id: I26e775d10bcb63964e571d7f273781dd727d9baa

abs

diff --git a/abs b/abs
index 8076924..a73c8bb 100755 (executable)
--- a/abs
+++ b/abs
@@ -191,7 +191,7 @@ class Sdk(object):
                      'tizen-sdk-ux/tools/ide/bin/tizen', \
                      'tizen-sdk-cli/tools/ide/bin/tizen']
 
-    def __init__(self, sdkpath=None, rootstrap_search=None):
+    def __init__(self, sdkpath=None, rootstrap_search=None, no_dbus=False):
 
         self.error_parser = ErrorParser()
         self.runtool = Executor(checker=self.error_parser)
@@ -215,6 +215,10 @@ class Sdk(object):
             raise LocalError('Fail to locate cli tool')
 
         self.rs = _Rootstrap(sdk_path=self.tizen, config=self.config_file, rootstrap_search=rootstrap_search)
+        if no_dbus != False:
+            self.no_dbus = True
+        else:
+            self.no_dbus = False
 
     def get_user_root(self):
 
@@ -249,7 +253,10 @@ class Sdk(object):
 
         cmd = [self.tizen, command] + args
         if command == 'package':
-            cmd = ['dbus-run-session -- bash; echo build | gnome-keyring-daemon --unlock; '] + cmd
+            dbus_command = 'dbus-run-session -- bash; echo build | gnome-keyring-daemon --unlock;  '
+            if self.no_dbus == True:
+                dbus_command = ' '
+            cmd = ['{} '.format(dbus_command)] + cmd
         print '\nRunning command:\n    %s' % ' '.join(cmd)
         return self.runtool.run('{}'.format(' '.join(cmd)), \
                 show=show, checker=checker)
@@ -667,6 +674,8 @@ def argument_parsing(argv):
                         help='Extra compile options USER_CPP_OPTS')
     build.add_argument('--link-opts', action='store', dest='link_opts', \
                         help='Extra linking options USER_LINK_OPTS')
+    build.add_argument('--no-dbus', action='store', dest='no_dbus', default=False, \
+                        help='Do not run dbus session before packaging')
 
     return parser.parse_args(argv[1:])
 
@@ -680,7 +689,7 @@ def build_main(args):
         print '-------------------'
         print '(%s)' % args.profiletosearch
         print '-------------------'
-        my_sdk = Sdk(sdkpath=args.sdkpath, rootstrap_search=args.profiletosearch)
+        my_sdk = Sdk(sdkpath=args.sdkpath, rootstrap_search=args.profiletosearch, no_dbus=args.no_dbus)
         my_sdk.clean(my_source)
         my_sdk.build_tizen(my_source, rootstrap=args.rootstrap, arch=args.arch, jobs=args.jobs)
         if args.conf == 'Debug' :