wpkg --build-number-filename ...
The --build-number-filename option is used to specify the name of the file to use as the build number of this project.
By default, wpkg makes use of the file:
wpkg/build_number
However, if the file does not exist, wpkg does not use anything. Instead it does not manage the build number.
This option can be used if the default file is not satisfactory. For example, you may be using one build number for your entire software suite. In that case, the build number is most certainly not directly defined in a project and its filename needs to be specified when building wpkg packages.
The option is valid on the different commands that deal with the build number:
- --increment-build-number
- --print-build-number
- --build (when building source packages only)
The --build command loads the current build number, increments it by one, and saves it back in the build number file. It also saves the build number in the Build-Number field of your project control.info file. All of which is 100% automatic, especially if you use the default build number file. So you should not usually have to yourself run the --increment-build-number command.
Note that if you are to use one single build number file for many packages, then you do NOT want to specify the build number filename to the --build command since otherwise it would automatically increment the number. There is a sample Unix script that takes care of such a case:
wpkg --increment-build-number --build-number-filename global_build_number build_number=`wpkg --print-build-number` (cd package1 && wpkg --build -Vbuild_number=$build_number) (cd package2 && wpkg --build -Vbuild_number=$build_number) ... (cd packageN && wpkg --build -Vbuild_number=$build_number)
This assumes that your control.info file includes a build number field defined as:
Build-Number: ${build_number}
However, note that the build number will need to be specified to the build command when building the binary packages from a source package as well because the control.info file saved inside the source package will still include the variable reference, not the actual build number.