This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/6] gdb/copyright.py: Exit if run from the wrong directory
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>
- Date: Wed, 1 Jan 2020 10:50:29 +0400
- Subject: [PATCH 2/6] gdb/copyright.py: Exit if run from the wrong directory
- References: <20200101065033.24334-1-brobecker@adacore.com>
We printed an error, but kept going anyway... ;-)
gdb/ChangeLog:
* copyright.py (main): Exit if run from the wrong directory.
(cherry picked from commit 5fb651f2ddd54a1d3da6fcd172d9fab81893bbf9)
---
gdb/ChangeLog | 4 ++++
gdb/copyright.py | 3 +++
2 files changed, 7 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4a1d5ddee1f..f1cb5299c8f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-01 Joel Brobecker <brobecker@adacore.com>
+
+ * copyright.py (main): Exit if run from the wrong directory.
+
2020-01-01 Joel Brobecker <brobecker@adacore.com>
* top.c (print_gdb_version): Change copyright year to 2020.
diff --git a/gdb/copyright.py b/gdb/copyright.py
index 84ead523eea..7771d9d7f64 100644
--- a/gdb/copyright.py
+++ b/gdb/copyright.py
@@ -34,6 +34,7 @@ import datetime
import os
import os.path
import subprocess
+import sys
def get_update_list():
@@ -143,6 +144,8 @@ 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)
--
2.17.1