[PC-BSD Commits] r7039 - pcbsd-projects/txt-sysinstall

svn at pcbsd.org svn at pcbsd.org
Sun Jun 27 01:06:56 PDT 2010


Author: johnh
Date: 2010-06-27 01:06:55 -0700 (Sun, 27 Jun 2010)
New Revision: 7039

Added:
   pcbsd-projects/txt-sysinstall/ftp.c
Modified:
   pcbsd-projects/txt-sysinstall/Makefile
   pcbsd-projects/txt-sysinstall/components.c
   pcbsd-projects/txt-sysinstall/disksel.c
   pcbsd-projects/txt-sysinstall/medium.c
   pcbsd-projects/txt-sysinstall/netif.c
   pcbsd-projects/txt-sysinstall/partsel.c
   pcbsd-projects/txt-sysinstall/txt-sysinstall.h
   pcbsd-projects/txt-sysinstall/tzone.c
   pcbsd-projects/txt-sysinstall/util.c
Log:
Initial work on installing from FTPia.


Modified: pcbsd-projects/txt-sysinstall/Makefile
===================================================================
--- pcbsd-projects/txt-sysinstall/Makefile	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/Makefile	2010-06-27 08:06:55 UTC (rev 7039)
@@ -2,9 +2,9 @@
 
 PROG=	txt-sysinstall
 SRCS=	main.c mainmenu.c disksel.c partsel.c useradd.c netif.c rootpass.c
-SRCS+=	tzone.c components.c util.c install.c medium.c label.c
+SRCS+=	tzone.c components.c util.c install.c medium.c label.c ftp.c
 
-CFLAGS+=	-ggdb -DDEBUG -D__PCBSD__
+CFLAGS+=	-ggdb -DDEBUG -D__PCBSD__ 
 
 WARNS=	3
 

Modified: pcbsd-projects/txt-sysinstall/components.c
===================================================================
--- pcbsd-projects/txt-sysinstall/components.c	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/components.c	2010-06-27 08:06:55 UTC (rev 7039)
@@ -106,7 +106,7 @@
 	    9, 40, 2, -2, menus+2, "", NULL, NULL);
 
 	i = 2;
