=== renamed file 'scripts/digest_to_metalink.awk' => 'scripts/digest_to_metalink' (properties changed: -x to +x) === renamed file 'scripts/download_stage' => 'scripts/download_txt_stage' --- scripts/download_stage 2011-11-11 21:50:27 +0000 +++ scripts/download_txt_stage 2011-11-11 17:01:11 +0000 @@ -3,21 +3,24 @@ PS4='+%B%* %F{cyan}%N%f:%F{yellow}%i%f>%b ' set -x -destdir=${2:-.} - -digest_uri=$1 -#digest_uri=$( ${0:h}/resolve_txt_uri $1 ).DIGESTS.asc || exit $? - -digest=$( wget -q -O - $digest_uri ) || exit $? -gpg --verify --batch <<<$digest || exit $? -digest=$( sed -n '/^-----BEGIN PGP SIGNED MESSAGE-----$/,/^-----BEGIN PGP SIGNATURE-----$/p' <<<$digest ) || exit $? -files=( $( gawk -f ${0:h}/list_digest_files | grep '\.tar(\.(gz|bz2|lzma|xz))?$' ) ) -if [[ $#files != 1 ]] -then - echo "got $#files tarballs, one expected" - exit 1 -fi -metalink=$( gawk -v urls=${digest_uri:h} -f ${0:h}/digest_to_metalink <<<$digest ) || exit $? - -aria2c --check-integrity=true --dir=$destdir -M - <<<$metalink || exit $? -echo ${files} +tmpdir=${2:-/tmp} + +stage=$( ${0:h}/resolve_txt_uri $1 ) || exit $? + +digest_uri=${stage}.DIGESTS.asc + +digest_file=$( tempfile -d $tmpdir ) || exit $? + +die() { + rcode=$? + rm $digest_file + exit $rcode +} + +wget -q -O $digest_file $digest_uri || die +gpg --verify --batch $digest_file || die +sed -n '/^-----BEGIN PGP SIGNED MESSAGE-----$/,/^-----BEGIN PGP SIGNATURE-----$/p' $digest_file | \ + gawk -v urls=${stage:h} -f ${0:h}/digest_to_metalink # | \ +# aria2c -M - +#(( ${pipestatus[1]} | ${pipestatus[2]} | ${pipestatus[3]} )) && die +#echo ${stage:t} === removed file 'scripts/list_digest_files.awk' --- scripts/list_digest_files.awk 2011-11-11 21:50:27 +0000 +++ scripts/list_digest_files.awk 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -#!/usr/bin/gawk -f - -BEGIN{ - IFS=" "; -} - -/^[a-fA-F0-9]{32} \S+/{ - files[$2] = 1; -} - -/^[a-fA-F0-9]{40} \S+/{ - files[$2] = 1; -} - -END{ - for(file in files){ - print file - } -} === modified file 'stagebuilder.prolog' --- stagebuilder.prolog 2011-11-11 21:50:27 +0000 +++ stagebuilder.prolog 2011-11-11 17:01:11 +0000 @@ -172,19 +172,17 @@ format_cmd(Cmd, String) :- cmd_tokens(Cmd, Tokens), - append(Tokens, ["||", "exit", "$?"], CheckedResults), - str_join(" ", CheckedResults, String). + str_join(" ", Tokens, String). % format_cmds(Cmds, Strings) :- % maplist(format_cmd, Cmds, Strings). -%print_cmds([ ]). +print_cmds([ ]). print_cmds(Commands) :- flat_cmds(Commands, CmdList), maplist(format_cmd, CmdList, Lines), !, str_join("\n", Lines, String), name(Name,String), - nl, write(Name). print_solution(Solution) :- @@ -260,14 +258,12 @@ download_gentoo_stage(variable(downloaded), Name) --> { gentoo_stage(Name, Arch, Txt), gentoo_mirror(Mirror), - script_dir(ScriptDir), - downloads_dir(DownloadsDir) + script_dir(ScriptDir) }, [ run_outvar([ScriptDir +/+ resolve_txt_uri ,Mirror +/+ releases +/+ Arch +/+ autobuilds +/+ Txt - ,DownloadsDir +/+ Name ], digest_uri) - , run_outvar([ScriptDir +/+ download_stage + , run_outvar([ScriptDir +/+ digest_download , variable(digest_uri) ], downloaded) ].