fantaisie-software/purebasic-repository-template

Automate PB Licenses Updating

Opened this issue · 1 comments

Automate the process of updating the PB License files at each new PureBasic release.

  • Create a tool to automate updating the PB License files in this repo.
  • Publish its source somewhere (even the project Wiki)
  • Add to the project Wiki instructions on how to use it.

Manually updating the PB License files with each new PureBasic release is a cumbersome work involving copying and pasting the licenses from their HTML document to the plain text file.

The process could be automated by creating a small tool that:

  1. Obtains the HTML license files, by either:
    • Extracting the licenses from the CHM Help file.
    • Downloading them from the on-line help via cURL.
  2. In either case, the license is inside a <pre> block, so extracting it should fairly easy and won't require HTML tag removals.
  3. Process the extracted licenses:
    • Remove trailing spaces.
    • Enforce a single empty line at end of file (for licenses concatenation).
  4. Deploy the extracted licenses to the repository root.

To spare some time, it might actually be better to first diff the extracted raw HTML files from then PB version with previous ones, to check if there are actually any changes, before beginning the process and deploy stages.

Creating this tool should be fairly straight forward, and could be done even in PB. I should then decide where to host it pubblicly (I might even store the source file inside the project Wiki, along with an instructions page).

@fantaisie-software, I was wondering: now that you've created the PureBasic OpenSource Projects repository, you could also add to it all PureBasic (and, possibly, SpiderBasic) required licenses as .txt files, like I've done here. (If I've understood correctly, although right now only the IDE is available, it's intended as an umbrella project for all aspects of PB and SB that will be made openly available).

This would be quite helpful for many PB related projects, for they could just update their licenses based on the files from the official repository, instead of having to manually copy and paste them from the CHM Help file or the online Documentation.

This is especially true when the PureBasic OpenSource Projects repository will ultimately adopt tag releases matching PureBasic releases — i.e. with each new PB release the repository contents get updated to match those of the official package (SDK headers, licenses files, IDE sources, and so on), allowing end users to be able to checkout with Git a specific tag in order to get access to assets matching a specific PB version (with master branch always mirroring the latest release).