wpkg --create-index
Options | Comments |
---|---|
--admindir | Define the administration directory, where the database of the installed packages resides. |
--build | When used with the --build command, the command is used to create or refresh the index of the destination repository. |
--debug | Define a set of flags of things to print out for debug purposes. |
--instdir | Define the installation directory, where the data files are installed on the target. |
--quiet | Request for warning messages to not be displayed. |
--recursive | Recursively read directories to create a complete index. |
--root | Define the installation root path. |
--verbose | Display log information of level INFO. |
When creating many packages and managing them in a directory, which is called a repository, you have to create an index with the complete list of all the packages in the repository. This allows you to use the advanced commands of wpkg such as the --upgrade command.
The --create-index command allows you to create an archive of all the package names along with the control file of that package. No other information is included in the index to make it as small as possible (i.e. when using the tar format, the header is 512 bytes and the control files are generally using 1024 bytes, so a repository of 100 packages is usually only 100 × (512 + 1024) = 153,600, or 150Kb.
In case of a tar file, the header is composed of the .deb filename with the extension transformed to .ctrl (mainly to make sure that if someone extracts the files it does not overwrite their packages.) The modification date of the file is set the Date field of the package. The size is set to the size of the control file (not much choice on that one!) The other parameters are just set to valid defaults such as root:root for owner/group and 644 for the mode.
You may look at the contents of an index file using the gzip and tar tools. You can also make use of the --list-index-packages which gives you information in a somewhat different format than what you usually get with tar.
The --upgrade command uses that information to determine whether a package should be upgraded or not and whether a package available in the repository was not yet installed.