Wednesday | 04 DEC 2024
[ previous ]
[ next ]

Rewrite of UPM

Title:
Date: 2023-03-19
Tags:  

I need to rewrite UPM. I currently wrote it as a package manager but I think that was dumb and it is causing too much issues. I wrote it with the packages and github links embedded in the program and so to add new things I need to update upm and then install. I also have an issue where I wrote the UNDEF logic to do conditional compiling inside UPM so if I accidentally call upm in Universe where the conditional compilation logic is valid, it gets stripped out. This is fine but I accidentally clobbered my working copy.

The solution is to rewrite upm do what curl | sh does. I want upm to fetch the file and save it. Then I can manually call undef on the file to create the stripped file. Then i can compile and catalog the file. I also want to pass in urls directly to upm instead of the current package system. This will make it much more palatable for me.

I also want to change the name as it isn't a package manager anymore. It is a package installer rather than something that keeps track of what it has installed.

Given this idea I think the first step is to write a utility that can find out the OS and MV system it is running on. This is because I don't want to remember the d3 and d3 windows specific commands like I currently need to do for UPM.

NPM INFO

The next step is to have a set of commands to work with these files.

NPM GET {FILE} {RECORD} {URL}

I also want to remove the curl dependency. I think it would be better to write the GET function in native BASIC.

This command will only get the file.

NPM COMPILE {FILE} {RECORD}

This command will run the UNDEF function to strip out the conditional logic if it is D3. This should be a version check as newer versions of D3 are fine.

NPM INSTALL {FILE} {RECORD} {URL}

This should do what the above steps do but in one go.

This installer shouldn't have any dependencies and should be installable in a single line.

Something to the idea of:

cd /home/SYSPROG && wget {url} -o BP/NPM && 'uv "BASIC BP NPM"' && 'uv "CATALOG BP NPM"'

This will download, compile and catalog NPM.

The plan:

  1. Get the OS information
  2. Get the MV information
  3. Write the INFO function to show the OS and MV information
  4. Write the GET function in native BASIC for UniVerse
  5. Write the GET function in native BASIC for D3
  6. Write the COMPILE function to call UNDEF
  7. Write the INSTALL function to combine the 2 steps