[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ltib] mux_server.c / mux_server-1.0-fs-decl.patch / reject file
From: |
Franz Trierweiler |
Subject: |
Re: [Ltib] mux_server.c / mux_server-1.0-fs-decl.patch / reject file |
Date: |
Sun, 18 Oct 2009 23:59:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 |
Le 18/10/2009 12:34, Stuart Hughes a écrit :
Hi Franz,
First of all the GPP is http://bitshrine.org/gpp, not
http://www.zee2.com/gpp/, I've mirrored some files there, and they are
the same, but this is the wrong location (I may remove it). Please us
use bitshrine.org/gpp for future gpp references.
From your earlier email I see: the problem was here:
+ cd mux_sever-1.0
+ /bin/cp /opt/freescale/ltib/usr/src/rpm/SOURCES/mux_server.c
mux_server.c
+ echo 'Patch #0 (mux_sever-1.0-fs-decl.patch):'
Patch #0 (mux_sever-1.0-fs-decl.patch):
+ patch -p1 -s
1 out of 1 hunk FAILED -- saving rejects to file mux_server.c.rej
Try temporarily changing the spec file like this (turn off the -s
flag) and after removing the failed build:
$ rm -r /opt/freescale/ltib/usr/src/rpm/BUILD/mux*
and then re-run and see if you get any more output.
diff -u -r1.2 mux_server.spec
--- dist/lfs-5.1/mux_server/mux_server.spec 13 Jul 2009 10:33:48
-0000 1.2
+++ dist/lfs-5.1/mux_server/mux_server.spec 18 Oct 2009 10:32:05 -0000
@@ -19,7 +19,8 @@
%prep
%setup -T -c -n %{name}-%{version}
%{__cp} %{SOURCE0} mux_server.c
-%patch0 -p1
+#%patch0 -p1
+patch -p1 < %{PATCH0}
NOTE also the Freescale spec file is out of date. I made this change
a while back.
http://cvs.savannah.gnu.org/viewvc/ltib/dist/lfs-5.1/mux_server/mux_server.spec?root=ltib&r1=1.1&r2=1.2
Regards, Stuart
Franz Trierweiler wrote:
Good morning,
I resend since this message does not seem to have been properly
displayed in the latest LTIB digest.
LTIB patches mux_server.c with mux_server-1.0-fs-decl.patch. On my
machine, patch command creates a rej file:
***************
*** 648,659 ****
struct sockaddr_in sockaddr;
struct iochan *c;
int num_bind_retries = 0;
int rc;
if (verbose)
printf("tcp_listen_channel %d %d\n",port,stream_id);
- int fd = socket(PF_INET, SOCK_STREAM, 0);
if (fd < 0) {
fatal("socket() failed for stream %d", stream_id);
}
--- 648,660 ----
struct sockaddr_in sockaddr;
struct iochan *c;
int num_bind_retries = 0;
+ int fd;
int rc;
if (verbose)
printf("tcp_listen_channel %d %d\n",port,stream_id);
+ fd = socket(PF_INET, SOCK_STREAM, 0);
if (fd < 0) {
fatal("socket() failed for stream %d", stream_id);
}
I read man pages on "diff" and "patch" so that I can understand now
the underlying concepts of patch mechanisms. I understand what this
patch file wants to modifiy but I do not understand what the rej file
means. Where is the error?
For safety, I browsed http://www.zee2.com/gpp/ in order to make sure
there is not another release. Indeed, I do work with the same patch
version as the one on http://www.zee2.com/gpp/.
Thanks for your help.
Franz
Hi Stuart,
Well... I followed your advice and modified the mix_server.spec file in
/home/franz/ltib/dist/lfs-5.1/mux_server.
I have put in comment "%patch0 -p1" and added "patch -p1 < %{PATCH0}"
Finally, my spec file is now:
%define pfx /opt/freescale/rootfs/%{_target_cpu}
Name: mux_sever
Version: 1.0
Release: 1
Summary: Create and remove virtual network interfaces
Group: Applications/System
License: LGPL
Source0: mux_server.c
Patch0 : mux_sever-1.0-fs-decl.patch
BuildRoot : %{_tmppath}/%{name}
Prefix : %{pfx}
%description
serial console (de)multiplexor program
%prep
%setup -T -c -n %{name}-%{version}
%{__cp} %{SOURCE0} mux_server.c
#%patch0 -p1
patch -p1 < %{PATCH0}
%build
%{__cc} %{optflags} -lpthread mux_server.c -o mux_server
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/bin
install -d $RPM_BUILD_ROOT
install -m 755 mux_server $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/bin/
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{pfx}/%{_prefix}/bin/mux_server
I removed the old build: rm -r /opt/freescale/ltib/usr/src/rpm/BUILD/mux*
And re-un ./ltib; Now, I get a new message (Stripping trailing CRs from
patch.)
Processing: mux_server
========================
Build path taken because: no prebuilt rpm,
rpmbuild --dbpath ///opt/freescale/ltib/var/lib/rpm --target i686
--define '_unpackaged_files_terminate_build 0' --define '_target_cpu
i686' --define '__strip strip' --define '_topdir
/opt/freescale/ltib/usr/src/rpm' --define '_prefix
/opt/freescale/ltib/usr' --define '_tmppath /home/franz/ltib/tmp'
--define '_rpmdir /opt/freescale/ltib/usr/src/rpm/RPMS' --define
'_mandir /opt/freescale/ltib/usr/share/man' --define '_sysconfdir
/opt/freescale/ltib/etc' --define '_localstatedir /var' -bb --clean
--rmsource /home/franz/ltib/dist/lfs-5.1/mux_server/mux_server.spec
Building target platforms: i686
Building for target i686
Executing(%prep): /bin/sh -e /home/franz/ltib/tmp/rpm-tmp.22788
+ umask 022
+ cd /opt/freescale/ltib/usr/src/rpm/BUILD
+ cd /opt/freescale/ltib/usr/src/rpm/BUILD
+ rm -rf mux_sever-1.0
+ /bin/mkdir -p mux_sever-1.0
+ cd mux_sever-1.0
+ /bin/cp /opt/freescale/ltib/usr/src/rpm/SOURCES/mux_server.c mux_server.c
+ patch -p1
(Stripping trailing CRs from patch.)
patching file mux_server.c
Hunk #1 FAILED at 648.
1 out of 1 hunk FAILED -- saving rejects to file mux_server.c.rej
error: Bad exit status from /home/franz/ltib/tmp/rpm-tmp.22788 (%prep)
RPM build errors:
Bad exit status from /home/franz/ltib/tmp/rpm-tmp.22788 (%prep)
Build time for mux_server: 0 seconds
Failed building mux_server
Died at ./ltib line 1379.
traceback:
main::build_host_rpms:1379
main::host_checks:1434
main:539
Started: Sun Oct 18 23:35:12 2009
Ended: Sun Oct 18 23:35:15 2009
Elapsed: 3 seconds
These packages failed to build:
mux_server
Build Failed
And the reject file is:
address@hidden mux_sever-1.0]$ cat mux_server.c.rej
***************
*** 648,659 ****
struct sockaddr_in sockaddr;
struct iochan *c;
int num_bind_retries = 0;
int rc;
if (verbose)
printf("tcp_listen_channel %d %d\n",port,stream_id);
- int fd = socket(PF_INET, SOCK_STREAM, 0);
if (fd < 0) {
fatal("socket() failed for stream %d", stream_id);
}
--- 648,660 ----
struct sockaddr_in sockaddr;
struct iochan *c;
int num_bind_retries = 0;
+ int fd;
int rc;
if (verbose)
printf("tcp_listen_channel %d %d\n",port,stream_id);
+ fd = socket(PF_INET, SOCK_STREAM, 0);
if (fd < 0) {
fatal("socket() failed for stream %d", stream_id);
}
address@hidden mux_sever-1.0]$
You say that the Freescale spec file is out of date and that you made
this change a while back.
http://cvs.savannah.gnu.org/viewvc/ltib/dist/lfs-5.1/mux_server/mux_server.spec?root=ltib&r1=1.1&r2=1.2
but when I check the version 1.2 on Savannah, I do not see the
modification you are talking about (is that "patch -p1 < %{PATCH0}" ???
- version 1.2 does not have this change). Thus, I must admit I am a bit
lost...
Many thanks
Franz