This is an old revision of the document!
Development:
Package management scripts guide:
The scripts have quite a lot of fluff, without sufficient explinations. So here is my (LichenSymbiont) guide to the scripts.
The scripts uses grep and awk extensively, so you should read more about using them. It also uses some more complex awk programs, so you should learn a bit about the Awk language. And of course you need to know bash scripting, so here is a guide.
Starting with a general outline:
A sce package is a SquashFS file, which can compress data using multiple compression algorithms. Unfortunately it has one problem: it can't overwrite or delete its stored files – only create new copies of files. So if a file with the same name exists in the same directory, it adds the new file with “_#” (_1, _2, _3 …) appended to its file-name. So you can't easily update its stored files, without rewriting the whole thing. But you can add new files to an already created file-system. Read about it Here. This allows for the creation of SquashFS files that stores all your favorite programs, in one file, by just incrementally adding them (this is not a feature of importsce yet).
Now I will walk you through the importsce script, so download the latest scripts, here.
And follow along, looking at the actual importsce script.
First it sets global variables for the script, and sets up the /tmp directory.
Then importsce sets a bunch of variables from the options used when calling the command. Then from its config file, if it exists (though it doesn't presently check this, just grep's the options). So the config file takes precedence over the command-line options.
Then sets the target .sce file to be created.
Then acquires the mirror to the special dCore packages (like Xprogs and flwm_topside), and special dependencies for certain packages (which don't show up in a regular Debian system (as they would already be installed)). There are also other things, like dependencies to exclude. You can study the file youself, by downloading it from here (extract it into a new directory, as the files are in the root of the package). Then downloads the latest file containing these packages. And extracts its content into a bunch of text-files.
Then it checks if a .lst file (file containing a list of packages to download) is being used, and changes the targetted .sce accordingly.
Here I skip a few checks…
Then it let's you enter a package name, if no target it specified (why is this so far down the script?). And exits the script if you don't specify anything.
Then it checks if it can find the package in the package indices (both regular repos, and meta-packages and special dCore packages). This is done through the debGetEnv script, which also stores the relevant repo in the DEBINX variable.
And finally it calls the deb2sce script (through the mksce function) after a bunch of checks, which does the real work of downloading the package(s) (with dependencies and all).
Then after deb2sce has downloaded all of the required packages, it runs the mksquashfs program, which takes all of the downloaded deb files and makes the sce package.
deb2sce also does the -l option operations, of importing packages from a file containing a list of packages.