Richard W.M. Jones wrote:
On Tue, Nov 25, 2008 at 11:30:49PM +0100, Farkas Levente wrote:
> Richard W.M. Jones wrote:
>> On Tue, Nov 25, 2008 at 06:34:20PM +0100, Farkas Levente wrote:
>>> hi,
>>> a second try to make a common scripts.
>>> i hope it'll work.
>>> i still not enable mingw32.sh, but it also would be useful with this patch.
>> I don't have time now, but I will check this tomorrow.
>>
>> Have you tried to use strace on mingw32-make? Last time I saw that
>> the %{name} and %{version} macros were not being substituted into the
>> variables on the make command line, which is why I rejected that
>> patch.
> i don't really understand it. i try this both from spec file and command
> line, but there is no %{name} and %{version} in it? what can i looking
> for in a strace output?
OK, that's encouraging, but I'll check for sure tomorrow. You need to
do something like:
strace -f -o /tmp/log -s 4096 mingw32-make
grep '%' /tmp/log | less
i can't see anything interesting in it.
anyway here a modified (two char) version of the previous patch (which
looks better).
--
Levente "Si vis pacem para bellum!"
Index: mingw32-filesystem.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-filesystem/devel/mingw32-filesystem.spec,v
retrieving revision 1.6
diff -u -u -r1.6 mingw32-filesystem.spec
--- mingw32-filesystem.spec 24 Nov 2008 16:08:07 -0000 1.6
+++ mingw32-filesystem.spec 26 Nov 2008 09:03:35 -0000
@@ -1,8 +1,8 @@
%define debug_package %{nil}
Name: mingw32-filesystem
-Version: 39
-Release: 3%{?dist}
+Version: 40
+Release: 1%{?dist}
Summary: MinGW base filesystem and environment
Group: Development/Libraries
@@ -75,7 +75,7 @@
mkdir -p $RPM_BUILD_ROOT%{_bindir}
pushd $RPM_BUILD_ROOT%{_bindir}
-for i in mingw32-configure; do
+for i in mingw32-configure mingw32-make; do
ln -s %{_libexecdir}/mingw32-scripts $i
done
popd
@@ -135,13 +135,18 @@
%config(noreplace) %{_sysconfdir}/rpm/macros.mingw32
#%config(noreplace) %{_sysconfdir}/profile.d/mingw32.sh
#%config(noreplace) %{_sysconfdir}/profile.d/mingw32.csh
-%{_bindir}/mingw32-configure
+%{_bindir}/mingw32-*
%{_libexecdir}/mingw32-scripts
%{_prefix}/i686-pc-mingw32/
/usr/lib/rpm/mingw32-*
%changelog
+* Tue Nov 25 2008 Levente Farkas <lfarkas(a)lfarkas.org> - 40-1
+- Rewrite mingw32-scripts to run in the current shell
+- Re-add mingw32-make
+- Add mingw32-env to mingw32.sh
+
* Mon Nov 24 2008 Richard W.M. Jones <rjones(a)redhat.com> - 39-3
- Unify mingw32-filesystem packages from all three branches again, and test.
- Fix mingw32-scripts so it can handle extra parameters correctly.
Index: mingw32-scripts.sh
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-filesystem/devel/mingw32-scripts.sh,v
retrieving revision 1.1
diff -u -u -r1.1 mingw32-scripts.sh
--- mingw32-scripts.sh 24 Nov 2008 16:08:07 -0000 1.1
+++ mingw32-scripts.sh 26 Nov 2008 09:03:35 -0000
@@ -1,6 +1,6 @@
#!/bin/sh -
-# mingw32-configure
+# mingw32-scripts
# Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones.
# Copyright (C) 2008 Levente Farkas
#
@@ -21,7 +21,5 @@
# This is a useful command-line script through which one can use the
# macros from mingw32-macros.mingw32 cross-compilation.
-# XXX This doesn't handle quoting of extra parameters which contain
-# spaces correctly.
-
-rpm --eval "%{_"`basename $0|tr "-" "_"`"}
$@"|sh
+NAME="_`basename $0|tr -- - _`"
+eval "`rpm --eval "%{$NAME}"`" "$@"
Index: mingw32.sh
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-filesystem/devel/mingw32.sh,v
retrieving revision 1.1
diff -u -u -r1.1 mingw32.sh
--- mingw32.sh 30 Oct 2008 09:49:17 -0000 1.1
+++ mingw32.sh 26 Nov 2008 09:03:35 -0000
@@ -1 +1,3 @@
# Environment variables for MinGW.
+
+alias mingw32-env='eval `rpm --eval %{_mingw32_env}`'