[Pkg-mozext-commits] [SCM] Collection of development scripts used for XUL extensions. branch, master, updated. 0.23-68-gc9a34d6

Benjamin Drung bdrung at debian.org
Sat Apr 21 22:50:09 UTC 2012


The following commit has been merged in the master branch:
commit c9a34d68d39b0f10b5b4ca234f72e41d8201ddf9
Author: Benjamin Drung <bdrung at debian.org>
Date:   Sun Apr 22 00:49:04 2012 +0200

    install-xpi: Fail nicely if debian/control is missing.

diff --git a/install-xpi b/install-xpi
index 17915f1..eec71c0 100755
--- a/install-xpi
+++ b/install-xpi
@@ -37,6 +37,18 @@ LICENSE_PATTERN_LIST = (
 COMMAND_LINE_SYNTAX_ERROR = 1
 XPI_FILE_DOES_NOT_EXISTS = 2
 
+def check_package_directory(script_name):
+    """Check if the debian/ directory and files like debian/control exist."""
+    if not os.path.isdir("debian"):
+        sys.stderr.write(script_name + ": Error: Failed to find debian/ "
+                         "directory. Please execute the script in a Debian "
+                         "source package.\n")
+        sys.exit(1)
+    if not os.path.isfile("debian/control"):
+        sys.stderr.write(script_name + ": Error: debian/control file is "
+                         "missing.\n")
+        sys.exit(1)
+
 def get_query_field_id_as_list(rdf_path, query_string):
     ret = []
     model = RDF.Model()
@@ -244,6 +256,8 @@ def main():
                              (script_name, ", ".join(args))
         sys.exit(COMMAND_LINE_SYNTAX_ERROR)
 
+    check_package_directory(script_name)
+
     if options.package is None:
         options.package = get_first_package()
 

-- 
Collection of development scripts used for XUL extensions.



More information about the Pkg-mozext-commits mailing list