Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Patching/Updating Perl scripts

by Ace128 (Hermit)
on Dec 01, 2005 at 04:39 UTC ( #513189=perlquestion: print w/replies, xml ) Need Help??
Ace128 has asked for the wisdom of the Perl Monks concerning the following question:


I've been doing this rather big "system" that supports "plugins". That is, the core loads other Perl scripts and call surtain functions that I've defined. This way, one can extend into the infinity, since the core is supposed to do the main, basic, and common things, so the users just have to do what they want!

Now, this is ofcource quite nice and cool, but I was thinking further... Now, these plugins are ofcource open for anyone to modify. So, the question I have here is if anyone here has any bright ideas on how to create a way to make it easy on everybody, when some plugin has been updated!
I know there is subversion/cvs and those, but that seems abit too much. I was even thinking of maybe even do something in Perl that patches the plugins, but I thought maybe you bright folks here have done something like this before and can give me some hints. Natrually, the plugins are gonna have some kind of version set in them, so its easier to keep track of them. Also, I can mention that the updates to the pluginscripts is mostly gonna be new subs... so, doing something that compares 2 scripts and adds the diff in the other shouldnt be too hard in lovely Perl. Also, I would want some kind of server to have them in aswell. So, its easy to update. Both when you have done something in the plugin and if you wanna update yours.

Also, not to brag ;) but I could ofcource do all this without any feedback from here, but I wanted this to be good for everybody, so I thought, why not get feedback from people that could be potential users! :) That is, do it good from the beginning, and as the users wants it!

So, what do you people say? How would you do this? One could have a server that has all plugins and all the versions of it... This way its easy to update. And ofcource go back if something is screwed up. Its a little more trickier when users add thier own stuff. Should just the new content be there, or the full new plugin? Use something like mysql? Or just save in directories in the server (mysql and alike could be overkill)?

Update: I was also thinking that one wanna have, in pure text, information on whats new in the update. This needs to be represented somehow. I suppose its gonna be just a comment above the sub... Also, I just realized... Maybe one just want some new sub, not all.. maybe its better to save just the sub into the "repository"... Maybe a module exists for this already? (although I couldn't find anything) I could go on forever ;)


Replies are listed 'Best First'.
Re: Patching/Updating Perl scripts
by matija (Priest) on Dec 01, 2005 at 08:47 UTC
    You say that subversion/cvs seems bit too much. But then you go on to enumerate a wishlist that sounds almost exactly like the list of features of a good version control system.

    My advice is to install either CVS or subversion, and build on top of that. If you'd rather keep control of the project, you need not give CVS wite priviliges to other people - you can keep it to yourself, or give it to people who have earned your trust through consistent quality contributions.

    Come to think of it, you're going to need some sort of version control system for your own use anyway, so making it available to others is just spreading goodness.

      Hmm.. this could be true... Maybe Im too much of a controlfreak ;) It just felt like those subversion/cvs things are not that controllable when it comes to the data changed. I mean, sure I can commit several times, and such... But, as far as I know, I cant really edit the history easly...

      Crap. Subversion has revision numbers on the whole project! I would prefer per script. Hmm... Also, I wanted to avoid revision 6-8 are "fixes" for like typos. That is, only "final" versions exists in the repository... Hmm... Guess I have to do it myself then... So I get what I want...

        Maybe you should look into svk which is a distributed version control system written in Perl and built on top of subversion, that should satisfy your requirements for scriptability/control. You could maintain several trees for the different purposes (fixes, updates etc.) and merge as you see appropriate. Also, with svk users can have their own repository with local plugins and you'll just have to devise a clever way for them to merge your central changes with their local tree in a non-confusing manner.

        Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
        If you were *really* a control freak you wouldn't want to edit the history. I'm a control freak, ok? I *love* subversion! Give it a try. And try subversion before cvs, since svn has got a lot that cvs doesn't. (Main advantage of cvs is it's used more universally, eg sourceforge, but subversion is rapidly gaining in popularity.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://513189]
Approved by graff
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-11-15 14:17 GMT
Find Nodes?
    Voting Booth?
    My code is most likely broken because:

    Results (186 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!