mirror of https://github.com/BOINC/boinc.git
- Added command-completion script for bash
svn path=/trunk/boinc/; revision=15133
This commit is contained in:
parent
8f937bd8e2
commit
98041a4866
|
@ -3597,3 +3597,13 @@ Charlie May 5 2008
|
|||
cs_benchmark.C
|
||||
clientgui/
|
||||
MainDocument.cpp
|
||||
|
||||
David May 5 2008
|
||||
- Added command-completion script for bash
|
||||
|
||||
client/scripts/
|
||||
boinc.bash
|
||||
sched/
|
||||
sched_send.C
|
||||
html/user/
|
||||
profile_rate.php
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
#!bash
|
||||
# Source this file in bash to get command completion (using tab)
|
||||
# for boinc and boinccmd
|
||||
# Written by Frank S. Thomas
|
||||
|
||||
_boinc()
|
||||
{
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="$(boinc --help | \
|
||||
sed -n -r 's/^[[:space:]]*(--[a-z_]*).*/\1/p')"
|
||||
|
||||
# Handle options that require one or more arguments.
|
||||
case "$prev" in
|
||||
--attach_project|--detach_project|--reset_project|--update_prefs|\
|
||||
--gui_rpc_port)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# Handle options that require two arguments.
|
||||
if [[ COMP_CWORD -gt 1 ]]; then
|
||||
pprev="${COMP_WORDS[COMP_CWORD-2]}"
|
||||
|
||||
case "$pprev" in
|
||||
--attach_project)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
complete -F _boinc -o default boinc
|
||||
|
||||
_boinccmd()
|
||||
{
|
||||
local cur prev opts cmds
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="--host --passwd -h --help -V --version"
|
||||
cmds="$(boinccmd --help 2>&1 | \
|
||||
sed -n -r 's/^[[:space:]]*(--[a-z_]*).*/\1/p')"
|
||||
|
||||
# The following construct assures that:
|
||||
# - no command follows if one of $opts or $cmds was given
|
||||
# - after --host follows only one command or --passwd and one command
|
||||
# - after --passwd follows only one command
|
||||
if [[ $COMP_CWORD -eq 1 ]]; then
|
||||
COMPREPLY=( $(compgen -W "$opts $cmds" -- "$cur") )
|
||||
return 0
|
||||
else
|
||||
if [[ "${COMP_WORDS[@]}" =~ ".* --host .* --passwd .*" ]]; then
|
||||
if [[ $COMP_CWORD -eq 5 ]]; then
|
||||
COMPREPLY=( $(compgen -W "$cmds" -- "$cur") )
|
||||
fi
|
||||
elif [[ "${COMP_WORDS[@]}" =~ ".* --passwd .*" ]]; then
|
||||
if [[ $COMP_CWORD -eq 3 ]]; then
|
||||
COMPREPLY=( $(compgen -W "$cmds" -- "$cur") )
|
||||
fi
|
||||
elif [[ "${COMP_WORDS[@]}" =~ ".* --host .*" ]]; then
|
||||
if [[ $COMP_CWORD -eq 3 ]]; then
|
||||
COMPREPLY=( $(compgen -W "--passwd $cmds" -- "$cur") )
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Handle options/commands that require one or more arguments.
|
||||
case "$prev" in
|
||||
--get_messages|--passwd)
|
||||
return 0
|
||||
;;
|
||||
|
||||
--host)
|
||||
_known_hosts
|
||||
return 0
|
||||
;;
|
||||
|
||||
--set_run_mode|--set_network_mode)
|
||||
COMPREPLY=( $(compgen -W "always auto never" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
|
||||
--set_screensaver_mode)
|
||||
COMPREPLY=( $(compgen -W "on off" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
complete -F _boinccmd boinccmd
|
||||
# vim: syntax=sh
|
|
@ -148,7 +148,7 @@ $math = array(
|
|||
array(
|
||||
array(
|
||||
"SHA-1 Collision Search Graz",
|
||||
"http://boinc.iaik.tugraz.at/",
|
||||
"http://boinc.iaik.tugraz.at/sha1_coll_search/",
|
||||
"Graz University of Technology",
|
||||
"Cryptography",
|
||||
"Search for collisions (weaknesses) of the widely-used SHA-1 hash function.",
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
// HUH??? both types of of votes are handled the same!!
|
||||
|
||||
require_once("../inc/boinc_db.inc");
|
||||
|
||||
$userid = $_GET['userid'];
|
||||
|
|
|
@ -149,7 +149,12 @@ BEST_APP_VERSION* get_app_version(
|
|||
}
|
||||
bavp->avp = 0;
|
||||
} else {
|
||||
bavp->avp = (APP_VERSION*)1; // arbitrary nonzero value
|
||||
// TODO: allow anonymous platform apps to use coprocs,
|
||||
// multi-thread etc.
|
||||
//
|
||||
bavp->host_usage.init_seq(reply.host.p_fpops);
|
||||
bavp->avp = (APP_VERSION*)1; // arbitrary nonzero value;
|
||||
// means the client already has the app version
|
||||
}
|
||||
reply.wreq.best_app_versions.push_back(bavp);
|
||||
return bavp;
|
||||
|
@ -1381,7 +1386,7 @@ int read_sendable_result(DB_RESULT& result) {
|
|||
}
|
||||
|
||||
// compute a "score" for sending this job to this host.
|
||||
// return 0 if the WU is infeasible
|
||||
// return score=0 if the WU is infeasible
|
||||
//
|
||||
void JOB::get_score(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
|
||||
bool found;
|
||||
|
@ -1394,16 +1399,10 @@ void JOB::get_score(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
|
|||
|
||||
score = 0;
|
||||
|
||||
// Find the app and app_version for the client's platform.
|
||||
// Find the app_version for the client's platform.
|
||||
//
|
||||
if (anonymous(sreq.platforms.list[0])) {
|
||||
found = sreq.has_version(*app);
|
||||
if (!found) return;
|
||||
bavp = NULL;
|
||||
} else {
|
||||
bavp = get_app_version(sreq, reply, wu);
|
||||
if (!bavp) return;
|
||||
}
|
||||
bavp = get_app_version(sreq, reply, wu);
|
||||
if (!bavp) return;
|
||||
|
||||
retval = wu_is_infeasible_fast(wu, sreq, reply, *app);
|
||||
if (retval) {
|
||||
|
@ -1457,7 +1456,11 @@ void JOB::get_score(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
|
|||
score += 1;
|
||||
}
|
||||
|
||||
// If user has selected some apps but will accept jobs from others,
|
||||
// Favor jobs that will run fast
|
||||
//
|
||||
score += bavp->host_usage.flops/1e9;
|
||||
|
||||
// TODO: If user has selected some apps but will accept jobs from others,
|
||||
// try to send them jobs from the selected apps
|
||||
//
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue