Skip to content

Some new %escapes for the log file and source package name+version

Richard Lewis requested to merge rpil2/sbuild:more-escapes into main

Define some additional escapes for hooks:

  • %SRCPACKAGE and %SRCPACKAGE_VERSION for the source package and its version
  • %SBUILD_LOG_DIR , %SBUILD_LOG_BASENAME, %SBUILD_LOG_PATH(=%SBUILD_LOG_DIR/%SBUILD_LOG_BASENAME) for the parts of the log file. (I have tested with --nolog and these are still defined, however the code does try and not define them if there is nothing to set)

(In trying to understand the code, i made some edits to the man-page and in Build.pm i split the code to define the name of the build log into a new function)

For example, I can use these in pre- and post-build hooks to

  • create a new symlink latest.build -> %SBUILD_LOG_BASENAME in %SBUILD_LOG_DIR
  • delete old .build files (those with the same source package name and version, but not equal to %SBUILD_LOG_BASENAME) at the end of a successful build

(This also provides a possible solution for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834736 -- they could use --post-build-commands="mv %SBUILD_LOG_PATH %SBUILD_LOG_DIR/foo.build" where foo is in whatever format, they want, it seems to work)

(This supersedes the first bit of !148 (merged) )

Merge request reports

Loading