Adds a local Autoupdate server and a mechanism for adding developer packages.
I've been getting frustrated by juggling usb sticks to constantly update my netbook so I wrote a simple
server that can run in a developer's source tree and serve updates to a netbook. I also added an upstart
task that will download a script from the dev server and run it. I use this to install sshfs, gdb, and vim.
Here's a quick heads up about what has changed.
1. /etc/lsb-release
I added two new fields to the release file. One is the URL that should be pinged for updates. The other is the URL that can be used to download a developer setup script.
2. chromeos_version.sh
The functionality for the release build is unchanged, however, developer builds now have a monotonically increasing version number.
3. software-update.conf
Autoupdate is disabled when the DEV_SERVER field in /etc/lsb-release is initialized. This field won't be set on the build server, but will be set everywhere else.
4. ping_omaha.sh
The omaha server is now configured by /etc/lsb-release
Review URL: http://chromereview.prom.corp.google.com/1175098
git-svn-id: svn://chrome-svn/chromeos/trunk@92 06c00378-0e64-4dae-be16-12b19f9950a1
diff --git a/devserver.py b/devserver.py
new file mode 100644
index 0000000..c53057a
--- /dev/null
+++ b/devserver.py
@@ -0,0 +1,41 @@
+# Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import autoupdate
+import buildutil
+import os
+import web
+
+app_id = "87efface-864d-49a5-9bb3-4b050a7c227a"
+root_dir = "/usr/local/google/home/rtc/chromeos/trunk/src"
+scripts_dir = "%s/scripts" % root_dir
+app_dir = os.popen("pwd").read().strip()
+static_dir = "%s/static" % app_dir
+web.debug("Serving images from %s/static" % app_dir)
+
+urls = ('/', 'index',
+ '/update', 'update')
+
+app = web.application(urls, globals())
+render = web.template.render('templates/')
+
+
+class index:
+ def GET(self):
+ pkgs = buildutil.GetPackages()
+ return render.index(pkgs)
+
+class update:
+ """
+ Processes updates from the client machine. If an update is found, the url
+ references a static link that can be served automagically from web.py.
+ """
+ def POST(self):
+ return autoupdate.HandleUpdatePing(web.data())
+
+if __name__ == "__main__":
+ web.debug("Setting up the static repo")
+ os.system("mkdir -p %s" % static_dir)
+ app.run()
+