Author Topic: VPMagic 0.0a  (Read 2466 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • 213
I ported a couple of my libraries over and wrote this...

It won't let you actually *make* VPs, as -id is broken. I suspect that gl_pathv only contains the relative path, so my stat() call fails...or something.

Regardless, you *can* extract VPs to a folder and get verbose output (whee). I don't know a bloody thing about licensing or setting up a coding environment, so here's the binary for now. :p

It's compiled with whatever "gcc main.cpp vplib.cpp ../virtfile/virtfile.cpp /usr/lib/libstdc++.so" gets me, so it may only work on i686s or AMD64s.
-C

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Cool! :)   If there aren't many files involved then you can probably get away with just a single Makefile and skip all of the autoconf/automake stuff.  For a rather basic Makefile you can look at the one used for the icculus.org Freespace2 code (http://cvs.icculus.org/cvs/freespace2/Makefile?rev=1.44&view=markup) and go from there.


For making VPs, cfilearchiver can be used.  Just with current CVS you do "make cfilearchiver" and it will create the binary.  It's been ported to everything so it should work under Windows, Linux/x86, Linux/PCC, x86_64 and OSX.  A single tool would be nice though, especially since cfilearchiver doesn't extract files, but for now it's there for those that want to use it.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Well, IIRC that one requires a couple of temp files and only does directory structures...mine has a heavier memory footprint but doesn't need intermediate files (Although it should still take up < 10 MB in memory).

It's also done in OOP fashion, and is mostly limited by the GUI. Mostly, it's meant for inclusion in a program rather than being the program. ;) I haven't had to make any changes to go from VPMage to the command line, just to keep all the functionality in Linux.
-C

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
*Bump*

Did some more work on this tonight, revamping the command line handling system like I wanted to. It's much more cleaner and easier to add hooks into the VP lib. :)

Note that when "specified directory" refers to the VP's directories, you use unix-style paths. That is, -ls /data/missions would show everything in the data/missions directory.

You _can_ use multiple commands. I don't know if that's evident from the below. So you could insert a directory and extract it with the same command line.

And of course, if you specify a nonexistent VP file and insert stuff into it, it will make a VP for you. ;)

VPMagic 0.2:
Code: [Select]
'VPMagic' manages Volition VP files. It can extract and insert files.

USAGE: ./vpmagic [VP]... [OPTIONS]...

EXAMPLES:
  ./vpmagic root_fs2.vp -xa #Extract all files from 'root_fs2.vp'.

Output control:
-v, --verbose Display all status messages

Extraction:
-xa, --extract-all Extracts all VP contents to the specified dir(s)
-xd, --extract-dir Extracts contents of specfied directories to specified directory

Insertion:
-id, --insert-dirs Inserts directories (with files) into the VP root
-if, --insert-files Inserts files into the specified directory

Info:
-ls, --list-items Lists all items in the specified directories, or the VP root if none are specified


Known bugs/TODO:
- Dates show as pure timestamps in ls
- ls works if any of the first directories in the path are valid
- The binary is compiled for my AMD64. I think. I'm not sure what my default G++ flags are, and can't be arsed to figure out what exactly to add to make it compatible for everyone else. Which brings me to my next item...
- Figure out how to invoke other makefiles from a makefile.
-C

 

Offline Alpha0

  • 24
I could give you a little help with invoking other makefiles from a makefile. See below how I do it  for compiling fs2_open.exe. This is the main makefile, which invokes makefiles code.mak and Freespace2.mak. This is just an indicative way of doing it, of course, but you can get the idea.
Code: [Select]


.PHONY: all
all: \
code \
Freespace2

.PHONY: Freespace2
Freespace2:
$(MAKE) -f Freespace2.mak

.PHONY: code
code:
$(MAKE) -C code -f code.mak

.PHONY: clean
clean:
$(MAKE) -f Freespace2.mak clean
$(MAKE) -C code -f code.mak clean

.PHONY: depends
depends:
$(MAKE) -f Freespace2.mak depends
$(MAKE) -C code -f code.mak depends


Hope this helps. If you need the full makefiles to get a better idea, PM and I will send them to you.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Thanks, that looks exactly like what I'm trying to do :)
-C