@@ -0,0 +1,1001 @@
+import uuid%0Aimport shutil%0A%0Afrom gerobak.models import Profile%0Afrom gerobak import apt%0A%0Adef get_path(pid):%0A    return os.path.join(os.path.abspath(settings.GEROBAK_WORKING_DIR), %0A                        str(pid))%0A%0Adef prepare_profile_dir(path):%0A    src = os.path.join(settings.GEROBAK_WORKING_DIR, 'base')%0A    shutil.copytree(src, path)%0A%0Adef configure_profile(path, **config):%0A    # architecture%0A    arch = config.get('arch', settings.GEROBAK_DEFAULT_ARCH)%0A    f = open(os.path.join(path, %22apt.conf%22), %22a%22)%0A    f.write('APT::Architecture %22%25s%22;%5Cn' %25 arch)%0A    f.close()%0A%0Adef get_repo(path):%0A    f = open(os.path.join(path, 'sources.list'))%0A    content = f.read()%0A    f.close()%0A    return content%0A    %0Adef update_status(path, status):%0A    shutil.copyfile(status, os.path.join(path, 'status'))%0A%0Adef update_sources(path, items):%0A    sources = items%0A    if type(items) == sources:%0A        sources = %22%5Cn%22.join(items)%0A%0A    f = open(os.path.join(path, 'sources.list'), 'w')%0A    f.write(sources)%0A    f.close()%0A%0A

add utils