Page 1 of 1
Latest Stable/Beta redirects/links for scripting download purposes?
Posted: April 21st, 2010, 5:07 pm
by delicatepc
SOLVED - See last post.
Hi,
Is there a standard link of fetching latest stable/beta? For example:
StableCode: Select all
http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus/latest/SABnzbd-latest-src.tar.gz
Beta
Code: Select all
http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus-beta/latest/SABnzbd-latest-src.tar.gz
I have created a script for FreeNAS that will install SABnzbd 0.5.0.
http://sourceforge.net/apps/phpbb/freen ... =15&t=6511
However I would like to improve the script and have it fetch the latest stable and/or beta available (as well as offer an option of latest known working). I want to avoid hardcoding links as much as I can so that it the script can still be relevant down the line.
Today latest stable build link look like this:
Code: Select all
http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus/sabnzbd-0.5.0/SABnzbd-0.5.0-src.tar.gz
Today latest beta link looks like this:
Code: Select all
http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus-beta/0.5.2RC1/SABnzbd-0.5.2RC1-src.tar.gz
The script would give the user 4 options:
1) Install/Upgrade SABnzbd 0.5.0 (tested good)
2) Install/Upgrade SABnzbd latest stable
3) Install/Upgrade SAbnzbd latest beta
4) Quit
~dpc
Re: Latest Stable/Beta redirects/links for scripting download purposes?
Posted: April 21st, 2010, 5:18 pm
by shypike
Alas, you'll need to write a clever script.
We have little control over how SF.net offers downloads.
Re: Latest Stable/Beta redirects/links for scripting download purposes?
Posted: April 21st, 2010, 5:30 pm
by delicatepc
Would you have any suggestions on what to use as the tie in?
Some ideas that floating in my heads:
1. Have a page on SABnzbd.org that redirects to the latest stable and beta. Its not automated solution but it has to be way to be standardized and consistent (and maintaince it would be low).
2. Same idea as above except use freenas.org as host. Not bad either but has a higher potential to fall wayward.
3. Use some sort of fetch method of discovering what is available today (ie fetch structure of sabnzbd.org and find the version number). Best solution, hardest for me, and not sure on the feasibility.
4. Bribe the sourceforge to hack together a solution
Realistically though it would be a matter of finding a good tie in (doesn't have to last forever but a decent amount of time)...
open to ideas....
thank you,
dpc
Re: Latest Stable/Beta redirects/links for scripting download purposes?
Posted: April 21st, 2010, 5:45 pm
by shypike
It's actually simpler than I thought.
Just read our our "latest" link.
Fetch this URL:
http://sabnzbdplus.sourceforge.net/version/latest
You'll get a simple text file that contains the link to the latests stable version and optionally the latest Alpha/Beta/RC.
Edit: No it's not easy: it doesn't point to the actual files.
It does however contain the version numbers which are relatively simple to convert to paths and filenames.
Re: Latest Stable/Beta redirects/links for scripting download purposes?
Posted: April 21st, 2010, 5:55 pm
by delicatepc
shypike wrote:It does however contain the version numbers which are relatively simple to convert to paths and filenames.
Hmm this is looking good. Not the absolute best but very solid because i believe this is used by SABnzbd itself tell user a newer version is available.
Time to learn how to script it to pull these numbers and work some magic....
thank you,
dpc
Re: Latest Stable/Beta redirects/links for scripting download purposes?
Posted: April 26th, 2010, 11:01 pm
by delicatepc
Solved. This is for FreeNAS:
https://sourceforge.net/apps/phpbb/free ... =15&t=6511
Code: Select all
#!/bin/bash
#Define the architeture of the box
arch=`uname -m`
echo " *******Archeticture of Machine is" $arch "*******"
echo
#Pull latest version number and assign to variable and then display it
stable=($(fetch -q -o - http://sabnzbdplus.sourceforge.net/version/latest | awk '/0/{gsub(/\015/,"");print}'))
beta=($(fetch -q -o - http://sabnzbdplus.sourceforge.net/version/latest | awk '/2/{gsub(/\015/,"");print}'))
echo " Latest SABnzbd Stable version is: $stable"
echo " Latest SABnzbd Beta version is: $beta"
#Menu
echo ""
echo " Which Version do you wish to Install?"
echo " ----- ------- -- --- ---- -- --------"
echo
echo "[1] Upgrade/Install SABnzbd 0.5.0 (tested good)"
echo "[2] Upgrade/Install latest STABLE SABnzbd $stable"
echo "[3] Upgrade/Install lastest BETA SABnzbd $beta"
echo "[4] Exit"
echo
#Reads the input user puts in assigns to "option"
read option
#Acts upon what user entered
case "$option" in
"1")
echo
echo "*******Selected Option 1: SABnzbd 0.5.0 (tested good)*******"
echo
echo "Downloading SABnzbd 0.5.0"
fetch "http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus/sabnzbd-0.5.0/SABnzbd-0.5.0-src.tar.gz"
;;
"2")
echo
echo "*******Selected Option 2: Latest STABLE SABnzbd $stable*******"
echo
echo "Downloading latest STABLE SABnzbd $stable"
fetch http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus/sabnzbd-${stable}/SABnzbd-${stable}-src.tar.gz
;;
"3")
echo
echo "*******Selected Option 2: Latest BETA SABnzbd $beta*******"
echo
echo "Downloading latest BETA SABnzbd ($beta)"
fetch http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus-beta/${beta}/SABnzbd-${beta}-src.tar.gz
;;
"4")
echo
echo "Exiting"
exit
;;
* )
echo
echo "Wrong selection nothing selected"
echo "Exiting"
exit
;;
esac
echo
echo
#Continues with script
echo "*******1. Installing the required prerequisites*******"
echo "--Installing SABnzb (0.4.8)--"
pkg_add -r sabnzbdplus
echo "--Installing py25-yenc--"
pkg_add -r py25-yenc
echo "--Installing unzip--"
pkg_add -r unzip
echo "--Installing py25-pysqlite-2.3.5--"
pkg_add -r "ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-7.2-release/All/py25-pysqlite-2.3.5.tbz"
echo "--Starting SABnzbd (to generate config file)--"
/usr/local/bin/SABnzbd.py -d -f /root/.sabnzbd/sabnzbd.ini
echo "--Shutting down SABnzb--"
/usr/bin/fetch "http://localhost:8080/sabnzbd/api?mode=shutdown"
echo "*******2. Removing outdated files/folders*******"
rm -rf /usr/local/lib/python2.5/site-packages/cherrypy
rm -rf /usr/local/lib/python2.5/site-packages/sabnzbd
rm -rf /usr/local/share/sabnzbdplus/interfaces
rm -rf /usr/local/share/sabnzbdplus/language
rm -rf /usr/local/bin/SABnzbd.py
echo "--done--"
echo "*******3. Extracting updated version of SABnzbd*******"
cd /root/
echo "--Extracting upgrade--"
tar -xzf SABnzbd*
echo "--Extracted upgrade--"
cd SABnzbd*
echo "--done--"
echo "*******4. Moving/Installing newer version of SABnzbd*******"
mv cherrypy /usr/local/lib/python2.5/site-packages/cherrypy
mv sabnzbd /usr/local/lib/python2.5/site-packages/sabnzbd
mv interfaces /usr/local/share/sabnzbdplus/interfaces
mv language /usr/local/share/sabnzbdplus/language
mv SABnzbd.py /usr/local/bin/SABnzbd.py
chmod 0555 /usr/local/bin/SABnzbd.py
ln -s /usr/local/bin/python2.5 /usr/bin/python
ln -s /usr/local/share/sabnzbdplus/interfaces /usr/local/bin/interfaces
ln -s /usr/local/share/sabnzbdplus/language /usr/local/bin/language
echo "--done--"
echo "*******5. Deleting extra files*******"
cd /root/
rm SABnzbd*.gz
rm -rf SABnzbd*
echo "--done--"
echo "*******Done - SABnzbd should be installed*******"
~
dpc