The International Simutrans Forum

 

Author Topic: Several internal format bugs which should be fixed  (Read 3601 times)

0 Members and 1 Guest are viewing this topic.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Several internal format bugs which should be fixed
« on: January 18, 2012, 10:28:07 PM »
First of all, there are a bunch of .dat files which need to have the terminating "----" added, for simutranslator.  This patch fixes *some* of them.
Second, there are two comment fixes you still need to make.  This patch does those.
Third, two files have a terminating "----", but don't have a terminating newline.  This patch tries to add those, but I'm not sure if it will patch correctly, so you should check them by hand:
air/Ford_Trimotor_NSA.dat
air/Ford_Trimotor_RoyalMail.dat

Fourth, a bunch of .dat files, specifically including the ones in this patch, ended up saved in DOS format.  Please don't do this.  The patch may fix this or it may not.  If you can convert them back to UNIX/Windows format, it would be good.

I will have more patches to fix .dat files later, but this was what I got to before dinner tonight. 

These are all relatively new files.  Please remember the following when adding new .dat files:
(1) Always end a .dat file with (newline) ---- (newline) for the benefit of simutranslator
(2) Always save in Windows/UNIX format (line ending LF), not DOS format (line ending CR LF).

Thank you.

EDIT: patch didn't form correctly, revised patch attached now.  The Makefile in particular needed to be converted back to UNIX format.  I'm not sure which .dat files still need UNIX/DOS line ending fixes, but if you can go through all of them, that would be best.

EDIT: second patch attached to rename the AEC Standard STL to a legal name without spaces.

EDIT: third patch atttached to terminate citycar .dat files correctly for simutranslator

Edit: fourth patch attached to fix the BAC_111_500 .dat file.

There will be more.

Edit: fifth patch to fix .dat files for attractions (apart from the one I fixed in the first patch).

Edit: sixth patch to fix .dat files for boats.  Note that the mersey ferry is being converted back from DOS format to UNIX/Windows format.

Edit: seventh patch to add terminating lines to the .dat files for buses.  Note that one file is converted from DOS format to UNIX/Windows format.

Edit: I'm rethinking this.  There seems to be some subtlety in the rules for when separators are needed.  Of course this is totally undocumented.
« Last Edit: January 20, 2012, 12:08:33 AM by neroden »

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Several internal format bugs which should be fixed
« Reply #1 on: January 21, 2012, 06:06:51 PM »
Great - only I can't get any of these to work. I'm using Tortoise SVN in windows - they just won't show up. Any ideas?

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Several internal format bugs which should be fixed
« Reply #2 on: January 25, 2012, 12:32:12 PM »
 :o   You do have a way of applying diff files using 'patch' or something similar, I hope?

EDIT: Perhaps if you tell me *exactly* what you're doing I can figure out where it's going wrong.  From what you've said I don't have enough detail to debug.  EDIT: it might be bad arguments to patch... or if TortoiseSVN is driving the patching, it might have bad arguments hidden in the setting somewhere... anyway I need to know exactly what you're doing in order to debug it.

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Several internal format bugs which should be fixed
« Reply #3 on: January 25, 2012, 08:47:49 PM »
I open up TortoiseMerge (which should apply patches) and open the diff file, but instead of seeing the diff file once opened up and being given the option to start merging changes, I just get a blank window...

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Several internal format bugs which should be fixed
« Reply #4 on: January 25, 2012, 09:25:24 PM »
OK.  Can you open the diff file in a text editor (like WordPad)?  Does it have text? 

If it does have text, then it's a problem with TortoiseMerge, which I don't know very well, but I'll try to figure it out.

If not, it may be an upload problem, in which case I'll try uploading them again.

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Several internal format bugs which should be fixed
« Reply #5 on: January 25, 2012, 09:31:53 PM »
Diff file itself is fine - I can understand it no problem myself. I'm just clueless with TortoiseSVN when it comes to patching...

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Several internal format bugs which should be fixed
« Reply #6 on: January 25, 2012, 10:06:58 PM »
It might be easier to send complete files instead of diffs, if you have them reasonably separate and didn't touch them lately...

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9472
  • Languages: De,EN,JP
Re: Several internal format bugs which should be fixed
« Reply #7 on: January 25, 2012, 10:09:40 PM »
I needed, I can apply these fixes too ... (and vs too btw)

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Several internal format bugs which should be fixed
« Reply #8 on: January 25, 2012, 10:11:16 PM »
You would both be welcome to.  Only a few files have changed recently, it's mostly additions.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Several internal format bugs which should be fixed
« Reply #9 on: January 25, 2012, 11:58:46 PM »
Maybe TortoiseMerge is picky about its diff format.  I find this in the manual:

"Caution

Currently, only patch files in Unified Diff Format are supported. And only files which were generated from a Subversion working copy. Other formats like patch files generated by CVS are currently not supported! "

So that's your problem.  TortoiseMerge won't accept "raw" Unified Diff format patches, it requires SVN annotations for some reason.  This is not so great.  This is the only patch program I've ever heard of which is that picky.  Can you get a copy of 'patch'?

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Several internal format bugs which should be fixed
« Reply #10 on: January 26, 2012, 06:58:03 PM »
Thanks. Got myself a copy of patch - now to try and use it...

EDIT: can't figure out what to stick in the command line in windows - could you help?
« Last Edit: January 26, 2012, 07:07:17 PM by The Hood »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4580
  • Languages: EN, DE, AT
Re: Several internal format bugs which should be fixed
« Reply #11 on: January 27, 2012, 09:35:35 AM »
open command window (execute 'cmd'), change to the right directory, type
Code: [Select]
patch -p1 < patchfile