use abspath in wordir to avoid no basename for git project
authorZhang Qiang <qiang.z.zhang@intel.com>
Wed, 6 Jun 2012 06:52:17 +0000 (14:52 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Wed, 6 Jun 2012 06:52:17 +0000 (14:52 +0800)
gitbuildsys/cmd_build.py
gitbuildsys/cmd_export.py
gitbuildsys/cmd_remotebuild.py

index 0141b2d..963861d 100644 (file)
@@ -224,7 +224,7 @@ def do(opts, args):
     if len(args) > 1:
         msger.error('only one work directory can be specified in args.')
     if len(args) == 1:
-        workdir = args[0]
+        workdir = os.path.abspath(args[0])
 
     hostarch = get_hostarch()
     buildarch = hostarch
index c08321b..025975f 100644 (file)
@@ -52,13 +52,13 @@ def do(opts, args):
     """
     workdir = os.getcwd()
 
-    if not os.path.exists("%s/packaging" % workdir):
-        msger.error('No packaging directory, so there is nothing to export.')
-
     if len(args) > 1:
         msger.error('only one work directory can be specified in args.')
     if len(args) == 1:
-        workdir = args[0]
+        workdir = os.path.abspath(args[0])
+
+    if not os.path.exists("%s/packaging" % workdir):
+        msger.error('No packaging directory, so there is nothing to export.')
 
     if not os.path.isdir("%s/.git" % workdir):
         msger.error('Not a git repository (%s), aborting' % workdir)
index fc5b0fb..25bebee 100644 (file)
@@ -57,7 +57,7 @@ def do(opts, args):
     if len(args) > 1:
         msger.error('only one work directory can be specified in args.')
     if len(args) == 1:
-        workdir = args[0]
+        workdir = os.path.abspath(args[0])
     try:
         repo = repository.GitRepository(workdir)
     except repository.GitRepositoryError: