From: Peter Rosin Date: Thu, 2 Sep 2010 19:04:00 +0000 (+0200) Subject: Make ar-lib support backslashed files in archives. X-Git-Tag: v1.11.3~3^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a99a243f943f02f97e9fc2df5020d33997a76d0;p=platform%2Fupstream%2Fautomake.git Make ar-lib support backslashed files in archives. * lib/ar-lib: If an archive member contains a backslash, make sure it is escaped when the archive member is extracted. * tests/ar-lib.test: Test the above. Signed-off-by: Peter Rosin --- diff --git a/ChangeLog b/ChangeLog index 5d80edb..02f2fcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,16 @@ +2010-09-02 Peter Rosin + + Make ar-lib support backslashed files in archives. + * lib/ar-lib: If an archive member contains a backslash, make sure + it is escaped when the archive member is extracted. + * tests/ar-lib.test: Test the above. + 2010-08-31 Peter Rosin Do file name conversion for object files in the compile wrapper. * lib/compile (func_cl_wrapper): Do file name conversion for object files (i.e. extensions .obj, .OBJ, .o and .O) if needed. - * lib/compile4.test: Test the above. + * tests/compile4.test: Test the above. 2010-08-16 Peter Rosin @@ -22,7 +29,7 @@ file extension as C++, unless it's given a hint. So hint about .cc, .CC, .cxx, .CXX, c++ and C++. Also do path conversion on .c, .cpp, .CPP, .lib, .LIB and .Lib files. - * lib/compile3.test: Test the C++ hinting. + * tests/compile3.test: Test the C++ hinting. 2010-08-12 Peter Rosin diff --git a/lib/ar-lib b/lib/ar-lib index ef03430..4883fef 100755 --- a/lib/ar-lib +++ b/lib/ar-lib @@ -2,7 +2,7 @@ # Wrapper for Microsoft lib.exe me=ar-lib -scriptversion=2010-08-12.16; # UTC +scriptversion=2010-09-02.19; # UTC # Copyright (C) 2010 Free Software # Foundation, Inc. @@ -219,7 +219,7 @@ elif test -n "$extract"; then esac done else - $AR -NOLOGO -LIST "$archive" | while read member + $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member do $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? done diff --git a/tests/ar-lib.test b/tests/ar-lib.test index d418c21..4759b65 100755 --- a/tests/ar-lib.test +++ b/tests/ar-lib.test @@ -26,6 +26,8 @@ cat >lib <<'END' #! /bin/sh if test x"$2" = x-LIST -a $3 = fake.lib; then echo fake.obj +elif test x"$2" = x-LIST -a $3 = fake2.lib; then + echo dir\\fake2.obj else echo "lib $@" fi @@ -76,4 +78,9 @@ test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib" opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj` test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib" +# Check if ar-lib can extract backslashed members +touch fake2.lib +opts=`./ar-lib ./lib x fake2.lib` +test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib" + :