rurio --
I don't much cotton to the idea of auto-updating software on my Machines.
Been there, done that on an old RH Box and it made a mess and I wasn't sure how the mess was made nor what that mess was and finding and fixing it caused a four-hour outage on a customer's mission-critical Box.
Not to mention the disasters I see from time-to-time on customer's Windows Boxen.
Anyway, it's something I don't do any more if I can prevent it.
Another thing is I try to not write content to the HDD until I am ready to do something with it.
Enough philosophizing ... Let me say first of all that I really do like your google-chrome.SlackBuild script ( latest-chrome Version 1.3.3 )
It is much easier to use than the official one in Slackware64/extra/google-chrome/ because it checks for updates and it does the downloads automatically ( lazy-ole-me likes that
).
And I REALLY like the fact that I can build the package as a 'joe' ( no need to be root ).
Thanks for asking the question which made me look closely at latest-chrome to see what it actually does.
Now that I've looked at latest-chrome, there is no reason it couldn't be run as a cronjob.
My only suggestion would be to add an optional 'report-only' mode ( which is what I am after )
Something like this ...
Code:
let report_only = 0 ; # default is 'build the package' but allow an override
#
# ... update_available is tested ...
#
if ( update_available == 0 ){
if ( report_only != 1 ) {
print "google-chrome is already installed" ;
}
exit 0 ; # RetCode == 0 -> google-chrome is up-to-date
}
#
# if running in 'report only mode' exit here
#
if ( report_only == 1 ) {
print "google-chrome ($VERSION) is available"
exit 1 ; # RetCode == 1 -> an update is available
}
This way, I would get reminders until I am up-to-date but the latest-chrome won't bother to build the Package until I am ready for it.
But I don't want to mess with your script so that I can update it if ever needs an update.
That's why I created and installed `check-version-xml.sh` as a cronjob.
OTOH, if you want it, below is a patch which adds a -r ( or --report-only ) commandline arg to latest-chrome
When run in report-only mode, latest-chrome will simply check the version and ... if up-to-date then exit( 0 ) else { print a message ; exit( 1 ) }
Finally, speaking of cronjobs, I received an email from check-version-xml.sh this morning: google-chrome-53.0.2785.113-x86_64-1 is available
HTH ...
-- kjh
# diff -Naur latest-chrome latest-chrome.orig
Code:
--- latest-chrome-orig 2016-03-10 14:23:46.000000000 -0600
+++ latest-chrome 2016-09-14 07:02:33.440998762 -0500
@@ -29,8 +29,18 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+REPORT_ONLY=N # default - same as always -- package up google-chrome
+#
+# Check if the user asked for report-only ...
+#
+if [ "$1" = "-r" -o "$1" = "--report-only" ]; then
+ REPORT_ONLY=Y
+ AUTO_INSTALL=N
+#
+# REPORT_ONLY and AUTO_INSTALL are mutually-exclusive ... elif works
+#
# Check if the user asked for auto-install
-if [ "$1" = "-i" -o "$1" = "--install" ]; then
+elif [ "$1" = "-i" -o "$1" = "--install" ]; then
if [ "$UID" = "0" ]; then
AUTO_INSTALL=Y
else
@@ -68,9 +78,22 @@
# Don't start repackaging if the same version is already installed
if /bin/ls /var/log/packages/google-chrome-$VERSION-* >/dev/null 2>&1 ; then
- echo "Google Chrome ($VERSION) is already installed; exiting"
+ #
+ # don't print when report-only mode
+ #
+ if [ "$REPORT_ONLY" != "Y" ] ; then
+ echo "Google Chrome ($VERSION) is already installed; exiting"
+ fi
+
exit 0
fi
+#
+# report only ... exit here
+#
+if [ "$REPORT_ONLY" = "Y" ] ; then
+ echo "Google Chrome ($VERSION) is available"
+ exit 1
+fi
CWD=$(pwd)
TMP=${TMP:-/tmp}