Exemplo n.º 1
0
def main():
    (options, args) = get_options(['rosdistro', 'overlay', 'variant'], ['database'])
    if not options:
        return -1

    # Parse distro file
    distro_obj = rosdistro.Distro(get_rosdistro_file(options.rosdistro))

    # generate rosinstall file for variant
    if options.overlay == 'yes':
        rosinstall = rosdistro.variant_to_rosinstall(options.variant, distro_obj, 'release-tar')
    else:
        rosinstall = rosdistro.extended_variant_to_rosinstall(options.variant, distro_obj, 'release-tar')        

    print rosinstall

    # write to database
    if options.database:
        try:
            connection = sqlite.connect(options.database)
            cursor = connection.cursor()
            try:
                cursor.execute('CREATE TABLE rosinstall (stamp TIMESTAMP, rosdistro TEXT, variant TEXT, overlay TEXT)')
            except sqlite.OperationalError:
                pass
            cursor.execute('INSERT INTO rosinstall VALUES (?, ?, ?, ?)', (datetime.datetime.now(), options.rosdistro, options.variant, options.overlay))
            connection.commit()
        except:
            pass
Exemplo n.º 2
0

release_name = 'unstable'
uri = "https://code.ros.org/svn/release/trunk/distros/%s.rosdistro"%release_name

distro = rosdistro.Distro(uri)


print 'ros', distro.stacks['ros'].repo
print 'nxt', distro.stacks['nxt'].repo
print 'pr2_doors', distro.stacks['pr2_doors'].repo

print 'geometry', distro.stacks['geometry'].repo


for s in distro.stack_names:
    print s, distro.stacks[s].repo

print "geometry"
print yaml.dump(rosdistro.stack_to_rosinstall(distro.stacks['geometry'], "distro"))
print "nxt distro"
print yaml.dump(rosdistro.stack_to_rosinstall(distro.stacks['nxt'], "distro"))
print "nxt release"
print yaml.dump(rosdistro.stack_to_rosinstall(distro.stacks['nxt'], "release"))
print "pr2all"
print yaml.dump( rosdistro.variant_to_rosinstall("pr2all", distro, "distro"))
print "distro"
print yaml.dump( rosdistro.distro_to_rosinstall(distro, "distro"))


import roslib
roslib.load_manifest("rosdistro")
import rosdistro
import yaml

release_name = 'unstable'
uri = "https://code.ros.org/svn/release/trunk/distros/%s.rosdistro" % release_name

distro = rosdistro.Distro(uri)

print 'ros', distro.stacks['ros'].repo
print 'nxt', distro.stacks['nxt'].repo
print 'pr2_doors', distro.stacks['pr2_doors'].repo

print 'geometry', distro.stacks['geometry'].repo

for s in distro.stack_names:
    print s, distro.stacks[s].repo

print "geometry"
print yaml.dump(
    rosdistro.stack_to_rosinstall(distro.stacks['geometry'], "distro"))
print "nxt distro"
print yaml.dump(rosdistro.stack_to_rosinstall(distro.stacks['nxt'], "distro"))
print "nxt release"
print yaml.dump(rosdistro.stack_to_rosinstall(distro.stacks['nxt'], "release"))
print "pr2all"
print yaml.dump(rosdistro.variant_to_rosinstall("pr2all", distro, "distro"))
print "distro"
print yaml.dump(rosdistro.distro_to_rosinstall(distro, "distro"))