aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: [1] 2

Author Topic: Recognize additional file formats  (Read 9844 times)

gagar

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 28
Recognize additional file formats
« on: May 31, 2011, 09:25:15 AM »

Hey guys,

Now that I saw that the next version of aMule was coming, I wanted to suggest some additional file formats that could be, IMHO, usefully recognized. I'm thinking to OOo files and Ogg Theora videos along with a couple of other formats. Please see the attached patch for OtherFunctions.cpp for details (it should correspond to the latest version of the file which I fetched from the git repo at repo.or.cz/w/amule.git but please double check it).

I performed a global search for all of the file types and there were results, except for some OOo template files which I added anyway because their equivalent versions for Microsoft Office were already there.

Of course, if you think something's stupid feel free to say it. People often say that I do weird things, so... :)
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Recognize additional file formats
« Reply #1 on: May 31, 2011, 07:55:51 PM »

Are there really still zoo files around ? That format was dying out in the 80s iirc.
Anyway I like your patch. Do me a favor and post just the modified file here (instead of the diff) and I'll commit it.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

gagar

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 28
Re: Recognize additional file formats
« Reply #2 on: June 01, 2011, 12:01:59 AM »

Thanks for your answer. I attached the patched OtherFunctions.cpp in uncompressed form as I think I read on another thread that you  preferred such versions.

And yeah, zoo is pretty rare nowadays, but you still stumble upon interesting stuff in this format from time to time, especially for those who remember the golden age of Amiga.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Recognize additional file formats
« Reply #3 on: June 01, 2011, 06:06:26 AM »

Stu prefers files like that. Everyone else prefers diff files.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Recognize additional file formats
« Reply #4 on: June 01, 2011, 07:37:14 PM »

Committed, thank you!

I don't care if compressed or not, but I don't like booting Linux and wrestling with "patch" if I can avoid it easily.  :)
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Recognize additional file formats
« Reply #5 on: June 02, 2011, 01:07:58 AM »

I don't care if compressed or not, but I don't like booting Linux and wrestling with "patch" if I can avoid it easily.  :)
There are zillions of patch utils for windows.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Recognize additional file formats
« Reply #6 on: June 02, 2011, 07:34:02 PM »

None of which works as supposed to.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Recognize additional file formats
« Reply #7 on: June 03, 2011, 01:17:42 AM »

None of which works as supposed to.
Just googled "patch windows" and got: http://gnuwin32.sourceforge.net/packages/patch.htm

Just tried it and seems to work.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Recognize additional file formats
« Reply #8 on: June 03, 2011, 12:35:20 PM »

Quote
On MS-Windows, the patchfile must be a text file, i.e. CR-LF must be used as line endings. A file with LF may give the error: "Assertion failed, hunk, file patch.c, line 343," unless the option '--binary' is given.

Problems start with the combinations of lf / cr-lf that can occur both in the sources to be patched and in the patches themselves.
Proggy needs some manifest to even run without admin rights.
I actually have it installed, and aborted it again because it just didn't work right.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Recognize additional file formats
« Reply #9 on: June 03, 2011, 11:01:00 PM »

Even tortoisesvn/git come with a program to apply patches.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Recognize additional file formats
« Reply #10 on: June 04, 2011, 12:40:44 PM »

Which fails unless the patch was created with SVN.  :(

Guys, it's simple. I can apply diff patches. I just have to fire up my Ubuntu-vm, drop the patch in the right place, remember how to call patch correctly, make a dry-run, convert all involved files from crlf to lf format (because the retarded thing fails otherwise), dry-run again until it works, then run for real. It would be slightly easier if our source files were "lf" instead of "native" (or if the Tortoise SVN devs weren't dickheads and made an option to set "native" to lf).
And sometimes I just don't feel like that and tell a contributor to just zip up (or tar-gz or whatever) his modified files and drop them here, because that's much less effort for him than applying the patch is for me.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Recognize additional file formats
« Reply #11 on: June 05, 2011, 10:43:01 AM »

convert all involved files from crlf to lf format (because the retarded thing fails otherwise), dry-run again until it works, then run for real. It would be slightly easier if our source files were "lf" instead of "native" (or if the Tortoise SVN devs weren't dickheads and made an option to set "native" to lf).
Uh, I didn't notice that. Setting svn:eol-style to native only causes trouble, in fact it is a stupid idea. No wonder you can't use patch.
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Recognize additional file formats
« Reply #12 on: June 05, 2011, 01:50:55 PM »

So, shold we change the whole SVN tree to LF? Well, except some files that need to have other formats...
Logged
concordia cum veritate

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Recognize additional file formats
« Reply #13 on: June 05, 2011, 02:29:20 PM »

I sure would like that. (I already changed all build relevant scripts and other files until it worked at last.)
And I don't think there are many Windows users who want to look at the source with notepad.
For the others the change will have no effect. Native storage format in the repo is lf also.
Mac has lf too, right?
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Recognize additional file formats
« Reply #14 on: June 05, 2011, 10:24:22 PM »

Technically, Mac has cr.
Logged
Pages: [1] 2