def test_basic(self):
     manifest = 'test-dependencies.json'
     depot_location = '/space/2013'
     temp_location1 = tempfile.mkdtemp()
     temp_location2 = tempfile.mkdtemp()
     dr = DependenyResolver(manifest, depot_location)
     ds = dr.resolve()
     #create a temp folder
     os.tmpfile()
     for d in ds:
         downloaded = dr.download(d,temp_location1)
         extracted = dr.extract(downloaded,temp_location2)
         ConsoleLogger.info(downloaded)
         ConsoleLogger.info(extracted)
Beispiel #2
0
 def test_basic(self):
     manifest = 'test-dependencies.json'
     depot_location = '/space/2013'
     temp_location1 = tempfile.mkdtemp()
     temp_location2 = tempfile.mkdtemp()
     dr = DependenyResolver(manifest, depot_location)
     ds = dr.resolve()
     #create a temp folder
     os.tmpfile()
     for d in ds:
         downloaded = dr.download(d, temp_location1)
         extracted = dr.extract(downloaded, temp_location2)
         ConsoleLogger.info(downloaded)
         ConsoleLogger.info(extracted)
                  default='dependencies.json',
                  help='manifest file for all dependencies')

parser.add_option('-d', '--depot', dest='depot',
                  default='http://builds.hq.northscale.net/dependencies/couchbase-server-2.0/',
                  help='depot location')
parser.add_option('-t', '--target', dest='target',
                  help='download depenencies to this location')
parser.add_option('-i', '--install', dest='install',
                  default='/opt/couchbase',
                  help='extract the dependencies into this folder ( default = /opt/couchbase')

options, args = parser.parse_args()

if not options.manifest:
    ConsoleLogger.error('you need to specify the manifest file via -m option , e.g -m dependencies.xml')
    parser.print_help()
    give_up()

if not FileUtil.does_it_exist(options.manifest):
    ConsoleLogger.error('specified manifest : %s does not exist' % (options.manifest))
    give_up()

if not options.depot:
    ConsoleLogger.info('depot location (-d) is not specified , choosing the default')
    options.depot = 'http://...'
    give_up()

if not options.target:
    default_target =  '' # working directory/dependencies
    ConsoleLogger.info('target location is not specified , choosing the default to %s' %
                  '--target',
                  dest='target',
                  help='download depenencies to this location')
parser.add_option(
    '-i',
    '--install',
    dest='install',
    default='/opt/couchbase',
    help='extract the dependencies into this folder ( default = /opt/couchbase'
)

options, args = parser.parse_args()

if not options.manifest:
    ConsoleLogger.error(
        'you need to specify the manifest file via -m option , e.g -m dependencies.xml'
    )
    parser.print_help()
    give_up()

if not FileUtil.does_it_exist(options.manifest):
    ConsoleLogger.error('specified manifest : %s does not exist' %
                        (options.manifest))
    give_up()

if not options.depot:
    ConsoleLogger.info(
        'depot location (-d) is not specified , choosing the default')
    options.depot = 'http://...'
    give_up()