Automatic MOD file generation - DiffBB v0.1.0

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
0beron
Registered User
Posts: 123
Joined: Mon Jul 04, 2005 3:23 pm

Automatic MOD file generation - DiffBB v0.1.0

Post by 0beron » Fri Jul 15, 2005 3:53 pm

EDIT (17th Oct 2006)....
I've re-implemented this whole project as a command line tool written in python, so you can run it on your local machine, your webserver, or anywhere with a python installation and a copy of diff. You can get it here:

Python code:
http://www.rmf33.co.uk/pydiffbb-0.1.0.zip
Prerequisites:
python 2.4 or greater -> http://www.python.org/
numpy module for python -> http://www.scipy.org/Download
a UNIX diff utility or a windows port of one -> http://www.mingw.org/download.shtml#hdr6 or http://unxutils.sourceforge.net/

Windows executable:
http://www.rmf33.co.uk/pydiffbb-0.1.0-win32.zip
Prerequisites:
a UNIX diff utility or a windows port of one.
(download links as above)



Here is the old post I made about the original PHP version of this tool:
I wrote: I have written DiffBB - a script that uses UNIX diff to examine two phpBB boards, one of which must be a fresh install, and the other of which is a copy you have modified, and will output a working MOD file that will MOD a fresh board into the state of the modified board.

It is still highly experimental although I have plenty of ideas for improvements. It doesn't generate the best MOD files ever but it should manage to create MOD files that can be understood by easymod. In future versions I plan to take steps to generate MOD files that will be as compatible as possible with other MODS. See this thread for more:
http://www.phpbb.com/phpBB/viewtopic.php?t=305046

You can download the script here:

http://www.rmf33.co.uk/diffbb/diffbb-0.1.0.zip

To run it you will require access to the UNIX diff utility, or a windows port. I have only tested this with one version of diff, so if there are quirks to any other versions that people would like to use then let me know and I'll see if it is possible to adapt.

Instructions for use

1. Install phpBB

2. Install a second copy of phpBB, or just copy all the files to another directory (the database does not need to be copied)

3. Modify one copy of phpBB to behave in the way you want your MOD to behave.

4. Put the three files in the zip into a directory above BOTH the boards.

5. Run the script by pointing a browser at diffbb.php

6. Fill in the form, hit 'Generate'

7. The script will either show a progress report and eventually show 'done', or it will display an error message about your diff utility if it is not available.

8. Open the MOD file, and add in any SQL actions manually.

9. package up the MOD file with any included files and you're done.


Hopefully this will reduce the effort of maintaining not only the code for the forum MOD but also a valid MOD file.

It is still in experimental stages and has the odd trouble with particular types of edit, especially where whitespace gets changed, or many edits appear close to each other. These only occur in a small number of cases. I have encountered some myself in testing and am working on fixing them. Let me know of any other problems (there are bound to be some) and I'll look into it.

EDIT:
IMPORTANT DISCLAIMER
You use this tool at your own peril! I would not recommend using it on a live board, or using MODS generated by it for a live board yet. I will not accept any responsibility for boards that you damage as a result of using this tool.

EDIT:

Links updated 14th Aug 2006
Last edited by 0beron on Mon Oct 16, 2006 11:42 pm, edited 14 times in total.

afterlife_69
I've Been Banned!
Posts: 630
Joined: Tue Nov 30, 2004 10:35 am

Post by afterlife_69 » Fri Jul 15, 2005 4:41 pm

When will be dload be back? im willing to try this for my mods :D

0beron
Registered User
Posts: 123
Joined: Mon Jul 04, 2005 3:23 pm

Post by 0beron » Fri Jul 15, 2005 4:48 pm

Download is back. Sorry, I made the post and then promptly overwrote something I shouldn't have in the process of making the tarball.

afterlife_69
I've Been Banned!
Posts: 630
Joined: Tue Nov 30, 2004 10:35 am

Post by afterlife_69 » Fri Jul 15, 2005 4:50 pm

lol we have all been there.

afterlife_69
I've Been Banned!
Posts: 630
Joined: Tue Nov 30, 2004 10:35 am

Post by afterlife_69 » Fri Jul 15, 2005 4:59 pm

doesnt seem to be working for me, all i get is the header and this:

Code: Select all

#
#-----[ COPY ]------------------------------------------
#


#
#-----[ SAVE/CLOSE ALL FILES ]----------------------
#EoM

0beron
Registered User
Posts: 123
Joined: Mon Jul 04, 2005 3:23 pm

Post by 0beron » Sat Jul 16, 2005 2:01 am

