PDA

View Full Version : [SOLVED] Trying to repackage JOSM, stuck on error with patches


marvin_ita
25th December 2010, 03:20 PM
Hi,
I'm trying to make an updated rpm for JOSM, starting from the source RPM I found on koji (http://koji.fedoraproject.org/koji/packageinfo?packageID=10497).
However, when I issue the 'rpmbuild -bp' command I get

$ rpmbuild -bp josm.spec
Esecuzione(%prep) in corso: /bin/sh -e /var/tmp/rpm-tmp.lUfdAp
+ umask 022
+ cd /home/marvin/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/marvin/rpmbuild/BUILD
+ rm -rf josm-0
+ /usr/bin/gzip -dc /home/marvin/rpmbuild/SOURCES/josm-0.3740svn.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd josm-0
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #0 (josm-0-disable_oauth.patch):'
Patch #0 (josm-0-disable_oauth.patch):
+ /bin/cat /home/marvin/rpmbuild/SOURCES/josm-0-disable_oauth.patch
+ /usr/bin/patch -s -p1 --fuzz=0
3 out of 3 hunks FAILED -- saving rejects to file build.xml.rej
errore: Stato d'uscita errato da /var/tmp/rpm-tmp.lUfdAp (%prep)


Errori di compilazione RPM:
Stato d'uscita errato da /var/tmp/rpm-tmp.lUfdAp (%prep)


In another file I found the problem, changed the patch and I made it work, but with the build.xml I cannot see the reason it won't work, since the patch seems perfectly to me...

vallimar
25th December 2010, 08:19 PM
It worked fine for me after fixing the MainApplication.java issue.
I did notice that the build.xml portion of the patch is in cr/lf dos-style format.
You didn't change that did you? That could mess up being able to apply it.
Depending on the editor used, it could have reformatted it without you knowing.

marvin_ita
26th December 2010, 10:28 AM

That was the problem, thanks!
I used Kwrite to edit the patch and I didn't notice it was DOS formatted in the first lines.... editing from terminal did the trick!

Strange is that if I removed that patch from the .spec file there was another patch (that I didn't edit) failing on build.xml... :confused:

---------- Post added at 11:28 AM ---------- Previous post was at 11:05 AM ----------

Another question... I think I must change the REVISION.XML file in the source directory to match the actual revision or the program always complains it must be upgraded.
Is there a place where I can find that file in the git or svn repository or I must edit it by hand? How have you resolved this issue?

Thank you

vallimar
26th December 2010, 03:38 PM
Strange is that if I removed that patch from the .spec file there was another patch (that I didn't edit) failing on build.xml... :confused:
It's not unusual to have later patches be dependant on earlier ones, especially as new patches are added on for newer releases and the older patch still works. Occasionally they will sometimes combine the patches, but not always.

Another question... I think I must change the REVISION.XML file in the source directory to match the actual revision or the program always complains it must be upgraded.
Is there a place where I can find that file in the git or svn repository or I must edit it by hand? How have you resolved this issue?

Thank you
I don't actually use the program, I just grabbed it to test your case.
Not sure how it checks that. If you can't seem to locate it, let me know and I'll grab it again to see what I can find.

marvin_ita
26th December 2010, 03:53 PM
Thank you Vallimar, I think I did it (I manually grabbed the info from svn and created the revision.xml file).

vallimar
27th December 2010, 01:02 AM
Great job! I find it rewarding and liberating to not be stuck with only what the distribution(s) offer.