Handle tabs in INDEX files.
Display full, un-truncated version of description in status line.
This commit is contained in:
parent
391bef8d07
commit
f51935dac3
@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: config.c,v 1.36 1996/06/13 17:36:26 jkh Exp $
|
||||
* $Id: config.c,v 1.37 1996/06/15 17:58:51 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -451,7 +451,7 @@ configPackages(dialogMenuItem *self)
|
||||
"(or path to media) and try again. If your local site does not\n"
|
||||
"carry the packages collection, then we recommend either a CD\n"
|
||||
"distribution or the master distribution on ftp.freebsd.org.");
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
msgNotify("Got INDEX successfully, now building packages menu..");
|
||||
index_init(&top, &plist);
|
||||
@ -505,6 +505,7 @@ configPorts(dialogMenuItem *self)
|
||||
{
|
||||
char *cp, *dist = NULL; /* Shut up compiler */
|
||||
|
||||
dialog_clear();
|
||||
if (!variable_get(VAR_PORTS_PATH))
|
||||
variable_set2(VAR_PORTS_PATH, dist = "/cdrom/ports");
|
||||
while (!directory_exists(dist)) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: index.c,v 1.34 1996/06/12 14:02:06 jkh Exp $
|
||||
* $Id: index.c,v 1.35 1996/06/14 14:33:53 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -132,6 +132,17 @@ new_pkg_node(char *name, node_type type)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static char *
|
||||
strip(char *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; buf[i]; i++)
|
||||
if (buf[i] == '\t' || buf[i] == '\n')
|
||||
buf[i] = ' ';
|
||||
return buf;
|
||||
}
|
||||
|
||||
static IndexEntryPtr
|
||||
new_index(char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *deps)
|
||||
{
|
||||
@ -141,7 +152,7 @@ new_index(char *name, char *pathto, char *prefix, char *comment, char *descr, ch
|
||||
tmp->path = _strdup(pathto);
|
||||
tmp->prefix = _strdup(prefix);
|
||||
tmp->comment = _strdup(comment);
|
||||
tmp->descrfile = _strdup(descr);
|
||||
tmp->descrfile = strip(_strdup(descr));
|
||||
tmp->maintainer = _strdup(maint);
|
||||
tmp->deps = _strdup(deps);
|
||||
return tmp;
|
||||
@ -388,7 +399,7 @@ pkg_checked(dialogMenuItem *self)
|
||||
|
||||
i = index_search(plist, kp->name, NULL) ? TRUE : FALSE;
|
||||
if (kp->type == PACKAGE && plist)
|
||||
return i || (!RunningAsInit && package_exists(kp->name));
|
||||
return i || package_exists(kp->name);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
@ -405,7 +416,7 @@ pkg_fire(dialogMenuItem *self)
|
||||
sp = index_search(plist, kp->name, NULL);
|
||||
/* Not already selected? */
|
||||
if (!sp) {
|
||||
if (RunningAsInit || !package_exists(kp->name)) {
|
||||
if (!package_exists(kp->name)) {
|
||||
PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode));
|
||||
|
||||
*np = *kp;
|
||||
@ -433,6 +444,11 @@ pkg_fire(dialogMenuItem *self)
|
||||
void
|
||||
pkg_selected(dialogMenuItem *self, int is_selected)
|
||||
{
|
||||
PkgNodePtr kp = self->data;
|
||||
|
||||
if (!is_selected || kp->type != PACKAGE)
|
||||
return;
|
||||
msgInfo(kp->desc);
|
||||
}
|
||||
|
||||
int
|
||||
@ -453,7 +469,7 @@ index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll)
|
||||
/* Figure out if this menu is full of "leaves" or "branches" */
|
||||
for (kp = top->kids; kp && kp->name; kp = kp->next) {
|
||||
int len;
|
||||
|
||||
|
||||
++n;
|
||||
if (kp->type == PACKAGE && plist) {
|
||||
hasPackages = TRUE;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: media.c,v 1.41 1996/06/17 21:48:28 jkh Exp $
|
||||
* $Id: media.c,v 1.42 1996/06/17 23:04:22 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -260,6 +260,7 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
char *cp, *hostname, *dir;
|
||||
extern int FtpPort;
|
||||
|
||||
dialog_clear();
|
||||
if (!dmenuOpenSimple(&MenuMediaFTP))
|
||||
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
|
||||
else
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: package.c,v 1.37 1996/05/23 16:34:29 jkh Exp $
|
||||
* $Id: package.c,v 1.38 1996/05/27 22:12:05 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -56,8 +56,16 @@ package_add(char *name)
|
||||
Boolean
|
||||
package_exists(char *name)
|
||||
{
|
||||
int status = vsystem("pkg_info -e %s", name);
|
||||
char fname[FILENAME_MAX];
|
||||
int status /* = vsystem("pkg_info -e %s", name) */;
|
||||
|
||||
/* XXX KLUDGE ALERT! This makes evil assumptions about how XXX
|
||||
* packages register themselves and should *really be done with
|
||||
* `pkg_info -e <name>' except that this it's too slow for an
|
||||
* item check routine.. :-(
|
||||
*/
|
||||
snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name);
|
||||
status = access(fname, R_OK);
|
||||
msgDebug("package check for %s returns %s.\n", name,
|
||||
status ? "failure" : "success");
|
||||
return !status;
|
||||
@ -84,7 +92,6 @@ package_extract(Device *dev, char *name, Boolean depended)
|
||||
vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
|
||||
|
||||
/* Check to make sure it's not already there */
|
||||
msgNotify("Checking for existence of %s package", name);
|
||||
if (package_exists(name))
|
||||
return DITEM_SUCCESS;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: config.c,v 1.36 1996/06/13 17:36:26 jkh Exp $
|
||||
* $Id: config.c,v 1.37 1996/06/15 17:58:51 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -451,7 +451,7 @@ configPackages(dialogMenuItem *self)
|
||||
"(or path to media) and try again. If your local site does not\n"
|
||||
"carry the packages collection, then we recommend either a CD\n"
|
||||
"distribution or the master distribution on ftp.freebsd.org.");
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
msgNotify("Got INDEX successfully, now building packages menu..");
|
||||
index_init(&top, &plist);
|
||||
@ -505,6 +505,7 @@ configPorts(dialogMenuItem *self)
|
||||
{
|
||||
char *cp, *dist = NULL; /* Shut up compiler */
|
||||
|
||||
dialog_clear();
|
||||
if (!variable_get(VAR_PORTS_PATH))
|
||||
variable_set2(VAR_PORTS_PATH, dist = "/cdrom/ports");
|
||||
while (!directory_exists(dist)) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: config.c,v 1.36 1996/06/13 17:36:26 jkh Exp $
|
||||
* $Id: config.c,v 1.37 1996/06/15 17:58:51 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -451,7 +451,7 @@ configPackages(dialogMenuItem *self)
|
||||
"(or path to media) and try again. If your local site does not\n"
|
||||
"carry the packages collection, then we recommend either a CD\n"
|
||||
"distribution or the master distribution on ftp.freebsd.org.");
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
msgNotify("Got INDEX successfully, now building packages menu..");
|
||||
index_init(&top, &plist);
|
||||
@ -505,6 +505,7 @@ configPorts(dialogMenuItem *self)
|
||||
{
|
||||
char *cp, *dist = NULL; /* Shut up compiler */
|
||||
|
||||
dialog_clear();
|
||||
if (!variable_get(VAR_PORTS_PATH))
|
||||
variable_set2(VAR_PORTS_PATH, dist = "/cdrom/ports");
|
||||
while (!directory_exists(dist)) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: index.c,v 1.34 1996/06/12 14:02:06 jkh Exp $
|
||||
* $Id: index.c,v 1.35 1996/06/14 14:33:53 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -132,6 +132,17 @@ new_pkg_node(char *name, node_type type)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static char *
|
||||
strip(char *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; buf[i]; i++)
|
||||
if (buf[i] == '\t' || buf[i] == '\n')
|
||||
buf[i] = ' ';
|
||||
return buf;
|
||||
}
|
||||
|
||||
static IndexEntryPtr
|
||||
new_index(char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *deps)
|
||||
{
|
||||
@ -141,7 +152,7 @@ new_index(char *name, char *pathto, char *prefix, char *comment, char *descr, ch
|
||||
tmp->path = _strdup(pathto);
|
||||
tmp->prefix = _strdup(prefix);
|
||||
tmp->comment = _strdup(comment);
|
||||
tmp->descrfile = _strdup(descr);
|
||||
tmp->descrfile = strip(_strdup(descr));
|
||||
tmp->maintainer = _strdup(maint);
|
||||
tmp->deps = _strdup(deps);
|
||||
return tmp;
|
||||
@ -388,7 +399,7 @@ pkg_checked(dialogMenuItem *self)
|
||||
|
||||
i = index_search(plist, kp->name, NULL) ? TRUE : FALSE;
|
||||
if (kp->type == PACKAGE && plist)
|
||||
return i || (!RunningAsInit && package_exists(kp->name));
|
||||
return i || package_exists(kp->name);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
@ -405,7 +416,7 @@ pkg_fire(dialogMenuItem *self)
|
||||
sp = index_search(plist, kp->name, NULL);
|
||||
/* Not already selected? */
|
||||
if (!sp) {
|
||||
if (RunningAsInit || !package_exists(kp->name)) {
|
||||
if (!package_exists(kp->name)) {
|
||||
PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode));
|
||||
|
||||
*np = *kp;
|
||||
@ -433,6 +444,11 @@ pkg_fire(dialogMenuItem *self)
|
||||
void
|
||||
pkg_selected(dialogMenuItem *self, int is_selected)
|
||||
{
|
||||
PkgNodePtr kp = self->data;
|
||||
|
||||
if (!is_selected || kp->type != PACKAGE)
|
||||
return;
|
||||
msgInfo(kp->desc);
|
||||
}
|
||||
|
||||
int
|
||||
@ -453,7 +469,7 @@ index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll)
|
||||
/* Figure out if this menu is full of "leaves" or "branches" */
|
||||
for (kp = top->kids; kp && kp->name; kp = kp->next) {
|
||||
int len;
|
||||
|
||||
|
||||
++n;
|
||||
if (kp->type == PACKAGE && plist) {
|
||||
hasPackages = TRUE;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: media.c,v 1.41 1996/06/17 21:48:28 jkh Exp $
|
||||
* $Id: media.c,v 1.42 1996/06/17 23:04:22 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -260,6 +260,7 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
char *cp, *hostname, *dir;
|
||||
extern int FtpPort;
|
||||
|
||||
dialog_clear();
|
||||
if (!dmenuOpenSimple(&MenuMediaFTP))
|
||||
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
|
||||
else
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: package.c,v 1.37 1996/05/23 16:34:29 jkh Exp $
|
||||
* $Id: package.c,v 1.38 1996/05/27 22:12:05 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -56,8 +56,16 @@ package_add(char *name)
|
||||
Boolean
|
||||
package_exists(char *name)
|
||||
{
|
||||
int status = vsystem("pkg_info -e %s", name);
|
||||
char fname[FILENAME_MAX];
|
||||
int status /* = vsystem("pkg_info -e %s", name) */;
|
||||
|
||||
/* XXX KLUDGE ALERT! This makes evil assumptions about how XXX
|
||||
* packages register themselves and should *really be done with
|
||||
* `pkg_info -e <name>' except that this it's too slow for an
|
||||
* item check routine.. :-(
|
||||
*/
|
||||
snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name);
|
||||
status = access(fname, R_OK);
|
||||
msgDebug("package check for %s returns %s.\n", name,
|
||||
status ? "failure" : "success");
|
||||
return !status;
|
||||
@ -84,7 +92,6 @@ package_extract(Device *dev, char *name, Boolean depended)
|
||||
vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
|
||||
|
||||
/* Check to make sure it's not already there */
|
||||
msgNotify("Checking for existence of %s package", name);
|
||||
if (package_exists(name))
|
||||
return DITEM_SUCCESS;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user