#! /usr/bin/env nix-shell #! nix-shell -i bash -p coreutils findutils gawk gnused nix wget set -x # The trailing slash at the end is necessary! RELEASE_URL="http://download.kde.org/stable/plasma/5.5.3/" EXTRA_WGET_ARGS='-A *.tar.xz' mkdir tmp; cd tmp rm -f ../srcs.csv wget -nH -r -c --no-parent $RELEASE_URL $EXTRA_WGET_ARGS find . | while read src; do if [[ -f "${src}" ]]; then # Sanitize file name filename=$(basename "$src" | tr '@' '_') nameVersion="${filename%.tar.*}" name=$(echo "$nameVersion" | sed -e 's,-[[:digit:]].*,,' | sed -e 's,-opensource-src$,,') version=$(echo "$nameVersion" | sed -e 's,^\([[:alpha:]][[:alnum:]]*-\)\+,,') echo "$name,$version,$src,$filename" >>../srcs.csv fi done cat >../srcs.nix <>../srcs.nix <>../srcs.nix rm -f ../srcs.csv cd ..