Thinking more about Packaging

Now that I’ve refreshed my memories of how packaging works and some exploratory hacking with cgi.rb at this website, I can think more about how it should work. It’s very tempting to just add some additional items to the Pack GUI screen for armhf/i686/x86_64 and add a [arch] parameter and the only thing that changes is using this website for downloads instead of the dead shoes.heroku.com. That isn’t as easy I make it sound. It’s also not very elegant.

Ideally, I’d want the Pack Screen of Shoes to download a list of available Shoes distributions and build the GUI from them and the only option is to package to what’s available. That will take some surgery on pack.rb and I’m going to have a cgi script compute what’s available on the website so I can just upload a new version and not have to remember to find all the static pages and files. Weather Forecast: Cloudy with a chance of fail.
Here is the cgi that Pack.rb will ask for, equivalent to a
wget http://shoes.mvmanila.com/public/select/pkg.rb

#!/usr/bin/ruby
lns = []
Dir.glob('../shoes/*') do |fp|
tm = File.mtime(fp).to_i
sz = File.size(fp).to_i/1048576
fn = File.basename(fp)
lns << "#{sz} #{tm} #{fn}" end require 'cgi' cgi = CGI.new cgi.out{ lns.join("n") }

That produces a (wget) file:
12 1394777130 Shoes-3.2b3-msw.exe
17 1394775751 shoes-3.2b3-gtk2-armhf.run
16 1394776193 shoes-3.2b3-gtk2-i686.run
17 1394776919 shoes-3.2b3-gtk2-x86_64.run
17 1395463602 shoes-3.2b4-gtk2-armhf.run
17 1395463956 shoes-3.2b4-gtk2-i686.run
17 1395464575 shoes-3.2b4-gtk2-x86_64.run
12 1395463307 shoes-3.2b4-msw.exe
10 1394007512 shoes3.2b3.tar.gz

Yeah, I could have computed file size in MB at the Shoes Client. I could also write the cgi in python, or TCL or bash. I include the mtime so the client (Shoes/pack.rb) can figure out which version of Shoes3.2 is newer because you can't depend on The Cecil's naming scheme. I can't sort by name. Is Shoes-3.2b4 newer than Shoes-3.2rc1? or just 3.2?. This one of those choices that you know will bite you in the butt, either way. I leave it to pack.rb to parse and display the servers list. Yes, parsing the file names will be more arbitrary than a control freak would like.

Leave a Reply

Your email address will not be published. Required fields are marked *