From patchwork Wed Jan 1 06:50:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 37151 Received: (qmail 21146 invoked by alias); 1 Jan 2020 06:50:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 21086 invoked by uid 89); 1 Jan 2020 06:50:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Jan 2020 06:50:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A225D117070; Wed, 1 Jan 2020 01:50:49 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2ayjQ0eQ4CMA; Wed, 1 Jan 2020 01:50:49 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3C8EB117068; Wed, 1 Jan 2020 01:50:49 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id F2A11838C8; Wed, 1 Jan 2020 10:50:44 +0400 (+04) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [PATCH 3/6] gdb/copyright.py: Adapt after move of gnulib from gdb to toplevel Date: Wed, 1 Jan 2020 10:50:30 +0400 Message-Id: <20200101065033.24334-4-brobecker@adacore.com> In-Reply-To: <20200101065033.24334-1-brobecker@adacore.com> References: <20200101065033.24334-1-brobecker@adacore.com> gdb/ChangeLog: * copyright.py: Adapt after move of gnulib directory from gdb directory to toplevel directory. (cherry picked from commit 51fd40020e1e0b21642cdec9c749f2e3862939ea) --- gdb/ChangeLog | 5 +++++ gdb/copyright.py | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f1cb5299c8f..c91da6a23bd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-01-01 Joel Brobecker + + * copyright.py: Adapt after move of gnulib directory from gdb + directory to toplevel directory. + 2020-01-01 Joel Brobecker * copyright.py (main): Exit if run from the wrong directory. diff --git a/gdb/copyright.py b/gdb/copyright.py index 7771d9d7f64..e6feb376a92 100644 --- a/gdb/copyright.py +++ b/gdb/copyright.py @@ -45,7 +45,7 @@ def get_update_list(): the files are relative to that root directory. """ result = [] - for gdb_dir in ('gdb', 'sim', 'include/gdb'): + for gdb_dir in ('gdb', 'gnulib', 'sim', 'include/gdb'): for root, dirs, files in os.walk(gdb_dir, topdown=True): for dirname in dirs: reldirname = "%s/%s" % (root, dirname) @@ -80,7 +80,7 @@ def update_files(update_list): os.environ['UPDATE_COPYRIGHT_USE_INTERVALS'] = '2' # Perform the update, and save the output in a string. - update_cmd = ['bash', 'gdb/gnulib/import/extra/update-copyright'] + update_cmd = ['bash', 'gnulib/import/extra/update-copyright'] update_cmd += update_list p = subprocess.Popen(update_cmd, stdout=subprocess.PIPE, @@ -142,13 +142,14 @@ def may_have_copyright_notice(filename): def main (): """The main subprogram.""" - if not os.path.isfile("gnulib/import/extra/update-copyright"): - print "Error: This script must be called from the gdb directory." - sys.exit(1) - root_dir = os.path.dirname(os.getcwd()) os.chdir(root_dir) + if not (os.path.isdir('gdb') and + os.path.isfile("gnulib/import/extra/update-copyright")): + print "Error: This script must be called from the gdb directory." + sys.exit(1) + update_list = get_update_list() update_files (update_list) @@ -185,7 +186,7 @@ def main (): EXCLUDE_LIST = ( 'gdb/nat/glibc_thread_db.h', 'gdb/CONTRIBUTE', - 'gdb/gnulib/import' + 'gnulib/import' ) # Files which should not be modified, either because they are