Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Patch: Ignore temp files .* and *.*~
- - By Carli [de] Date 2010-03-29 19:35 Edited 2010-03-29 19:47
I wrote a patch that ignores temp files .* and *.*~ for directory operations and so will enable network games between developers without forcing them to remove all *.*~ files on their own.

I hope, the patch gets committed after reviewing.

I hereby license the following file(s) under the WTFPL license
Attachment: ignoretempfiles.patch (3k)
Parent - By AlteredARMOR [ua] Date 2010-03-29 19:41
Just one small remark. CC-BY license can not be used for source code (I guess). Use ISC instead
Reply
Parent - - By Günther [de] Date 2010-03-29 20:13
Yeah, no. StdFile is the basic platform-abstraction part, the functions there should be unsurprising. Not working on random files will cause bugs later when somebody uses the functions without being aware of their shortcomings. You'll have to bite the bullet and modify C4Group. If you're lucky, it could be as easy as extending the functionality that ignores directories named "CVS", but I'm not motivated enough to read C4Group right now...
Reply
Parent - - By Carli [de] Date 2010-03-29 20:17
but i think, it would be better to not read them as items of an OS-directory.
when packing, all those files will be ignored anyway, so you won't find them in a c4group
Parent - - By Günther [de] Date 2010-03-29 20:28
Well, I gave you my reason for not wanting the platform abstraction functions to do more than one would except them to do. You'll have to give argument against to convince me.

And I can't believe it, but you actually made me look at C4Group. And I'm pretty certain that you'll only have to extend C4Group_TestIgnore. And while you're at it, please make DirContainsScenarios and C4ScenarioListLoader::RegularFolder::DoLoadContents also use that function.
Reply
Parent - By Carli [de] Date 2010-03-29 20:44
oh, i didn't see this
Parent - - By Carli [de] Date 2010-03-29 20:52
Here you have the (i hope correct) patch.
Attachment: ignoretempfiles.patch (953B)
Parent - - By Günther [de] Date 2010-03-29 21:03
Yes, that could work. "//no ignored groups" is wrong though - take a look at the contents of C4Group_Ignore. Also, what about my request for C4StartupScenSelDlg.cpp?
Reply
Parent - - By Carli [de] Date 2010-03-29 21:36
License: WTFPL (..what else?)
Attachment: ignoretempfiles.patch (3k)
Parent - - By Günther [de] Date 2010-03-30 13:56
With "that function", I meant C4Group_TestIgnore. So instead of duplicating the tests, simply call C4Group_TestIgnore in C4StartUpScenSelDlg.cpp. Also, are you sure that SIsModule works with wildcards? And "//no ignored groups" is still wrong: Thumbs.db and *~ are not groups. "//Not in the blacklist" or something similar would be correct.

And the patch appears to be using the ISC license. If you want to use a different one, you should add it to the file, but I urge you to simply use the ISC.
Reply
Parent - - By Carli [de] Date 2010-03-30 17:48 Edited 2010-03-30 18:04
You mean this?

(License: ISC)

Edit: tested with Maikel and JCaesar
Attachment: ignoretempfiles.patch (4k)
Parent - - By Newton [de] Date 2010-04-02 19:58
Is this already done? And what is missng if not?
Parent - - By Günther [de] Date 2010-04-02 23:39
Somebody has to check whether the changes in C4Group.cpp where previously only '.*' was ignored really need to ignore the other patterns, too. Oh, and some minimal testing.
Reply
Parent - - By Carli [de] Date 2010-04-03 12:28
that means??
Parent - - By Günther [de] Date 2010-04-15 21:57
Your latest patch has two additional calls to C4Group_TestIgnore, and it isn't immediately obvious from the patch alone that they're correct. I've now taken the time to check their contexts, and they look good, or at least harmless for everything but the windows c4group commandline utility. So with the entire patch reviewed and tested, I've pushed it.
Reply
Parent - By Carli [de] Date 2010-04-16 11:09
thx :)
at least i was very inactive - gwX2 needs me. (networkgames etc.)
Parent - - By Clonk-Karl [de] Date 2010-04-17 09:05
Could it be that this patch broke the build (on some systems at least)?

See the latest nightly build log or #253.
Reply
Parent - By Clonk-Karl [de] Date 2010-04-17 10:30
Fixed.
Reply
Up Topic Development / Developer's Corner / Patch: Ignore temp files .* and *.*~

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill