summaryrefslogtreecommitdiffstats
path: root/perl-install/share/list.alpha
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-02-18 00:54:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-02-18 00:54:38 +0000
commitfabf3d9d6f72454f07c187c0433b1c65b2e632b0 (patch)
tree7336066336a11b7527ac3c7266bffa934874d0b7 /perl-install/share/list.alpha
parent5a5cadc58c1711c3a3019fc284a6010b24af1471 (diff)
downloaddrakx-fabf3d9d6f72454f07c187c0433b1c65b2e632b0.tar
drakx-fabf3d9d6f72454f07c187c0433b1c65b2e632b0.tar.gz
drakx-fabf3d9d6f72454f07c187c0433b1c65b2e632b0.tar.bz2
drakx-fabf3d9d6f72454f07c187c0433b1c65b2e632b0.tar.xz
drakx-fabf3d9d6f72454f07c187c0433b1c65b2e632b0.zip
no_comment
Diffstat (limited to 'perl-install/share/list.alpha')
-rw-r--r--perl-install/share/list.alpha2
1 files changed, 0 insertions, 2 deletions
diff --git a/perl-install/share/list.alpha b/perl-install/share/list.alpha
index ed7935822..efabaecbb 100644
--- a/perl-install/share/list.alpha
+++ b/perl-install/share/list.alpha
@@ -1,4 +1,2 @@
/usr/X11R6/bin/XF86_3DLabs
-/usr/X11R6/bin/XF86_FBDev
-/usr/X11R6/bin/XF86_TGA
/usr/X11R6/bin/xmodmap
n class="hl com"> * */ #include <unistd.h> #include <stdlib.h> #include <string.h> #include "tools.h" #include "utils.h" #include "stage1.h" #include "frontend.h" #include "log.h" #include "automatic.h" static struct param_elem * automatic_params; static char * value_not_bound = ""; void grab_automatic_params(char * line) { int i, p; struct param_elem tmp_params[50]; i = 0; p = 0; while (line[i] != '\0') { char *name, *value; int k; int j = i; while (line[i] != ':' && line[i] != '\0') i++; name = _memdup(&line[j], i-j + 1); name[i-j] = 0; k = i+1; i++; while (line[i] != ',' && line[i] != '\0') i++; value = _memdup(&line[k], i-k + 1); value[i-k] = 0; tmp_params[p].name = name; tmp_params[p].value = value; p++; if (line[i] == '\0') break; i++; } tmp_params[p++].name = NULL; automatic_params = _memdup(tmp_params, sizeof(struct param_elem) * p); log_message("AUTOMATIC MODE: got %d params", p-1); } char * get_auto_value(char * auto_param) { struct param_elem * ptr = automatic_params; struct param_elem short_aliases[] = { { "method", "met" }, { "network", "netw" }, { "interface", "int" }, { "gateway", "gat" }, { "netmask", "netm" }, { "adsluser", "adslu" }, { "adslpass", "adslp" }, { "hostname", "hos" }, { "domain", "dom" }, { "server", "ser" }, { "directory", "dir" }, { "user", "use" }, { "pass", "pas" }, { "disk", "dis" }, { "partition", "par" }, { "proxy_host", "proxh" }, { "proxy_port", "proxp" }, { NULL, NULL } }; struct param_elem * ptr_alias = short_aliases; while (ptr_alias->name) { if (streq(auto_param, ptr_alias->name)) break; ptr_alias++; } while (ptr->name) { if (streq(ptr->name, auto_param) || (ptr_alias->name && streq(ptr_alias->value, ptr->name))) return ptr->value; ptr++; } return value_not_bound; } enum return_type ask_from_list_auto(char *msg, char ** elems, char ** choice, char * auto_param, char ** elems_auto) { if (!IS_AUTOMATIC) { return ask_from_list(msg, elems, choice); } else { char ** sav_elems = elems; char * tmp = get_auto_value(auto_param); while (elems && *elems) { if (!strcmp(tmp, *elems_auto)) { *choice = *elems; log_message("AUTOMATIC: parameter %s for %s means returning %s", tmp, auto_param, *elems); return RETURN_OK; } elems++; elems_auto++; } unset_automatic(); /* we are in a fallback mode */ return ask_from_list(msg, sav_elems, choice); } } enum return_type ask_from_list_comments_auto(char *msg, char ** elems, char ** elems_comments, char ** choice, char * auto_param, char ** elems_auto) { if (!IS_AUTOMATIC) { return ask_from_list_comments(msg, elems, elems_comments, choice); } else { char ** sav_elems = elems; char * tmp = get_auto_value(auto_param); while (elems && *elems) { if (!strcmp(tmp, *elems_auto)) { *choice = *elems; log_message("AUTOMATIC: parameter %s for %s means returning %s", tmp, auto_param, *elems); return RETURN_OK; } elems++; elems_auto++; } unset_automatic(); /* we are in a fallback mode */ return ask_from_list_comments(msg, sav_elems, elems_comments, choice); } } enum return_type ask_from_entries_auto(char *msg, char ** questions, char *** answers, int entry_size, char ** questions_auto, void (*callback_func)(char ** strings)) { if (!IS_AUTOMATIC) { return ask_from_entries(msg, questions, answers, entry_size, callback_func); } else { char * tmp_answers[50]; int i = 0; while (questions && *questions) { tmp_answers[i] = get_auto_value(*questions_auto); log_message("AUTOMATIC: question %s answers %s because of param %s", *questions, tmp_answers[i], *questions_auto); i++; questions++; questions_auto++; } *answers = _memdup(tmp_answers, sizeof(char *) * i); return RETURN_OK; } }