nixpkgs/pkgs/by-name/lh/lhapdf/maintainer.sh
Michael Daniels 3dfcab3d12 treewide: migrate to pkgs/by-name
All from https://github.com/Aleksanaa/by-name-migrate, with some additional
exclusions of packages with open PRs to prevent merge conflicts.
2025-06-21 11:11:59 -04:00

14 lines
410 B
Bash
Executable File

#!/bin/bash
set -xe
: ${SED:="$(nix-build '<nixpkgs>' -A gnused --no-out-link)/bin/sed"}
BASE_URL="https://lhapdfsets.web.cern.ch/current/"
for pdf_set in `curl -L $BASE_URL 2>/dev/null | "$SED" -n -e 's/.*<a href="#" data-url="\([^"/]*\.tar\.gz\)".*/\1/p' | sort -u`; do
echo -n " \"${pdf_set%.tar.gz}\" = \""
nix-prefetch-url "${BASE_URL}${pdf_set}" 2>/dev/null | tr -d '\n'
echo "\";"
done