Hmm. Have a look in the directory you put the files in, and open up the file named diff_file - see if there is anything in it. By the sounds of things it's probably empty. Open up autogen.php and find the line near the top where the diff is performed. If you have shell access try running that same diff command at the shell manually and see if it works at all.

I've tried it on a bigger mod and I'm running into memory errors. I thought this might happen. I'll have to work on cutting down memory usage (at the moment it tries to do everything all at once in big arrays, so this can be done by doing things sequentially). Either that or it may be easier and better to port to another language. Might even be worth doing it in raw C from start to finish.

0beron
Registered User
Posts: 123
Joined: Mon Jul 04, 2005 3:23 pm

Post by 0beron » Wed Jul 20, 2005 2:06 am

Okay I've done some further work, and started giving it version numbers to keep track of things.

Things I've added:
- Processes files one by one instead of all at once - should use less memory in one go.
- Added a check to see if diff is available and error if not.
- Code fully commented
- Flashier form and progress meter.

0beron
Registered User
Posts: 123
Joined: Mon Jul 04, 2005 3:23 pm

Post by 0beron » Sat Jul 30, 2005 12:29 am

This is still not quite perfect, although it is very usable at the moment. It is still a bit flaky when it comes to changes in whitespace and extra lines, but I managed to use it to generate the entire MOD file for v0.4.0 of my scribblePad mod (922 lines and 18kB of text, not a replace-with in sight - all inline actions now), and I only had to correct 3 errors and add the SQL actions and changelog. Hopefully I'll be able to patch it up and release v0.2.0 soon.

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll » Sat Jul 30, 2005 2:14 am

Please review auto-generated content before submitting to the MODDB, as we may require you to replace it with optimised replaces including IN-LINE statements, BEFORE ADD's (for language files) and INCREMENTs.

DKing
Registered User
Posts: 751
Joined: Sat Jul 03, 2004 8:38 pm

Post by DKing » Sat Jul 30, 2005 5:03 am

wow... nice! :D I will surely use this for my mods! It will make it so much easier.

Of course, you'll need to make sure it follows the guidlines for EasyMOD because some people like to take shortcuts. ;)
-DKing
Latest phpBB Version: 2.0.21
Search For a MOD: MOD Search

0beron
Registered User
Posts: 123
Joined: Mon Jul 04, 2005 3:23 pm

Post by 0beron » Sat Jul 30, 2005 10:11 am

It is still a tiny bit buggy, and I'll fix it in time, but I have been thinking about ways to make the output better. It would be quite easy to make it behave differently for language files, source files, template files etc - for example in templates it could prefer the tags such as {MESSAGE} to big blocks of HTML which are likely to differ in non-subSilver templates.

The outputted MOD files will probably always need a bit of tweaking to get them to look nice - ( some of the stuff it generates will work just fine with easyMOD, but isn't very human readable, eg, finding a single bracket as a target). For a small MOD you are probably not saving much time, but if your MOD changes more than about 3 or 4 files then this system ought to get you most of the way there, and you can catch the errors with easyMOD preview mode.

DKing
Registered User
Posts: 751
Joined: Sat Jul 03, 2004 8:38 pm

Post by DKing » Sun Jul 31, 2005 2:56 am

I was just thinking how easy this will make making a MOD. I usually have a very hard time remembering to add my actions into the text file and many times, i have left stuff out that was important. I am so hoping that this gets released soon!

-DKing
-DKing
Latest phpBB Version: 2.0.21
Search For a MOD: MOD Search

dapaintballer333
Registered User
Posts: 177
Joined: Sat Oct 23, 2004 4:02 pm

Post by dapaintballer333 » Mon Aug 14, 2006 10:39 am

Please reupload if possible. Even if its a bit bugy, I'd like to at least give it a shot. I was about to release a mod as a "premodded phpbb" since going through all the files would take forever, and there are a lot of files I modified.

0beron
Registered User
Posts: 123
Joined: Mon Jul 04, 2005 3:23 pm

Post by 0beron » Mon Aug 14, 2006 12:14 pm

It seems someone has linked to this thread from somewhere, I've been asked about the dead link twice now, after a year or two of silence. I'll update the link later today when I get back from work.

dapaintballer333
Registered User
Posts: 177
Joined: Sat Oct 23, 2004 4:02 pm

Post by dapaintballer333 » Tue Aug 15, 2006 5:28 pm

there are lots of problems, I think you should remake it. i winded up creating like 5 blank files, and chmodding them. There finally was no errors, but the mod created had no actions except a blank copy, and two eoms.

I'd pay for someone to remake this (so that its working).

Post Reply

Return to “[2.0.x] MOD Writers Discussion”

cron