John Clendenen
2018-Aug-11 00:58 UTC
[Samba] Programmatically Retrieve Current Stable Version
I am writing an update script for Samba (compiled from source) and I am wondering how best to programmatically get the latest release version number. I know that https://download.samba.org/pub/samba/samba-latest.tar.gz exists, but I would like to get the version number to compare to smbd -V, so that it can quietly ignore if Samba is already up to date. My currently solution is to incrementally prod at https://download.samba.org/pub/samba/stable/samba-4.X.X.tar.gz, but that’s obviously not ideal. Please let me know if there is a better, accepted way to about this. Thank you for all your hard work. I am looking forward to the 4.9 release.
Andrew Bartlett
2018-Aug-13 00:39 UTC
[Samba] Programmatically Retrieve Current Stable Version
On Fri, 2018-08-10 at 20:58 -0400, John Clendenen via samba wrote:> I am writing an update script for Samba (compiled from source) and I am > wondering how best to programmatically get the latest release version > number. > > I know that https://download.samba.org/pub/samba/samba-latest.tar.gz exists, > but I would like to get the version number to compare to smbd -V, so that > it can quietly ignore if Samba is already up to date. > > My currently solution is to incrementally prod at > https://download.samba.org/pub/samba/stable/samba-4.X.X.tar.gz, but that’s > obviously not ideal. > > Please let me know if there is a better, accepted way to about this. > > Thank you for all your hard work. I am looking forward to the 4.9 release.Debian has a watch file for this purpose: https://sources.debian.org/src/samba/2:4.8.2+dfsg-2/debian/watch/ It is much the same as what you do however. There are also tags in the samba git repo, eg samba-4.8.1 Andrew Bartlett -- Andrew Bartlett https://samba.org/~abartlet/ Authentication Developer, Samba Team https://samba.org Samba Development and Support, Catalyst IT https://catalyst.net.nz/services/samba
L.P.H. van Belle
2018-Aug-13 07:47 UTC
[Samba] Programmatically Retrieve Current Stable Version
Hai, I use, this to get the latest versions from the samba site. wget -q https://ftp.samba.org/pub/samba/ -O - | awk -F"href=\"" '{ print $2 }'| cut -d"\"" -f1 | egrep -v "/|asc|FTP|latest|=|COPY|READ|DOWNLOAD" | sort|uniq | tail -n1 Results in : samba-4.8.3.tar.gz Set -n1 to -n2 to see 4.7 also or -n3 to see 4.6.x I also suggest you look also at. https://salsa.debian.org/samba-team/samba/blob/master/debian/README.source.md This one is updated to 4.8. Debian Dev Mathieu did some very good work here for the git instructions. If you look at : https://packages.debian.org/sid/samba you wil see 4.8.2. If you look at the git tree, you will that 4.8.3 is already imported in the debian git tree. Its just not in experimental, my debian 4.8.3 package are based on the debian git 4.8.3. Greetz, Louis> -----Oorspronkelijk bericht----- > Van: samba [mailto:samba-bounces at lists.samba.org] Namens > Andrew Bartlett via samba > Verzonden: maandag 13 augustus 2018 2:40 > Aan: John Clendenen; samba at lists.samba.org > Onderwerp: Re: [Samba] Programmatically Retrieve Current > Stable Version > > On Fri, 2018-08-10 at 20:58 -0400, John Clendenen via samba wrote: > > I am writing an update script for Samba (compiled from > source) and I am > > wondering how best to programmatically get the latest > release version > > number. > > > > I know that > https://download.samba.org/pub/samba/samba-latest.tar.gz exists, > > but I would like to get the version number to compare to > smbd -V, so that > > it can quietly ignore if Samba is already up to date. > > > > My currently solution is to incrementally prod at > > > https://download.samba.org/pub/samba/stable/samba-4.X.X.tar.gz > , but that’s > > obviously not ideal. > > > > Please let me know if there is a better, accepted way to about this. > > > > Thank you for all your hard work. I am looking forward to > the 4.9 release. > > Debian has a watch file for this purpose: > > https://sources.debian.org/src/samba/2:4.8.2+dfsg-2/debian/watch/ > > It is much the same as what you do however. > > There are also tags in the samba git repo, eg samba-4.8.1 > > Andrew Bartlett > > -- > Andrew Bartlett > https://samba.org/~abartlet/ > Authentication Developer, Samba Team https://samba.org > Samba Development and Support, Catalyst IT > https://catalyst.net.nz/services/samba > > > > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba > >
Rowland Penny
2018-Aug-13 08:59 UTC
[Samba] Programmatically Retrieve Current Stable Version
On Fri, 10 Aug 2018 20:58:38 -0400 John Clendenen via samba <samba at lists.samba.org> wrote:> I am writing an update script for Samba (compiled from source) and I > am wondering how best to programmatically get the latest release > version number. > > I know that https://download.samba.org/pub/samba/samba-latest.tar.gz > exists, but I would like to get the version number to compare to smbd > -V, so that it can quietly ignore if Samba is already up to date. > > My currently solution is to incrementally prod at > https://download.samba.org/pub/samba/stable/samba-4.X.X.tar.gz, but > that’s obviously not ideal. > > Please let me know if there is a better, accepted way to about this. > > Thank you for all your hard work. I am looking forward to the 4.9 > release.Samba tells you what the latest stable version is here (at the moment): https://download.samba.org/pub/samba/LATEST-IS-SAMBA-4.8.3 So you could write a script something like this to check it: #!/bin/bash # Get present Samba version version=$(smbd -V | awk '{print $2}' | awk -F '-' '{print $1}') url="https://download.samba.org/pub/samba/LATEST-IS-$version" if curl -f ${url} >/dev/null 2>&1; then echo "Using latest version" else echo "New version available" fi exit 0 Rowland
Seemingly Similar Threads
- Retrieve results from chisq.test programmatically
- Programmatically counting RSpec tests?
- Asterisk 13.6.0: Is there a way to create PJSIP users and dialplans programmatically using API
- How do I programmatically send a 404 error
- How to set command line option programmatically?