From d4420e731aae5bf3ba185192262494883ed8d03c Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Wed, 6 Jun 2012 14:52:17 +0800 Subject: [PATCH] use abspath in wordir to avoid no basename for git project --- gitbuildsys/cmd_build.py | 2 +- gitbuildsys/cmd_export.py | 8 ++++---- gitbuildsys/cmd_remotebuild.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index 0141b2d..963861d 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -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 diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index c08321b..025975f 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -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) diff --git a/gitbuildsys/cmd_remotebuild.py b/gitbuildsys/cmd_remotebuild.py index fc5b0fb..25bebee 100644 --- a/gitbuildsys/cmd_remotebuild.py +++ b/gitbuildsys/cmd_remotebuild.py @@ -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: -- 2.7.4