py-compile: the '--destdir' option now accepts a blank argument
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 8 Jun 2011 12:55:01 +0000 (14:55 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 9 Jun 2011 13:57:58 +0000 (15:57 +0200)
* lib/py-compile (Option parsing): Do not count an empty argument
to `--destdir' or `--basedir' as a missing argument.
* lib/python.am: Simplify accordingly, passing the `--destdir'
option to py-compile unconditionally, even if `$(DESTDIR)' is
empty.
* NEWS: Update.

ChangeLog
NEWS
lib/am/python.am
lib/py-compile

index d3ce17e..6f2d7b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-06-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       py-compile: the '--destdir' option now accepts a blank argument
+       * lib/py-compile (Option parsing): Do not count an empty argument
+       to `--destdir' or `--basedir' as a missing argument.
+       * lib/python.am: Simplify accordingly, passing the `--destdir'
+       option to py-compile unconditionally, even if `$(DESTDIR)' is
+       empty.
+       * NEWS: Update.
+
+2011-06-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        python: run the 'py-compile' script with $(SHELL)
        * lib/python.am (install-%DIR%PYTHON): Run each instance of
        py-compile using $(SHELL).  Since we are at it, break overly
diff --git a/NEWS b/NEWS
index b7f9b54..5ebae6e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ New in 1.11.0a:
   - The `lzma' compression scheme and associated automake option `dist-lzma'
     is obsoleted by `xz' and `dist-xz' due to upstream changes.
 
+  - The py-compile script now accepts empty arguments passed to the options
+    `--destdir' and `--basedir'.
+
 Bugs fixed in 1.11.0a:
 
 * Bugs introduced by 1.11:
index a8c19d7..40aaa62 100644 (file)
@@ -53,12 +53,8 @@ if %?BASE%
 ## Byte-compile must be done at install time, since file times are
 ## encoded in the actual files.
        if test -n "$$dlist"; then \
-         if test -z "$(DESTDIR)"; then \
-           $(am__py_compile) --basedir "$(%NDIR%dir)" $$dlist; \
-         else \
-           $(am__py_compile) --destdir "$(DESTDIR)" \
-                             --basedir "$(%NDIR%dir)" $$dlist; \
-         fi; \
+         $(am__py_compile) --destdir "$(DESTDIR)" \
+                           --basedir "$(%NDIR%dir)" $$dlist; \
        else :; fi
 else !%?BASE%
        @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \
@@ -78,12 +74,8 @@ else !%?BASE%
 ## Byte-compile must be done at install time, since file times are
 ## encoded in the actual files.
          if test -n "$$dlist"; then \
-           if test -z "$(DESTDIR)"; then \
-             $(am__py_compile) --basedir "$(%NDIR%dir)" $$dlist; \
-           else \
-             $(am__py_compile) --destdir "$(DESTDIR)" \
-                               --basedir "$(%NDIR%dir)" $$dlist; \
-           fi; \
+           $(am__py_compile) --destdir "$(DESTDIR)" \
+                             --basedir "$(%NDIR%dir)" $$dlist; \
          else :; fi \
        done
 endif !%?BASE%
index 3f9d05b..2a526ca 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 # py-compile - Compile a Python program
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-06-08.12; # UTC
 
-# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free
+# Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -38,18 +38,20 @@ files=
 while test $# -ne 0; do
   case "$1" in
     --basedir)
-      basedir=$2
-      if test -z "$basedir"; then
+      if test $# -lt 2; then
         echo "$0: Missing argument to --basedir." 1>&2
         exit 1
+      else
+        basedir=$2
       fi
       shift
       ;;
     --destdir)
-      destdir=$2
-      if test -z "$destdir"; then
+      if test $# -lt 2; then
         echo "$0: Missing argument to --destdir." 1>&2
         exit 1
+      else
+        destdir=$2
       fi
       shift
       ;;