3
# testdrive-select-iso - present a list and select an ISO for testdriving
4
# Copyright (C) 2009 Canonical Ltd.
5
# Copyright (C) 2009 Dustin Kirkland
7
# Authors: Dustin Kirkland <kirkland@canonical.com>
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation, version 3 of the License.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
import commands, time, os
25
ARCH = commands.getoutput("uname -m | grep -qs x86_64 && echo amd64 || echo i386")
29
ISO.append({"name":"Ubuntu Desktop", "url":"rsync://cdimage.ubuntu.com/cdimage/daily-live/current/%s-desktop-%s.iso"%(RELEASE,ARCH)})
30
ISO.append({"name":"Ubuntu Server", "url":"rsync://cdimage.ubuntu.com/cdimage/ubuntu-server/daily/current/%s-server-%s.iso"%(RELEASE,ARCH)})
31
ISO.append({"name":"Ubuntu Alternate", "url":"rsync://cdimage.ubuntu.com/cdimage/daily/current/%s-alternate-%s.iso"%(RELEASE,ARCH)})
32
ISO.append({"name":"Ubuntu DVD", "url":"rsync://cdimage.ubuntu.com/cdimage/dvd/current/%s-dvd-%s.iso"%(RELEASE,ARCH)})
33
ISO.append({"name":"Ubuntu Netbook Remix", "url":"rsync://cdimage.ubuntu.com/cdimage/ubuntu-netbook-remix/daily-live/current/%s-netbook-remix-i386.iso"%(RELEASE)})
35
# These are problematic, because the names are all the same ... lucid-desktop-i386.iso
36
# Need to rename the destination ISO accordingly
37
#rsync://cdimage.ubuntu.com/cdimage/kubuntu/daily-live/current/%s-desktop-%s.iso
38
#rsync://cdimage.ubuntu.com/cdimage/xubuntu/daily-live/current/%s-desktop-%s.iso
39
#rsync://cdimage.ubuntu.com/cdimage/mythbuntu/daily-live/current/%s-desktop-%s.iso
40
#rsync://cdimage.ubuntu.com/cdimage/kubuntu-netbook/daily-live/current/%s-netbook-i386.iso"
44
print(" %d. %s (%s)" % (i, iso["name"], RELEASE))
45
filename = os.path.basename(iso["url"])
46
path = "%s/.cache/%s/%s" % (os.environ["HOME"], PKG, filename)
47
if os.path.exists(path):
48
print(" +--> [%s] %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(path))), filename))
50
choice = int(raw_input("\nSelect an ISO to testdrive: "))
51
if choice in range(1, i):
52
print(ISO[choice]["url"])
54
print("Invalid selection")