=== modified file 'stagebuilder.prolog' --- stagebuilder.prolog 2011-11-11 12:10:07 +0000 +++ stagebuilder.prolog 2011-11-11 08:55:06 +0000 @@ -7,7 +7,7 @@ % Settings % -gentoo_mirror('ftp://ftp.linux.cz/pub/linux/gentoo/'). +gentoo_mirror('ftp://ftp.sh.cvut.cz/MIRRORS/gentoo'). work_dir('/home/ccx/bzr/prosys'). site_conf_dir(Work +/+ conf ) :- work_dir(Work). downloads_dir(Work +/+ downloads) :- work_dir(Work). @@ -233,40 +233,32 @@ {stages_dir(Stages)}, create_tarball(Stages +/+ Name + '.tar.xz', Dir, ['--xz']). -%http_glob(variable(uri), Uri) --> -% {script_dir(ScriptDir)}, -% [run_outvar([ScriptDir +/+ http_glob, Uri], uri)]. -% -%digest_download(variable(downloaded), Uri) --> -% {script_dir(ScriptDir)}, -% [run_outvar([ScriptDir +/+ digest_download, Uri], downloaded)]. - -%download_gentoo_stage(File, Mirror, Arch, Subarch, Subdir) --> -% http_glob(Uri -% ,Mirror + '/releases/' + Arch + '/current-stage3/' -% + Subdir +'stage3-' + Subarch + '-*.DIGESTS.asc' -% ), -% digest_download(File, Uri). - -gentoo_stage(i486, x86, 'latest-stage3-i486.txt'). -gentoo_stage(i686, x86, 'latest-stage3-i686.txt'). -gentoo_stage(i686_hardened, x86, 'latest-stage3-i686-hardened.txt'). -gentoo_stage(amd64, amd64, 'latest-stage3-amd64.txt'). -gentoo_stage(amd64_hardened, amd64, 'latest-stage3-amd64-hardened.txt'). -gentoo_stage(amd64_hardened_nomulti, amd64, 'latest-stage3-amd64-hardened+nomultilib.txt'). - -download_gentoo_stage(variable(downloaded), Name) --> - { gentoo_stage(Name, Arch, Txt), - gentoo_mirror(Mirror), - script_dir(ScriptDir) +http_glob(variable(uri), Uri) --> + {script_dir(ScriptDir)}, + [run_outvar([ScriptDir +/+ http_glob, Uri], uri)]. + +digest_download(variable(downloaded), Uri) --> + {script_dir(ScriptDir)}, + [run_outvar([ScriptDir +/+ digest_download, Uri], downloaded)]. + +download_gentoo_stage(File, Mirror, Arch, Subarch, Subdir) --> + http_glob(Uri + ,Mirror + '/releases/' + Arch + '/current-stage3/' + + Subdir +'stage3-' + Subarch + '-*.DIGESTS.asc' + ), + digest_download(File, Uri). + +gentoo_stage( i486, x86, 'latest-stage3-i486.txt'). +gentoo_stage( i686, x86, 'latest-stage3-i686.txt'). +gentoo_stage(amd64, x86, 'latest-stage3-i486.txt'). +gentoo_stage(amd64_hardened, amd64, amd64, hardened). +gentoo_stage( i686_hardened, x86 , i686, hardened). + +download_gentoo_stage(File, Name) --> + { gentoo_stage(Name, Arch, Subarch, Subdir), + gentoo_mirror(Mirror) }, - [ run_outvar([ScriptDir +/+ resolve_txt_uri - ,Mirror +/+ releases +/+ Arch +/+ autobuild +/+ Txt - ], digest_uri) - , run_outvar([ScriptDir +/+ digest_download - , variable(digest_uri) - ], downloaded) - ]. + download_gentoo_stage(File, Mirror, Arch, Subarch, Subdir). gentoo_package(portage22 ,[package_keywords('sys-apps/portage **') @@ -314,10 +306,6 @@ ,[package_world('ccx-meta/network-utilities') ] ,[ssl,ipv6]). -gentoo_package(vserver_init - ,[package_world('sys-cluster/vserver-init') - ] - ,[vserver]). gentoo_package(Name, Echos, []) :- gentoo_package(Name, Echos). @@ -388,7 +376,7 @@ {site_conf_dir(Conf)}. create_gentoo_builddir(Name, Dir) --> - {gentoo_stage(Name, ArchName, _)}, + {gentoo_stage(Name, _, ArchName, _)}, download_gentoo_stage(Tarball, Name), unpack_tarball(Tarball, Dir), create_chroot_script(Dir, ArchName), @@ -403,9 +391,6 @@ [chroot(Dir, ['emerge -uDN $( cat /root/prosys/world )'])], create_stage(Name + '_stage4', Dir). -target(Commands, Foo, Dir) :- - phrase(target(Foo, Dir), Commands). - target(i686_hardened_stage3, Dir) --> create_gentoo_builddir(i686_hardened, Dir), reset_make_conf(Dir, @@ -416,7 +401,6 @@ configure_gentoo_packages(Dir, [portage22, nopy3k, mc, vim]), [chroot(Dir, ['/root/prosys/rebuild_stage3.sh'])], create_stage(i686_hardened_stage3, Dir). - target(amd64_hardened_vshost, Dir) --> create_gentoo_builddir(amd64_hardened, Dir), {dir_make_conf(Dir, Make_conf)}, @@ -431,21 +415,5 @@ ]), gentoo_build_stage4(amd64_hardened_vshost, Dir). -target(amd64_vserver_base, Dir) --> - amd64_hardened_vserver(amd64_vserver_base, [], Dir). - -amd64_hardened_vserver(Name, Packages, Dir) --> - create_gentoo_builddir(amd64_hardened_nomulti, Dir), - {dir_make_conf(Dir, Make_conf)}, - reset_make_conf(Dir, '-O2 -pipe', '${CFLAGS}' - ,'amd64-pc-linux-gnu'), - [echo_append('ACCEPT_KEYWORDS="~amd64"', Make_conf)], - append_site_make_conf(Dir), - configure_gentoo_packages(Dir - ,[portage22, nopy3k, - base_utilities, base_system, - vserver_init - | Packages - ]), - gentoo_build_stage4(Name, Dir). - +target(Commands, Foo, Dir) :- + phrase(target(Foo, Dir), Commands).