3.22.2.3. Automatically Incrementing a Package Version Number

When fetching a repository, BitBake uses the SRCREV variable to determine the specific source code revision from which to build. You set the SRCREV variable to AUTOREV to cause the OpenEmbedded build system to automatically use the latest revision of the software:

     SRCREV = "${AUTOREV}"
                    

Furthermore, you need to reference SRCPV in PV in order to automatically update the version whenever the revision of the source code changes. Here is an example:

     PV = "1.0+git${SRCPV}"
                    

The OpenEmbedded build system substitutes SRCPV with the following:

     AUTOINC+source_code_revision
                    

The build system replaces the AUTOINC with a number. The number used depends on the state of the PR Service:

In summary, the OpenEmbedded build system does not track the history of binary package versions for this purpose. AUTOINC, in this case, is comparable to PR. If PR server is not enabled, AUTOINC in the package version is simply replaced by "0". If PR server is enabled, the build system keeps track of the package versions and bumps the number when the package revision changes.