=== modified file 'bin/fsb' --- bin/fsb 2013-05-21 22:56:11 +0000 +++ bin/fsb 2013-05-21 21:57:12 +0000 @@ -140,7 +140,7 @@ ) typeset -g $info_vars - $fsb_targets[$1] info || die "$1 info failed" + $1 info || die "$1 info failed" if (($FSB_INFO_SKIP)); then target_info $FSB_INFO_DEPEND return @@ -200,8 +200,7 @@ fsb_stage_init $info[DIR] fi build_dir=$info[DIR] - ${fsb_targets[${info[FUNC]}]} build || die "${info[FUNC]} build failed" - grep -qFe $1 $build_dir/.fsb_done || print -r - $1 >> $build_dir/.fsb_done + $info[FUNC] build || die "$info[FUNC] build failed" } build_target() { @@ -253,5 +252,5 @@ fsb_info "usage: $0:h "$'\ntargets:\n'${(kF)fsb_targets/#/ - } exit fi -build_target ${1:-$FSB_TARGET} +build_target $1 fsb_info "build completed into: $build_dir" === modified file 'functions/fsb_target_gentoo_autobuild_stage' --- functions/fsb_target_gentoo_autobuild_stage 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_autobuild_stage 2013-05-14 16:35:20 +0000 @@ -1,25 +1,14 @@ -if [[ $1 == info ]]; then - fsb_infer_gentoo_settings - - if [[ -z $STAGE_GENTOO_TARBALL_URL ]]; then - typeset -g STAGE_GENTOO_TARBALL_URL - local txt relative prefix - txt=$FSB_GENTOO_MIRROR/releases/$STAGE_GENTOO_ARCH/autobuilds/$STAGE_GENTOO_NAME.txt - relative=$(wget -qO - $1 | grep -v '^#') - (( $pipestatus[1] )) && die "could not fetch $1" - [[ -z "$relative" ]] && die "no filename found in $1" - prefix=$txt:h - STAGE_GENTOO_TARBALL_URL=$prefix/$relative - fi - - FSB_INFO_DIR=$FSB_BUILD_DIR/${${STAGE_GENTOO_TARBALL_URL:t}%.tar.*} - -elif [[ $1 != build ]]; then - die "unimplemented action: $*" -fi - -local tarball down_dir +local txt tarball dir down_dir +fsb_infer_gentoo_settings +txt=$FSB_GENTOO_MIRROR/releases/$STAGE_GENTOO_ARCH/autobuilds/$STAGE_GENTOO_NAME.txt down_dir=$FSB_DOWNLOADS_DIR/$STAGE_GENTOO_NAME mkdir -p $down_dir || die "Could not create directory for downloads: $down_dir" -tarball="$( fsb_download_gentoo_stage $STAGE_GENTOO_TARBALL_URL $down_dir )" || die "Could not fetch gentoo stage" +tarball="$( fsb_download_gentoo_autobuild_stage $txt $down_dir )" || die "Could not fetch gentoo stage" +dir=$FSB_BUILD_DIR/${${tarball:t}%.tar.*} + +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +fsb_stage_init $dir || die "failed to create stage directory: $1" tar -xpf $tarball -C $build_dir || die "failed to extract $tarball" === modified file 'functions/fsb_target_gentoo_base' --- functions/fsb_target_gentoo_base 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_base 2013-05-15 18:17:52 +0000 @@ -1,18 +1,19 @@ -if [[ $1 == info ]]; then - FSB_INFO_DEPEND=gentoo_init - FSB_INFO_BASE=%s - (($+STAGE_GENTOO_PORTAGE22)) && FSB_INFO_BASE+=-port22 - local mixin - for mixin in $STAGE_GENTOO_MIXINS; do - FSB_INFO_BASE+=-$mixin - done -elif [[ $1 != build ]]; then - die "unimplemented action: $*" -fi +local dir + +fsb_infer_gentoo_settings + +dir=$STAGE_GENTOO_DIR_BASE +dir+=-base + +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +build_target gentoo_init fsb_gentoo_profile_add mix-ins/$^=STAGE_GENTOO_MIXINS if (($+STAGE_GENTOO_PORTAGE22)); then - echo '>$build_dir/etc/portage/package.keywords + echo '>$dir/etc/portage/package.keywords fsb_chroot_bash emerge -1 '>=sys-apps/portage-2.2.0_alpha1' || die fi if (($+EATMYDATA)); then === modified file 'functions/fsb_target_gentoo_dev' --- functions/fsb_target_gentoo_dev 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_dev 2013-05-16 13:21:27 +0000 @@ -1,14 +1,15 @@ -if [[ $1 == info ]]; then - FSB_INFO_DEPEND=gentoo_python - case $STAGE_GENTOO_DEV in - (static-dev) FSB_INFO_BASE+=-static-dev;; - (mdev) FSB_INFO_BASE+=-mdev;; - (udev) FSB_INFO_SKIP=1;; - (*) die "/dev manager '$STAGE_GENTOO_DEV' is not supported at the moment" - esac -elif [[ $1 != build ]]; then - die "unimplemented action: $*" -fi +local dir + +fsb_infer_gentoo_settings + +dir=$STAGE_GENTOO_DIR_BASE +dir+=-$STAGE_GENTOO_DEV + +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +build_target gentoo_python case $STAGE_GENTOO_DEV in (static-dev) @@ -20,6 +21,8 @@ fsb_gentoo_profile_add mix-ins/mdev fsb_chroot_bash emerge -N busybox fsb_gentoo_unmerge_udev - ln -s /etc/init.d/mdev $build_dir/etc/runlevels/sysinit/mdev + ln -s /etc/init.d/mdev $dir/etc/runlevels/sysinit/mdev ;; + (udev) ;; + (*) die "/dev manager '$STAGE_GENTOO_DEV' is not supported at the moment" esac === modified file 'functions/fsb_target_gentoo_flavor' --- functions/fsb_target_gentoo_flavor 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_flavor 2013-05-17 17:48:01 +0000 @@ -1,12 +1,20 @@ -if [[ $1 == info ]]; then - FSB_INFO_DEPEND=gentoo_system - FSB_INFO_BASE=%s-$STAGE_GENTOO_FLAVOR - [[ -n $STAGE_GENTOO_FLAVOR ]] || die 'STAGE_GENTOO_FLAVOR needs to be defined' -elif [[ $1 != build ]]; then - die "unimplemented action: $*" -fi +local dir + +fsb_infer_gentoo_settings + +[[ -n $STAGE_GENTOO_FLAVOR ]] || die 'STAGE_GENTOO_FLAVOR needs to be defined' + +dir=$STAGE_GENTOO_DIR_BASE +dir+=-$STAGE_GENTOO_FLAVOR + +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +build_target gentoo_system + fsb_gentoo_profile_add flavor/$STAGE_GENTOO_FLAVOR -print '@profile' >>$build_dir/var/lib/portage/world_sets +print '@profile' >>$dir/var/lib/portage/world_sets fsb_chroot_bash emerge -uDN @world fsb_chroot_bash emerge --depclean fsb_chroot_bash revdep-rebuild === modified file 'functions/fsb_target_gentoo_gcc' --- functions/fsb_target_gentoo_gcc 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_gcc 2013-05-15 12:00:28 +0000 @@ -1,9 +1,15 @@ -if [[ $1 == info ]]; then - FSB_INFO_DEPEND=gentoo_base - FSB_INFO_BASE=%s - FSB_INFO_DIR=%s-gcc -elif [[ $1 != build ]]; then - die "unimplemented action: $*" -fi +local dir + +fsb_infer_gentoo_settings + +dir=$STAGE_GENTOO_DIR_BASE +dir+=-gcc + +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +build_target gentoo_base + fsb_chroot_bash emerge -1u sys-devel/gcc -$build_dir/chroot.sh /bin/bash -l -c "gcc-config \$(gcc-config -l | awk '{p=\$2} END{print p}')" +$dir/chroot.sh /bin/bash -l -c "gcc-config \$(gcc-config -l | awk '{p=\$2} END{print p}')" === modified file 'functions/fsb_target_gentoo_init' --- functions/fsb_target_gentoo_init 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_init 2013-05-20 09:14:50 +0000 @@ -8,7 +8,6 @@ FSB_INFO_BASE+=-p$STAGE_PORTAGE_TS FSB_INFO_BASE+=-o$STAGE_OVERLAY_REVNO FSB_INFO_DIR=%s-conf - FSB_INFO_DEPEND=gentoo_autobuild_stage elif [[ $1 != build ]]; then die "unimplemented action: $*" @@ -25,21 +24,30 @@ die "STAGE_GENTOO_BRANCH can be either stable or testing, not $STAGE_GENTOO_ARCH";; esac -cp $FSB_TEMPLATE_DIR/chroot.sh $build_dir/ || die +dir=$STAGE_GENTOO_DIR_BASE +dir+=-conf + +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +build_target gentoo_autobuild_stage + +cp $FSB_TEMPLATE_DIR/chroot.sh $dir/ || die case $STAGE_GENTOO_ARCH in - (x86) echo 'SETARCH=i386' >> $build_dir/chroot.conf || die;; - (amd64) echo 'SETARCH=x86_64' >> $build_dir/chroot.conf || die;; + (x86) echo 'SETARCH=i386' >> $dir/chroot.conf || die;; + (amd64) echo 'SETARCH=x86_64' >> $dir/chroot.conf || die;; esac -cat >>$build_dir/chroot.conf <>$dir/chroot.conf <>$build_dir/etc/portage/make.conf <>$dir/etc/portage/make.conf <$build_dir/var/portage/local/profiles/repo_name || die -bzr branch -r $STAGE_OVERLAY_REVNO $FSB_OVERLAY_SRC $build_dir/var/portage/prosys || die "Failed to branch overlay" +mkdir -p $dir/var/portage/{distfiles,packages,local/profiles/custom} || die +echo local >$dir/var/portage/local/profiles/repo_name || die +bzr branch -r $STAGE_OVERLAY_REVNO $FSB_OVERLAY_SRC $dir/var/portage/prosys || die "Failed to branch overlay" -profile_link="$(readlink $build_dir/etc/portage/make.profile)" || die "could not read $build_dir/etc/portage/make.profile" -[[ -n $profile_link ]] || die "$build_dir/etc/portage/make.profile is invalid" -mv $build_dir/etc/portage/make.profile{,.orig} || die +profile_link="$(readlink $dir/etc/portage/make.profile)" || die "could not read $dir/etc/portage/make.profile" +[[ -n $profile_link ]] || die "$dir/etc/portage/make.profile is invalid" +mv $dir/etc/portage/make.profile{,.orig} || die profile=/usr/portage/${profile_link#*/portage/} -ln -s ../../var/portage/local/profiles/custom $build_dir/etc/portage/make.profile || die +ln -s ../../var/portage/local/profiles/custom $dir/etc/portage/make.profile || die fsb_gentoo_profile_add $profile arch/$STAGE_GENTOO_MACHINE === modified file 'functions/fsb_target_gentoo_python' --- functions/fsb_target_gentoo_python 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_python 2013-05-15 12:00:28 +0000 @@ -1,15 +1,20 @@ -if [[ $1 == info ]]; then - FSB_INFO_DEPEND=gentoo_base - if (($+STAGE_GENTOO_NOPY3K)); then - FSB_INFO_BASE=%s-py2 - else - FSB_INFO_SKIP=1 - fi -elif [[ $1 != build ]]; then - die "unimplemented action: $*" +local dir + +fsb_infer_gentoo_settings + +dir=$STAGE_GENTOO_DIR_BASE +dir+=-py2 + +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +build_target gentoo_gcc + +if (($+STAGE_GENTOO_NOPY3K)); then + fsb_gentoo_profile_add mix-ins/nopy3k + fsb_chroot_bash emerge -1u '=python-2.7*' python-updater portage + fsb_chroot_bash eselect python set python2.7 + fsb_chroot_bash emerge --unmerge '>=dev-lang/python-3' + fsb_chroot_bash python-updater fi -fsb_gentoo_profile_add mix-ins/nopy3k -fsb_chroot_bash emerge -1u '=python-2.7*' python-updater portage -fsb_chroot_bash eselect python set python2.7 -fsb_chroot_bash emerge --unmerge '>=dev-lang/python-3' -fsb_chroot_bash python-updater === modified file 'functions/fsb_target_gentoo_system' --- functions/fsb_target_gentoo_system 2013-05-21 22:56:11 +0000 +++ functions/fsb_target_gentoo_system 2013-05-15 12:00:28 +0000 @@ -1,15 +1,20 @@ -if [[ $1 == info ]]; then - FSB_INFO_DEPEND=gentoo_dev - FSB_INFO_BASE=%s - if (($+STAGE_GENTOO_EMPTYTREE)); then - FSB_INFO_DIR=%s-emptytree - else - FSB_INFO_DIR=%s-system - fi -elif [[ $1 != build ]]; then - die "unimplemented action: $*" +local dir + +fsb_infer_gentoo_settings + +dir=$STAGE_GENTOO_DIR_BASE +if (($+STAGE_GENTOO_EMPTYTREE)); then + dir+=-emptytree +else + dir+=-system fi +build_dir_check $dir $0 && return 0 +[[ $? -eq 100 ]] || die "build_dir_check failed" + +build_dir_push $dir +build_target gentoo_dev + if (($+STAGE_GENTOO_EMPTYTREE)); then fsb_chroot_bash emerge --emptytree @world else