]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/copyright.py: Exit if run from the wrong directory
authorJoel Brobecker <brobecker@adacore.com>
Wed, 1 Jan 2020 06:32:20 +0000 (10:32 +0400)
committerJoel Brobecker <brobecker@adacore.com>
Sun, 5 Jan 2020 05:44:09 +0000 (09:44 +0400)
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
gdb/copyright.py

index 4a1d5ddee1f444017bfc399ed683247ac7da0e63..f1cb5299c8f09424561d727a0784f9798fa62cd8 100644 (file)
@@ -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.
index 84ead523eeaa8ce754462c019e75c7e682d29790..7771d9d7f64099d335ba5d9245afb6ff11fdf25f 100644 (file)
@@ -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)