[ABS] Force clean all old rootstrap
[scm/meta/abs.git] / abs
diff --git a/abs b/abs
index 8076924..487f57f 100755 (executable)
--- a/abs
+++ b/abs
@@ -147,7 +147,7 @@ class _Rootstrap(object):
     def list_rootstrap(self, rootstrap_search=None):
         """List all the rootstraps"""
 
-        rs_prefix = 'mobile|wearable'
+        rs_prefix = 'mobile|wearable|tizeniot'
         if rootstrap_search is not None:
             rs_prefix = rootstrap_search
         print 'Set rs_prefix: %s' % rs_prefix
@@ -191,13 +191,13 @@ 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)
 
         self.home = os.getenv('HOME')
-        self.config_file = os.path.join(g_home, '.abs')
+        self.config_file = os.path.join(g_home, '.absconfig')
 
         if sdkpath is None:
             self.tizen = self.get_user_root()
@@ -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)
@@ -404,8 +411,10 @@ class Sdk(object):
             os.makedirs(output_dir)
         with open(logpath + '.log', 'w') as lf:
             lf.write(out)
-        if 'keystore password was incorrect' in out:
-            raise LocalError('keystore password was incorrect for %s.' % appname)
+        if 'keystore password was incorrect' in out \
+            or 'Sequence tag error' in out \
+            or 'Signing... java.io.IOException: ' in out:
+            raise LocalError('signing error for %s.' % appname)
         raise LocalError('TPK/WGT file not generated for %s.' % appname)
 
     def package(self, source, cert=None, pkg_type=None, conf='Debug', manual_strip=False):
@@ -667,6 +676,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 +691,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' :