Skip to content

Commit

Permalink
first script working with new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
tfoote committed Jun 6, 2012
1 parent e47d1d7 commit ca5d55b
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 45 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions scripts/setup_apt_root.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python

from __future__ import print_function
import em
import os
import argparse
import pprint

import buildfarm

def parse_options():
parser = argparse.ArgumentParser(
description='setup a directory to be used as a rootdir for apt')
parser.add_argument('--repo', dest='repo_urls', action='append',metavar=['REPO_NAME@REPO_URL'],
help='The name for the source and the url such as ros@http://50.28.27.175/repos/building')
parser.add_argument(dest='distro',
help='The debian release distro, lucid, oneiric, etc')
parser.add_argument(dest='architecture',
help='The debian binary architecture. amd64, i386, armel')
parser.add_argument(dest='rootdir',
help='The rootdir to use')
parser.add_argument('--local-conf-dir',dest='local_conf',
help='A directory to write an apt-conf to use with apt-get update.')
args = parser.parse_args()


if not args.repo_urls:
#default to devel machine for now
args.repo_urls = ['ros@http://50.28.27.175/repos/building']

for a in args.repo_urls:
if not '@' in a:
parser.error("Invalid repo definition: %s"%a)


return args


def doit():
args = parse_options()

ros_repos = buildfarm.apt_root.parse_repo_args(args.repo_urls)

buildfarm.apt_root.setup_apt_rootdir(args.rootdir, args.distro, args.architecture, additional_repos = ros_repos)
if args.local_conf:
buildfarm.apt_root.setup_conf(args.rootdir, args.local_conf)


if __name__ == "__main__":
doit()
3 changes: 2 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export PATH=`pwd`/scripts:`pwd`/scripts/jenkins:$PATH
export PATH=`pwd`/scripts:$PATH
export PYTHONPATH=`pwd`/src:$PYTHONPATH
Empty file added src/buildfarm/__init__.py
Empty file.
44 changes: 0 additions & 44 deletions src/aptenv/setup_apt_root.py → src/buildfarm/apt_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,8 @@
from __future__ import print_function
import em
import os
import argparse
import pprint

def parse_options():
parser = argparse.ArgumentParser(
description='setup a directory to be used as a rootdir for apt')
parser.add_argument('--repo', dest='repo_urls', action='append',metavar=['REPO_NAME@REPO_URL'],
help='The name for the source and the url such as ros@http://50.28.27.175/repos/building')
parser.add_argument(dest='distro',
help='The debian release distro, lucid, oneiric, etc')
parser.add_argument(dest='architecture',
help='The debian binary architecture. amd64, i386, armel')
parser.add_argument(dest='rootdir',
help='The rootdir to use')
parser.add_argument('--local-conf-dir',dest='local_conf',
help='A directory to write an apt-conf to use with apt-get update.')
args = parser.parse_args()


if not args.repo_urls:
#default to devel machine for now
args.repo_urls = ['ros@http://50.28.27.175/repos/building']

for a in args.repo_urls:
if not '@' in a:
parser.error("Invalid repo definition: %s"%a)


return args

class Templates(object):
template_dir = os.path.dirname(__file__)
sources = os.path.join(template_dir, 'sources.list.em') #basic sources
Expand Down Expand Up @@ -118,19 +90,3 @@ def parse_repo_args(repo_args):

return ros_repos

def doit():
args = parse_options()
#print(args)
#print( [a.split('@') for a in args.repo_urls] )



ros_repos = parse_repo_args(args.repo_urls)

setup_apt_rootdir(args.rootdir, args.distro, args.architecture, additional_repos = ros_repos)
if args.local_conf:
setup_conf(args.rootdir, args.local_conf)


if __name__ == "__main__":
doit()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ca5d55b

Please sign in to comment.