14 basePath ? "pkgs/applications/networking/browsers/firefox-bin",
20 isBeta = channel != "release";
23 writeScript "update-${pname}" ''
25 PATH=${coreutils}/bin:${gnused}/bin:${gnugrep}/bin:${xidel}/bin:${curl}/bin:${gnupg}/bin
30 export GNUPGHOME=`mktemp -d`
32 curl https://keys.openpgp.org/vks/v1/by-fingerprint/14F26682D0916CDD81E37B6D61B7B526D98F0353 | gpg --import -
37 # retriving latest released version
38 # - extracts all links from the $url
40 # - this line remove everything not starting with a number
41 # - this line sorts everything with semver in mind
42 # - we remove lines that are mentioning funnelcake
43 # - this line removes beta version if we are looking for final release
44 # versions or removes release versions if we are looking for beta
46 # - this line pick up latest release
47 version=`xidel -s $url --extract "//a" | \
50 sort --version-sort | \
51 grep -v "funnelcake" | \
52 grep -e "${lib.optionalString isBeta "b"}\([[:digit:]]\|[[:digit:]][[:digit:]]\)${versionSuffix}$" | ${
53 lib.optionalString (!isBeta) "grep -v \"b\" |"
57 curl --silent -o $HOME/shasums "$url$version/SHA256SUMS"
58 curl --silent -o $HOME/shasums.asc "$url$version/SHA256SUMS.asc"
59 gpgv --keyring=$GNUPGHOME/pubring.kbx $HOME/shasums.asc $HOME/shasums
61 # this is a list of sha256 and tarballs for both arches
62 # Upstream files contains python repr strings like b'somehash', hence the sed dance
63 shasums=`cat $HOME/shasums | sed -E s/"b'([a-f0-9]{64})'?(.*)"/'\1\2'/ | grep tar.bz2`
70 for arch in linux-x86_64 linux-i686; do
71 # retriving a list of all tarballs for each arch
72 # - only select tarballs for current arch
73 # - only select tarballs for current version
74 # - rename space with colon so that for loop doesnt
75 # - inteprets sha and path as 2 lines
76 for line in `echo "$shasums" | \
78 grep "${baseName}-$version.tar.bz2$" | \
80 # create an entry for every locale
83 url = "$url$version/`echo $line | cut -d":" -f3`";
84 locale = "`echo $line | cut -d":" -f3 | sed "s/$arch\///" | sed "s/\/.*//"`";
86 sha256 = "`echo $line | cut -d":" -f1`";
96 mv $tmpfile ${channel}_sources.nix