Jump to content
Stobber

Extract license text from VIP file

Recommended Posts

Is there a way to do extract the full text of a software license/copyright from a .vip with the VIPM API? I need to automatically collate the licenses for dependencies in a new text file as part of our build process.

Share this post


Link to post
Share on other sites

Is there a way to do extract the full text of a software license/copyright from a .vip with the VIPM API? I need to automatically collate the licenses for dependencies in a new text file as part of our build process.

 

Here is an unofficial way to read the license text that is not guaranteed not to break in the future :) (and, if you can't find an officially supported way to do this, feel free to suggest it in the VIPM Idea Exchange)

 

Read VIP License Text.png

(this uses the OpenG ZIP Library)

  • Upvote 2

Share this post


Link to post
Share on other sites

This doesn't work for .ogp files and some .vip files I've seen on LAVA. Specifically, these two don't have a "license" file in the root of the ZIP; the license is buried in a config file named "spec", instead.

 

http://lavag.org/files/file/163-icon-editor-api/

http://lavag.org/files/file/212-sqlite-labview/

 

It'd be one thing if I could use the file type to decide which format to look for ("license" or "spec"), but one of those is a VIP file that's been updated pretty recently. Did the file format change at some point? Is there a format version I can check to decide where to look for the license in a given file?

Share this post


Link to post
Share on other sites

Actually, I think I spoke too soon. I see that if the build spec doesn't give any license text, the license file isn't included in the ZIP. I added logic to handle this gracefully. Thanks!

Share this post


Link to post
Share on other sites

Actually, I think I spoke too soon. I see that if the build spec doesn't give any license text, the license file isn't included in the ZIP. I added logic to handle this gracefully. Thanks!

 

The spec file contains the license agreement name, whereas the "license" text file contains the actual license agreement content. Back in the days of OGP files, we only supported the license agreement name in the spec file and not including the actual agreement itself.

 

It sounds like you've got what you need. Hopefully my addition comments are helpful, too :)

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.