From: Stefano Lattarini Date: Wed, 8 Jun 2011 12:55:01 +0000 (+0200) Subject: py-compile: the '--destdir' option now accepts a blank argument X-Git-Tag: v1.12.0b~272^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd8b570a6a55cb20690cdc2c312309338d2495d3;p=platform%2Fupstream%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index d3ce17e..6f2d7b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 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) * 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 --- 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 a8c19d7..40aaa62 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 3f9d05b..2a526ca 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 ;;