Comments (3)
I'm not on the right computer to set up a PR, but I had a moment to write a version of iso_usls_update.rb
that seems to fix the break. I switched from regex parsing to XML parsing, which hopefully is more robust.
#!/usr/bin/env nix-shell
#!nix-shell -i ruby
#
# Heuristic to update the ISO urls
#
require 'open-uri'
require 'json'
require 'rexml/document'
include REXML
isos = {}
xml = Document.new(open("https://nixos.org/nixos/download.html"))
xml.root.elements.each("body/*/*/*/ul/li") { |li|
hrefs = li.get_elements("a").map { |a| a.attribute("href") }
if hrefs.size == 2 and /.*minimal.*/i =~ hrefs[0].value
then
iso_url = hrefs[0].value
arch_re = /https:\/\/.+-([^-]+)-linux.iso/
arch = arch_re.match(iso_url).captures
iso_sha256 = open(hrefs[1].value).read.strip.split.first
if arch.size == 1
then
isos[arch[0]] = {
iso_url: iso_url,
iso_sha256: iso_sha256
}
end
end
}
out = JSON.pretty_generate(isos)
puts out
File.write("iso_urls.json", out)
from nixbox.
Thanks for posting your fix @shajra-simspace, hit the same issue while working to finish #58 cdituri/feature/hyperv-packer-build
and confirmed you're solution is working 👍
I'm not on the right computer to set up a PR
Caught this comment, and took your code into my own branch to finish the hyperv builder; made sure to attribute you in commit 1201013. If you're ok with this approach, can we continue discussion here #58 (comment) ?
from nixbox.
merged as part of #58. Thanks!
from nixbox.
Related Issues (20)
- Use Efi instead of BIOS HOT 1
- ssh connexion fails with packer > 1.3.3 HOT 2
- PostInstallation script HOT 4
- virtualbox__intnet option in Vagrantfile smashes vagrant-network.nix HOT 1
- SSH fails in nixos-19.09 HOT 3
- Hold on for the 19.09 clipboard virtualbox issue resolution HOT 1
- New Release HOT 2
- Adding build time ERB/erubis dependency? HOT 3
- Use permanent URL instead of latest HOT 7
- Checksum errors HOT 4
- `nix-shell` is an undocumented dependency HOT 1
- Zero out the disk (for better compression) with xfs HOT 2
- Failing with 21.11 HOT 5
- Looking for a new maintainer HOT 6
- Missing ssh private key file HOT 1
- Support for Virtualbox 7.0+ HOT 3
- Can it have a github action that will publish automatically the latest version of NixOS ? HOT 1
- Integrate github action HOT 15
- Replace Packer with Nix HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixbox.