Feature - Implemented allow kolmafia to handle ash bundles

roippi

Developer
So I've been playing around locally with SVNKit and it's very, very easy to check stuff out and even update working copies. It's cool.

I have no idea how to properly implement this. Scripts cannot call the update function on themselves arbitrarily inline, that way lies madness. Should script writers who want to use this functionality be forced to write a second wrapper script that basically just does "svn update" on the real script and then runs it? That sounds terrible.

Maybe some privileged block a la static{} that gets run before everything else?
 
Last edited:

Catch-22

Active member
Scripts cannot call the update function on themselves arbitrarily inline, that way lies madness.

Why not? I update scripts that are running all the time. The script is loaded into memory at runtime, so it's not that mad.

I think your privileged block idea makes some sense though, but how would you handle privileged blocks in imported scripts?
 

fronobulax

Developer
Staff member
I don't know what I was thinking last time around, but at this moment I would consider making a a core mafia capability that when invoked, iterated over a list of files and looked at the SVN status of said files. If the SVN file was newer and the local file was unmodified or absent, mafia would download the file. If the SVN file was newer but there were local modifications then (for phase I) mafia would flag the file name in Red or bold it or otherwise indicate user interaction was needed. Later phases could consider doing a diff or a merge but... ASH commands to add or delete files on the list would be available. The system would not initially allow or support dependencies on other files beyond "the latest". A script writer managing multiple files in a pseudo-bundle would just have all of the files add themselves and their companions to The List. I'd probably make the Update (as described above) available from the CLI but discourage its use in scripts.

SVN will store information locally. I have not figured out whether to have a one local directory that is the SVN staging area and have files copied to and from that, under the hood, or whether to allow for versioned files anywhere KoLmafia is writing and let the clutter proliferate.

Initially script writers would have to sue a SVN client to update and "release" new versions. A new user of a script would add the new script to teh list and then run the update command.

I'm thinking this is a 70% solution with a lot of things that could be done later if it is actually useful enough to be adopted. Based upon Zarqon's script registry numbers and active posters here, I'm thinking this is something that needs about five active scripters behind it in order to reach "critical mass".
 

lostcalpolydude

Developer
Staff member
This thread is actually about downloading scripts bundled as zip files.

I don't think it is. Between the fact that there seem to be a lot of problems with that approach (which I guess means Rejected might apply if that's the actual topic of this thread, but since I haven't looked at any of the implementation details I'm certainly not going to state that as a sure thing) and

Okay - different direction than I was thinking, but my overall goal is "make it easy to install/manage extensions to kolmafia", not "make kolmafia use zips".
I guess a thread title change might be in line, if it actually matters.
 

fronobulax

Developer
Staff member
If it was implemented it would probably get five scripters and many others would feel pressure to fall in line. However, that discussion belongs in the Automatic Script Update for Mafia thread, not here. This thread is actually about downloading scripts bundled as zip files.

I view the initial feature request as being a proposed solution to a problem - the problem being that some scripts have dependencies on several files in different directories. I mentioned what I believe might be an alternative and more generally useful solution to the same problem. I'm not sure where the best place for the discussion is but since moderators can move posts and threads around I figure if I have made a mistake, someone can move it ;-)
 

roippi

Developer
SVN integration was (brokenly) implemented in r12141 and more correctly implemented in r12144.

FOR USERS:
svn checkout <svnurl> checks out a svn repository and adds the files from the working copy to the appropriate locations.
svn update updates all of your installed projects and pushes any changes to the appropriate locations.
svn list lists installed projects.
svn delete <scriptname> deletes installed projects and the corresponding files that it pushed. <scriptname> fuzzy matches the script names from svn list.

FOR SCRIPTERS:
You can provide a svn://, http://, or https:// link to a valid svn repo. The link does not need to be to the root of the repository. At the location specified by the url, there are only four permissible folders:

scripts/
images/
relay/
data/

Any files or directories in the location specified by your url that are not named the above will cause your repo to fail validation and thus it will not be checked out. Within the valid folders, you can nest files however you want. When users check out your project, the files (and nested folders) will be pushed to the corresponding mafia directories.

-----

Bugs directly relating to this feature should go in here or in a new bug report thread. Related discussion can go in here or in this thread. Future work and features are planned with SVN, and I will likely be discussing them there.
 
Top