Skip to main content
summaryrefslogtreecommitdiffstats
blob: d564088fe7fd9204d2589bb0bcf8004243e8f626 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
def processArgs():
  signDir = os.path.join(os.sep + "home", "data", "httpd", 
                         "download-staging.priv", "tools", "windowbuilder")
  deployDir = os.path.join(os.sep + 'home', 'data', 'httpd', 
                           'download.eclipse.org', 'windowbuilder')
  usage = "usage: %prog [options] drop subproduct"
  parser = OptionParser(usage=usage)
  parser.set_defaults(debug=False)
  parser.set_defaults(eclipseversion="3.7")
  parser.set_defaults(optimizesite=True)
  parser.set_defaults(packsite=True)
  parser.set_defaults(signfiles=True)
  parser.set_defaults(dodeploy=False)
  parser.set_defaults(dirstosave="7")
  parser.add_option("--signdir", action="store", dest="signdir")
  parser.add_option("-e", "--eclipseversion", action="store", 
                    dest="eclipseversion")
  parser.add_option("--eclipsearchivedir", action="store", 
                    dest="eclipsearchivedir")
  parser.add_option("--nooptimizesite", action="store_false", dest="optimizesite");
  parser.add_option("--nopacksite", action="store_false", dest="packsite")
  parser.add_option("--nosignfiles", action="store_false", dest="signfiles")
  parser.add_option("--deployfiles", action="store_true", dest="dodeploy")
  parser.add_option("--deploydir", action="store", dest="deploydir")
  parser.add_option("--dirstosave", action="store", dest="dirstosave")
  (options, args) = parser.parse_args()
  
  if len(args) != 2:
    parser.error("incorrect number of arguments")
    
  optimizeSite = options.optimizesite
  packSite = options.packsite
  signFiles = options.signfiles
  doDeploy = options.dodeploy
  dirs2save = int(options.dirstosave)


  if options.signdir != None:
    signDir = options.signdir

  if options.deploydir != None:
    deployDir = options.deploydir
  
  if options.eclipsearchivedir != None:
    eclipse.setArchiveDir(options.eclipsearchivedir)
    
  eclipseVersion = options.eclipseversion
       
  dropLocation = args[0]
  subproduct = args[1]

  deployDir = os.path.join(deployDir, subproduct);
  
  if dropLocation == None:
    log.error("you must specify a drop location")
    usage()
    sys.exit(20)

  if subproduct == None:
    log.error("you must specify a subproduct")
    usage()
    sys.exit(21)
    
  if doDeploy:
    optimizeSite = False
    packSite = False
    signFiles = False
    
  
  ret = dict({'droplocation':dropLocation, 'subproduct':subproduct, 
              'signdir':signDir, 'eclipseversion':eclipseVersion,
              'optimizesite':optimizeSite, 'packsite':packSite,
              'signfiles':signFiles, 'dodeploy':doDeploy,
              'deploydir':deployDir, 'dirstosave':dirs2save})
  log.debug("out of processArgs")
  return ret

Back to the top