From dd8b570a6a55cb20690cdc2c312309338d2495d3 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 8 Jun 2011 14:55:01 +0200 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ NEWS | 3 +++ lib/am/python.am | 16 ++++------------ lib/py-compile | 16 +++++++++------- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index d3ce17e84..6f2d7b15b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-06-08 Stefano Lattarini + + 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 python: run the 'py-compile' script with $(SHELL) diff --git a/NEWS b/NEWS index b7f9b541c..5ebae6ebe 100644 --- 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: diff --git a/lib/am/python.am b/lib/am/python.am index a8c19d767..40aaa620d 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -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% diff --git a/lib/py-compile b/lib/py-compile index 3f9d05b60..2a526cab7 100755 --- a/lib/py-compile +++ b/lib/py-compile @@ -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 ;; -- 2.47.2