Last active
February 25, 2016 18:34
-
-
Save jl2/7796263c014ce55ed379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # urxvt #/home/jeremiah/oss/chrome" | |
| export CHROME_DEVEL_SANDBOX=/home/jeremiah/oss/chrome-linux/chrome_sandbox | |
| cd /home/jeremiah/oss/chrome-linux | |
| ./chrome "$@" --enable-plugins --ppapi-flash-path=/opt/google/chrome/PepperFlash/libpepflashplayer.so --ppapi-flash-version=17.0.0.188 | |
| # opera-developer "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| chown root:root /home/jeremiah/oss/chrome-linux/chrome_sandbox | |
| chmod 4755 /home/jeremiah/oss/chrome-linux/chrome_sandbox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/lisp --script | |
| ;;-*-lisp-*- | |
| #-quicklisp | |
| (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) | |
| (load quicklisp-init)) | |
| (ql:quickload 'drakma) | |
| (defun download-file (url outfname) | |
| (let* | |
| ((instream (drakma:http-request url :want-stream t :force-binary t)) | |
| (buf (make-array 4096 :element-type '(unsigned-byte 8)))) | |
| (with-open-file (outstream outfname | |
| :direction :output | |
| :if-exists :supersede | |
| :element-type '(unsigned-byte 8)) | |
| (loop for pos = (read-sequence buf instream) | |
| while (plusp pos) do | |
| (write-sequence buf outstream :end pos))))) | |
| (defun get-version (fname) | |
| (with-open-file (stream fname) | |
| (parse-integer (read-line stream)))) | |
| (defun save-version (fname version) | |
| (with-open-file (stream fname :direction :output :if-exists :supersede) | |
| (format stream "~a" version))) | |
| (let* ( | |
| (force-build (string= "--force" (second sb-ext:*posix-argv*))) | |
| (version-url "http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/LAST_CHANGE") | |
| (new-version (parse-integer (drakma:http-request version-url))) | |
| (cur-version-file (merge-pathnames ".config/chrome_version" (user-homedir-pathname))) | |
| (cur-version (get-version cur-version-file)) | |
| (zip-url (format nil "http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/~a/chrome-linux.zip" new-version)) | |
| (zip-dir "/home/jeremiah/oss") | |
| (zip-file-name (format nil "~a/chrome-linux.zip" zip-dir))) | |
| (format t "Current version: ~a, new version: ~a~%" cur-version new-version) | |
| (if (or force-build (< cur-version new-version)) | |
| (progn | |
| (format t "Updating to version ~a~%" new-version) | |
| (download-file zip-url zip-file-name) | |
| (run-program "unzip" (list "-qq" "-o" "-K" "-d" zip-dir zip-file-name) :search t :output t :input t :error :output :wait t :directory zip-dir) | |
| (save-version cur-version-file new-version) | |
| (run-program "sudo" (list "/home/jeremiah/bin/fix_chrome_perms") :search t :output t :input t :error :output :wait t :directory zip-dir)) | |
| (format t "Not updating!~%"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment