fn"; then
          eval p_${sl_p}_da=false
          eval p_${sl_p}_fn=

          mis="$mis $sl_p"
          nmis=`expr $nmis + 1`
        else
          eval p_${sl_p}_da=true
          eval p_${sl_p}_fn=$fn

          lf="$lf $sl_p"
          nf=`expr $nf + 1`
        fi
    done
    eval s_${sl_series}_lf=\"$lf\"
    eval s_${sl_series}_mis=\"$mis\"
    eval s_${sl_series}_nmis=$nmis
    eval s_${sl_series}_nf=$nf
    setlength s_${sl_series}_nf 2
}

series_select_all()
{
    ssa_series=$1
    eval all_packages=\"\$s_${ssa_series}_lf\"
    for ssa_p in $all_packages; do
        package_select $ssa_p
    done
    series_stat $ssa_series
}

series_deselect_all()
{
    sda_series=$1
    eval all_packages=\"\$s_${sda_series}_lf\"
    for sda_p in $all_packages; do
        package_deselect $sda_p
    done
    series_stat $sda_series
}

series_stat()
{
    series=$1
    dus=0
    ns=0
    ls=''
    eval ss_all_packages=\"\$s_${series}_lf\"
    for ss_p in $ss_all_packages; do
        eval \$p_${ss_p}_s || continue
        eval newdu=\"\$p_${ss_p}_du\"
        if test -z "$newdu"; then
          echo "unknown disk space usage for package: $ss_p"
          newdu=0
        fi
        ls="$ls $ss_p"
        ns=`expr $ns + 1`
        dus=`expr $dus + $newdu`
    done
    eval s_${series}_dus=\$dus
    setlength s_${series}_dus 5
    eval s_${series}_ns=\$ns
    setlength s_${series}_ns 2
    eval s_${series}_ls=\$ls
}

nobin_stat()
{
    dus=0; nf=0; ns=0;
    for ns_series in $S_nobin_la; do
      eval dus=\`expr \$dus + \$s_${ns_series}_dus\`
      eval nf=\` expr \$nf  + \$s_${ns_series}_nf\`
      eval ns=\` expr \$ns  + \$s_${ns_series}_ns\`
    done
    S_nobin_dus=$dus;  setlength S_nobin_dus 5
    S_nobin_nf=$nf;    setlength S_nobin_nf 2
    S_nobin_ns=$ns;    setlength S_nobin_ns 2
    total_stat
}

total_stat()
{
    s_total_dus=`expr $s_bin_dus + $S_nobin_dus`; setlength s_total_dus 5
    s_total_nf=`expr $s_bin_nf + $S_nobin_nf`;    setlength s_total_nf 2
    s_total_ns=`expr $s_bin_ns + $S_nobin_ns`;    setlength s_total_du 2
}

package_select()   { eval p_${1}_s=true;  }
package_deselect() { eval p_${1}_s=false; }

series_list()
{
    sl_series=$1
    cls
    echo "Series \`\`$sl_series'' statistics:"; echo
    echo "                  package name   size selected"
    echo "  --------------------------------------------"
    eval sl_all_p=\"\$s_${sl_series}_lf\"
    for sl_p in $sl_all_p; do
      eval sl_n=\"\$p_${sl_p}_n\"
      eval sl_du=\"\$p_${sl_p}_du\"
      eval sl_s=\"\$p_${sl_p}_s\"
      if $sl_s; then sl_s='[X]'; else sl_s='[ ]'; fi
      setlength sl_n 30
      setlength sl_du 5
      echo "$sl_n ${sl_du}k    $sl_s"
    done
    eval sl_s_dus=\"\$s_${sl_series}_dus\"
    setlength sl_s_dus 5
    echo "  --------------------------------------------"
    echo "                selected size: ${sl_s_dus}k"
    echo
    echo
    readln
}

series_init()
{
    $echon "Locating packages... "; allseries_locate; echo "Done."
    $echon "Initializing series... "
    for si_series in $S_nobin_la; do
        series_select_all $si_series
    done
    echo "Done."
    series_deselect_all bin
    test -z "$this_platform" || {
        this_platform_set "$this_platform"
        package_select "$this_platform"
        series_stat bin
    }
    allseries_locate_check
}

this_platform_set()
{
    this_platform="$1"
    for tps_p in $s_bin_lf; do
        eval p_${tps_p}_l=optional
    done
    series_deselect_all bin
    if test -z "$this_platform"; then
        this_platform_n=
        this_platform_d=
    else
      package_select ${this_platform}
      series_stat bin
      eval this_platform_n=\$p_${this_platform}_n
      eval this_platform_d=\$p_${this_platform}_d
      eval p_${this_platform}_l=required
    fi
    nobin_stat
}

################################################################
#debugging:
################################################################
series_dbg()
{
    series=$1

    eval echo \""all packages: '\$s_${series}_la'"\"
    eval echo \""default dir:  '\$s_${series}_d'"\"
    eval echo \""selected:     '\$s_${series}_ls'"\"
    eval echo \""found:        '\$s_${series}_lf'"\"
    eval echo \""missing:      '\$s_${series}_mis'"\"
    eval echo \""anz found:    '\$s_${series}_nf'"\"
    eval echo \""anz missing:  '\$s_${series}_nmis'"\"
    eval echo \""anz selected: '\$s_${series}_ns'"\"
    eval echo \""du total:     '\$s_${series}_du'"\"
    eval echo \""du selected:  '\$s_${series}_dus'"\"
    echo help:
    textvar_show s_${series}_h
    echo
}

package_dbg()
{
    p=$1
    eval echo \""gefunden: '\$p_${p}_da'"\"
    eval echo \""