Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

OBS and build dpkgs note

The Open Build Service is fantastic. I need to figure how to donate a little money to the SuSE team that offers this to free software admins like me.

Their documentation is really hard to find, so when I had a new configuration for a _service file (seen below), I ran into a problem.

<services>
   <service name="tar_scm">
      <param name="scm">git</param>
      <param name="url">https://bgstack15.ddns.net/cgit/stackrpms</param>
      <param name="subdir">debian</param>
      <param name="filename">for-dsc-only</param>
      <param name="revision">master</param>
      <param name="version">_none_</param>
   </service>
   <service name="recompress">
      <param name="file">*.tar</param>
      <param name="compression">xz</param>
   </service>
   <service name="tar_scm">
      <param name="scm">git</param>
      <param name="url">https://bgstack15.ddns.net/cgit/fprintd-tk</param>
      <param name="subdir">debian</param>
      <param name="filename">debian</param>
      <param name="revision">master</param>
      <param name="version">_none_</param>
   </service>
   <service name="recompress">
      <param name="file">*.tar</param>
      <param name="compression">xz</param>
   </service>
   <service name="tar_scm">
      <param name="scm">git</param>
      <param name="url">https://bgstack15.ddns.net/cgit/fprintd-tk</param>
      <param name="revision">master</param>
      <param name="version">_none_</param>
   </service>
   <service name="recompress">
      <param name="file">*.tar</param>
      <param name="compression">gz</param>
   </service>
   <service name="extract_file">
      <param name="archive">for-dsc-only.tar.xz</param>
      <param name="files">*/*.dsc</param>
   </service>
</services>

The above is almost my standard method for pulling down the *.dsc file that tells OBS we are building a dpkg, and the source tarball. This time, we are pulling down the .dsc file in an archive separately from even the rest of the debian/ build recipe. And this method fails with an error:

 Too many files looking like a usable source tarball (would not know which to pick): fprintd-tk.tar.xz for-dsc-only.tar.xz

The solution, which was available after searching the Internet, should have been to add a debtransform command in the .dsc file:

DEBTRANSFORM-TAR: fprintd-tk.tar.xz

And that accepts things like @VERSION@ but I haven't bothered with that. I took the quicker, dirtier method in a later comment, which is to modify the _service definition.

The snippet that matters:

   <service name="tar_scm">
      ...
      <param name="extension">tar_</param>
      <param name="extract">*.dsc</param>
   </service>

And man, I never knew about the extract parameter before. Remember how those docs are hard to find? (And actually, in the documentation I could find nothing described parameter "extract" for service "tar_scm".

The full service definition is below.

<services>
   <service name="tar_scm">
      <param name="scm">git</param>
      <param name="url">https://bgstack15.ddns.net/cgit/stackrpms</param>
      <param name="subdir">fprintd_tk/debian</param>
      <param name="filename">for-dsc-only</param>
      <param name="extension">tar_</param>
      <param name="revision">master</param>
      <param name="version">_none_</param>
      <param name="extract">*.dsc</param>
   </service>
   <service name="tar_scm">
      <param name="scm">git</param>
      <param name="url">https://bgstack15.ddns.net/cgit/fprintd-tk</param>
      <param name="subdir">debian</param>
      <param name="filename">debian</param>
      <param name="revision">master</param>
      <param name="version">_none_</param>
   </service>
   <service name="recompress">
      <param name="file">*.tar</param>
      <param name="compression">xz</param>
   </service>
   <service name="tar_scm">
      <param name="scm">git</param>
      <param name="url">https://bgstack15.ddns.net/cgit/fprintd-tk</param>
      <param name="revision">master</param>
      <param name="version">_none_</param>
   </service>
   <service name="recompress">
      <param name="file">*.tar</param>
      <param name="compression">gz</param>
   </service>
</services>

Comments