/[glsr]/trunk/glsr-install.py
Gentoo

Contents of /trunk/glsr-install.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 40 - (show annotations) (download) (as text)
Thu Jun 30 22:17:26 2005 UTC (9 years, 6 months ago) by port001
File MIME type: text/x-python
File size: 1236 byte(s)
Small installation tool
1 #!/usr/bin/python
2
3 import os
4 import sys
5
6 SVN_REPO = '/home/port001/Gentoo/glsr/trunk/'
7 SITE_PACKAGES = '/usr/lib/python2.4/site-packages/'
8 LOCAL_SHARE = '/usr/local/share/'
9 HOST = 'localhost'
10
11 print "Installing Gentoo Linux Script Repository..."
12 print
13
14 os.chdir(SVN_REPO)
15
16 print "Backing up..."
17
18 if os.path.exists(os.path.join(SITE_PACKAGES, 'glsr')):
19 os.system("rm -rf %s" % os.path.join(SITE_PACKAGES, 'glsr-old'))
20 os.system("mv %s %s" % (os.path.join(SITE_PACKAGES, 'glsr'), os.path.join(SITE_PACKAGES, 'glsr-old')))
21
22 if os.path.exists(os.path.join(LOCAL_SHARE, 'glsr')):
23 os.system("rm -rf %s" % os.path.join(LOCAL_SHARE, 'glsr-old'))
24 os.system("mv %s %s" % (os.path.join(LOCAL_SHARE, 'glsr'), os.path.join(LOCAL_SHARE, 'glsr-old')))
25
26 print "Installing python modules..."
27
28 os.mkdir(os.path.join(SITE_PACKAGES, 'glsr'))
29 os.system("cp -R core/ setup/ site/ __init__.py %s" % os.path.join(SITE_PACKAGES, 'glsr'))
30
31 print "Installing templates and htdocs..."
32
33 os.mkdir(os.path.join(LOCAL_SHARE, 'glsr'))
34 os.mkdir(os.path.join(LOCAL_SHARE, 'glsr', HOST))
35 os.system("cp -R templates/ %s" % os.path.join(LOCAL_SHARE, 'glsr', HOST))
36 os.system("cp -R htdocs/ %s" % os.path.join(LOCAL_SHARE, 'glsr', HOST))
37
38 print
39 print "Done."

  ViewVC Help
Powered by ViewVC 1.1.20