-	while ((token = strsep(&buf, "\n")) != NULL && strlen(token) > 0 &&
+	while ((token = strsep(&buf, "\n")) != NULL && safe_strlen(token) > 0 &&
 	    i < MAXCOMP) {
 		char *key, *value;
 

Modified: pcbsd-projects/txt-sysinstall/disksel.c
===================================================================
--- pcbsd-projects/txt-sysinstall/disksel.c	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/disksel.c	2010-06-27 08:06:55 UTC (rev 7039)
@@ -63,7 +63,7 @@
 	DMENUF(&menus[i++], "Back", NULL, NULL);
 
 	i = 2;
-	while ((token = strsep(&buf, "\n")) != NULL && strlen(token) > 0 &&
+	while ((token = strsep(&buf, "\n")) != NULL && safe_strlen(token) > 0 &&
 	    i < MAXDISKS+2) {
 		char *disk;
 
@@ -71,7 +71,7 @@
 		disk = strsep(&token, ":");
 		/* trim string and remove '<' and '>' */
 		disk += 2;
-		disk[strlen(disk)-1] = 0;
+		disk[safe_strlen(disk)-1] = 0;
 		menus[i].title = disk;
 		menus[i].fire  = disk_fire;
 		i++;

Modified: pcbsd-projects/txt-sysinstall/medium.c
===================================================================
--- pcbsd-projects/txt-sysinstall/medium.c	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/medium.c	2010-06-27 08:06:55 UTC (rev 7039)
@@ -36,18 +36,22 @@
 
 #define MODULE		"Medium selection"
 
+
 static int
 medium_fire(dialogMenuItem *self)
 {
-	char ftpSite[128] = "http://darkstar.ist.utl.pt/pcbsd/current/i386/netinstall/";
+	//char ftpSite[128] = "http://darkstar.ist.utl.pt/pcbsd/current/i386/netinstall/";
 	appendconfig("installMedium", self->data);
 
 	if (!strcmp(self->data, "ftp")) {
+		dialog_ftp();
+/*
 		screen_clear(MODULE);
 		dialog_inputbox("FTP/HTTP mirror", "Please type the "
 		    "URL where to fetch the archives from:",
 		    8, 70, ftpSite);
 		appendconfig("ftpPath", ftpSite);
+*/
 	}
 
 	return (0);

Modified: pcbsd-projects/txt-sysinstall/netif.c
===================================================================
--- pcbsd-projects/txt-sysinstall/netif.c	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/netif.c	2010-06-27 08:06:55 UTC (rev 7039)
@@ -93,7 +93,7 @@
 	status = run_pcsysinstall(buf, BUFSZ, "detect-nics", NULL);
 	menus = safe_malloc(sizeof(*menus)*MAXNETIFS);
 
-	while ((token = strsep(&buf, "\n")) != NULL && strlen(token) > 0 &&
+	while ((token = strsep(&buf, "\n")) != NULL && safe_strlen(token) > 0 &&
 	    i < MAXNETIFS) {
 		char *net;
 
@@ -101,7 +101,7 @@
 		net = strsep(&token, ":");
 		/* trim string and remove '<' and '>' */
 		net += 2;
-		net[strlen(net)-1] = 0;
+		net[safe_strlen(net)-1] = 0;
 		menus[i].title = net;
 		menus[i].fire = netif_fire;
 		i++;

Modified: pcbsd-projects/txt-sysinstall/partsel.c
===================================================================
--- pcbsd-projects/txt-sysinstall/partsel.c	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/partsel.c	2010-06-27 08:06:55 UTC (rev 7039)
@@ -89,7 +89,7 @@
 	menus[0].prompt = "Next";
 	menus[1].prompt = "Back";
 	i = 2;
-	while ((token = strsep(&buf, "\n")) != NULL && strlen(token) > 0 &&
+	while ((token = strsep(&buf, "\n")) != NULL && safe_strlen(token) > 0 &&
 	    i < MAXPARTS-1) {
 		char *part, *type, *value;
 

Modified: pcbsd-projects/txt-sysinstall/txt-sysinstall.h
===================================================================
--- pcbsd-projects/txt-sysinstall/txt-sysinstall.h	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/txt-sysinstall.h	2010-06-27 08:06:55 UTC (rev 7039)
@@ -31,7 +31,7 @@
 #endif
 
 #define SCRIPTS_PATH	"./"
-#define PCSYSINSTALL	"/pc-sysinstall"
+#define PCSYSINSTALL	"/usr/sbin/pc-sysinstall"
 
 #define	BUFSZ	1024*1024
 
@@ -64,6 +64,7 @@
 void		dialog_components(void);
 void		dialog_medium(void);
 void		dialog_label(int);
+void		dialog_ftp(void);
 void		do_install(void);
 
 /* utility functions */

Modified: pcbsd-projects/txt-sysinstall/tzone.c
===================================================================
--- pcbsd-projects/txt-sysinstall/tzone.c	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/tzone.c	2010-06-27 08:06:55 UTC (rev 7039)
@@ -70,7 +70,7 @@
 	status = run_pcsysinstall(buf, BUFSZ, "list-tzones", NULL);
 	menus = safe_malloc(sizeof(*menus)*MAXTZONES);
 
-	while ((token = strsep(&buf, "\n")) != NULL && strlen(token) > 0 &&
+	while ((token = strsep(&buf, "\n")) != NULL && safe_strlen(token) > 0 &&
 	    i < MAXTZONES) {
 
 		DMENUF(&menus[i++], strsep(&token, "/"), token, tzone_fire);

Modified: pcbsd-projects/txt-sysinstall/util.c
===================================================================
--- pcbsd-projects/txt-sysinstall/util.c	2010-06-27 01:38:59 UTC (rev 7038)
+++ pcbsd-projects/txt-sysinstall/util.c	2010-06-27 08:06:55 UTC (rev 7039)
@@ -144,7 +144,7 @@
 	draw_shadow(stdscr, (LINES - height) / 2, (COLS - width) / 2,
 	    height, width);
 	attron(dialog_attr);
-	mvprintw(LINES / 2 - 1, COLS / 2 - strlen(str) / 2, str);
+	mvprintw(LINES / 2 - 1, COLS / 2 - safe_strlen(str) / 2, str);
 	dialog_update();
 }
 



More information about the Commits mailing list