query
On this page

debClosureGenerator

pkgs.vmTools.debClosureGenerator

Docs pulled from | This Revision | about 1 hour ago


Like `rpmClosureGenerator', but now for Debian/Ubuntu releases (i.e. generate a closure from a Packages.bz2 file).


Noogle detected

Implementation

The following is the current implementation of this function.

debClosureGenerator =
    {name, packagesLists, urlPrefix, packages}:

    runCommand "${name}.nix"
      { nativeBuildInputs = [ buildPackages.perl buildPackages.dpkg pkgs.nixfmt-rfc-style ]; } ''
      for i in ${toString packagesLists}; do
        echo "adding $i..."
        case $i in
          *.xz | *.lzma)
            xz -d < $i >> ./Packages
            ;;
          *.bz2)
            bunzip2 < $i >> ./Packages
            ;;
          *.gz)
            gzip -dc < $i >> ./Packages
            ;;
        esac
      done

      perl -w ${deb/deb-closure.pl} \
        ./Packages ${urlPrefix} ${toString packages} > $out
      nixfmt $out
    '';