Index: src/distrib/utils/sysinst/defs.h
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/defs.h,v
retrieving revision 1.155
diff -u -r1.155 defs.h
--- src/distrib/utils/sysinst/defs.h	4 Nov 2011 11:27:00 -0000	1.155
+++ src/distrib/utils/sysinst/defs.h	26 Dec 2011 10:57:57 -0000
@@ -122,6 +122,13 @@
     SET_MD_2,		/* Machine dependent set */
     SET_MD_3,		/* Machine dependent set */
     SET_MD_4,		/* Machine dependent set */
+    
+    /* Source sets */
+    SET_SYSSRC,
+    SET_SRC,
+    SET_SHARESRC,
+    SET_GNUSRC,
+    SET_XSRC,
 
     SET_LAST,
     SET_GROUP,		/* Start of submenu */
@@ -144,6 +151,9 @@
 /* All machine dependent sets */
 #define SET_MD SET_MD_1, SET_MD_2, SET_MD_3, SET_MD_4
 
+/* All source sets */
+#define SET_SOURCE SET_SYSSRC, SET_SRC, SET_SHARESRC, SET_GNUSRC, SET_XSRC
+
 /* Set list flags */
 #define SFLAG_MINIMAL	1
 #define	SFLAG_NOX	2
@@ -280,11 +290,17 @@
 #define SYSINST_FTP_DIR		"pub/NetBSD/NetBSD-" REL
 #endif
 
-/* Abs. path we extract from */
-char ext_dir[STRSIZE];
+/* Abs. path we extract binary sets from */
+char ext_dir_bin[STRSIZE];
+
+/* Abs. path we extract source sets from */
+char ext_dir_src[STRSIZE];
+
+/* Place we look for binary sets in all fs types */
+char set_dir_bin[STRSIZE];
 
-/* Place we look in all fs types */
-char set_dir[STRSIZE];
+/* Place we look for source sets in all fs types */
+char set_dir_src[STRSIZE];
 
 struct {
     char host[STRSIZE];
@@ -429,6 +445,9 @@
 void	init_set_status(int);
 void	customise_sets(void);
 void	umount_mnt2(void);
+int 	set_is_source(const char *);
+const char *set_dir_for_set(const char *);
+const char *ext_dir_for_set(const char *);
 
 /* from target.c */
 #if defined(DEBUG)  ||	defined(DEBUG_ROOT)
Index: src/distrib/utils/sysinst/main.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/main.c,v
retrieving revision 1.61
diff -u -r1.61 main.c
--- src/distrib/utils/sysinst/main.c	16 Sep 2011 15:42:28 -0000	1.61
+++ src/distrib/utils/sysinst/main.c	26 Dec 2011 10:57:57 -0000
@@ -82,10 +82,12 @@
 	{"release", REL, rel, sizeof rel},
 	{"machine", MACH, machine, sizeof machine},
 	{"xfer dir", "/usr/INSTALL", xfer_dir, sizeof xfer_dir},
-	{"ext dir", "", ext_dir, sizeof ext_dir},
+	{"ext dir", "", ext_dir_bin, sizeof ext_dir_bin},
+	{"ext src dir", "", ext_dir_src, sizeof ext_dir_src},
 	{"ftp host", SYSINST_FTP_HOST, ftp.host, sizeof ftp.host},
 	{"ftp dir", SYSINST_FTP_DIR, ftp.dir, sizeof ftp.dir},
-	{"ftp prefix", "/" MACH "/binary/sets", set_dir, sizeof set_dir},
+	{"ftp prefix", "/" MACH "/binary/sets", set_dir_bin, sizeof set_dir_bin},
+	{"ftp src prefix", "/source/sets", set_dir_src, sizeof set_dir_src},
 	{"ftp user", "ftp", ftp.user, sizeof ftp.user},
 	{"ftp pass", "", ftp.pass, sizeof ftp.pass},
 	{"ftp proxy", "", ftp.proxy, sizeof ftp.proxy},
Index: src/distrib/utils/sysinst/menus.mi
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/menus.mi,v
retrieving revision 1.43
diff -u -r1.43 menus.mi
--- src/distrib/utils/sysinst/menus.mi	30 Oct 2011 00:30:56 -0000	1.43
+++ src/distrib/utils/sysinst/menus.mi	26 Dec 2011 10:57:57 -0000
@@ -246,8 +246,10 @@
 		action { src_prompt(MSG_Host, ftp.host, sizeof ftp.host); };
 	option {src_legend(menu, MSG_Base_dir, ftp.dir);},
 		action { src_prompt(MSG_Base_dir, ftp.dir, sizeof ftp.dir); };
-	option {src_legend(menu, MSG_Set_dir, set_dir);},
-		action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); };
+	option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
+		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
+	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
+		action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
 	option {src_legend(menu, MSG_User, ftp.user);},
 		action { src_prompt(MSG_User, ftp.user, sizeof ftp.user);
 			ftp.pass[0] = 0;
@@ -286,8 +288,10 @@
 		action { src_prompt(MSG_Host, nfs_host, sizeof nfs_host); };
 	option {src_legend(menu, MSG_Base_dir, nfs_dir);},
 		action { src_prompt(MSG_Base_dir, nfs_dir, sizeof nfs_dir); };
-	option {src_legend(menu, MSG_Set_dir, set_dir);},
-		action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); };
+	option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
+		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
+	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
+		action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
 
 menu fdremount, title MSG_What_do_you_want_to_do;
 	option MSG_Try_again, exit, action { *(int *)arg = SET_CONTINUE; };
@@ -322,8 +326,10 @@
 	display action { msg_display_add(MSG_cdromsource); };
 	option {src_legend(menu, MSG_Device, cdrom_dev);},
 		action { src_prompt(MSG_dev, cdrom_dev, sizeof cdrom_dev); };
-	option {src_legend(menu, MSG_Set_dir, set_dir);},
-		action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); };
+	option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
+		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
+	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
+		action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
 
 menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 	display action { msg_display(MSG_localfssource); };
@@ -333,15 +339,19 @@
 		action { src_prompt(MSG_filesys, localfs_fs, sizeof localfs_fs); };
 	option {src_legend(menu, MSG_Base_dir, localfs_dir);},
 		action { src_prompt(MSG_Base_dir, localfs_dir, sizeof localfs_dir);};
-	option {src_legend(menu, MSG_Set_dir, set_dir);},
-		action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); };
+	option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
+		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
+	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
+		action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
 
 menu localdirsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 	display action { msg_display(MSG_localdir); };
 	option {src_legend(menu, MSG_Base_dir, localfs_dir);},
 		action { src_prompt(MSG_Base_dir, localfs_dir, 60); };
-	option {src_legend(menu, MSG_Set_dir, set_dir);},
-		action { src_prompt(MSG_Set_dir, set_dir, 60); };
+	option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
+		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, 60); };
+	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
+		action { src_prompt(MSG_Set_dir_src, set_dir_src, 60); };
 
 menu namesrv6, title MSG_Select_IPv6_DNS_server;
 	option "google-public-dns-a.google.com", exit, action
Index: src/distrib/utils/sysinst/msg.mi.de
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/msg.mi.de,v
retrieving revision 1.57
diff -u -r1.57 msg.mi.de
--- src/distrib/utils/sysinst/msg.mi.de	17 Apr 2011 12:33:42 -0000	1.57
+++ src/distrib/utils/sysinst/msg.mi.de	26 Dec 2011 10:57:57 -0000
@@ -829,6 +829,24 @@
 message set_X11_prog
 {X11 Programmierung}
 
+message set_source
+{Quelltext Sets}
+
+message set_syssrc
+{Kernel Quelltext}
+
+message set_src
+{Basis Quelltext}
+
+message set_sharesrc
+{Share Quelltext}
+
+message set_gnusrc
+{GNU Quelltext}
+
+message set_xsrc
+{X11 Quelltext}
+
 message cur_distsets_row
 {%-27s %3s}
 
@@ -966,7 +984,8 @@
 message hidden {** versteckt **}
 message Host {Host}
 message Base_dir {Basispfad}
-message Set_dir {Verzeichnis}
+message Set_dir_bin {Verzeichnis Binär-sets}
+message Set_dir_src {Verzeichnis Quelltext-sets}
 message Xfer_dir {Zwischenspeicher}
 message User {Benutzer}
 message Password {Passwort}
Index: src/distrib/utils/sysinst/msg.mi.en
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/msg.mi.en,v
retrieving revision 1.165
diff -u -r1.165 msg.mi.en
--- src/distrib/utils/sysinst/msg.mi.en	17 Apr 2011 12:33:42 -0000	1.165
+++ src/distrib/utils/sysinst/msg.mi.en	26 Dec 2011 10:57:57 -0000
@@ -769,6 +769,24 @@
 message set_X11_prog
 {X11 programming}
 
+message set_source
+{Source sets}
+
+message set_syssrc
+{Kernel sources}
+
+message set_src
+{Base sources}
+
+message set_sharesrc
+{Share sources}
+
+message set_gnusrc
+{GNU sources}
+
+message set_xsrc
+{X11 sources}
+
 message cur_distsets_row
 {%-27s %3s}
 
@@ -906,7 +924,8 @@
 message hidden {** hidden **}
 message Host {Host}
 message Base_dir {Base directory}
-message Set_dir {Set directory}
+message Set_dir_bin {Binary set directory}
+message Set_dir_src {Source set directory}
 message Xfer_dir {Transfer directory}
 message User {User}
 message Password {Password}
Index: src/distrib/utils/sysinst/msg.mi.es
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/msg.mi.es,v
retrieving revision 1.35
diff -u -r1.35 msg.mi.es
--- src/distrib/utils/sysinst/msg.mi.es	17 Apr 2011 12:33:42 -0000	1.35
+++ src/distrib/utils/sysinst/msg.mi.es	26 Dec 2011 10:57:57 -0000
@@ -792,6 +792,24 @@
 message set_X11_prog
 {Programación de X11}
 
+message set_source
+{Source sets}
+
+message set_syssrc
+{Kernel sources}
+
+message set_src
+{Base sources}
+
+message set_sharesrc
+{Share sources}
+
+message set_gnusrc
+{GNU sources}
+
+message set_xsrc
+{X11 sources}
+
 message cur_distsets_row
 {%-27s %3s}
 
@@ -931,7 +949,8 @@
 message hidden {** oculto **}
 message Host {Máquina}
 message Base_dir {Directorio base}
-message Set_dir {Directorio de conjuntos}
+message Set_dir_src {Directorio de conjuntos binary} /* fix XLAT */
+message Set_dir_bin {Directorio de conjuntos source} /* fix XLAT */
 message Xfer_dir {Directorio a transferir a}
 message User {Usuario}
 message Password {Contraseña}
Index: src/distrib/utils/sysinst/msg.mi.fr
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/msg.mi.fr,v
retrieving revision 1.115
diff -u -r1.115 msg.mi.fr
--- src/distrib/utils/sysinst/msg.mi.fr	17 Apr 2011 12:33:42 -0000	1.115
+++ src/distrib/utils/sysinst/msg.mi.fr	26 Dec 2011 10:57:58 -0000
@@ -842,6 +842,24 @@
 message set_X11_prog
 {X11 développement}
 
+message set_source
+{Source sets}
+
+message set_syssrc
+{Kernel sources}
+
+message set_src
+{Base sources}
+
+message set_sharesrc
+{Share sources}
+
+message set_gnusrc
+{GNU sources}
+
+message set_xsrc
+{X11 sources}
+
 message cur_distsets_row
 {%-33s %3s}
 
@@ -998,7 +1016,8 @@
 message hidden {** caché **}
 message Host {Serveur FTP}
 message Base_dir {Répertoire de base}
-message Set_dir {Répertoire des composants}
+message Set_dir_bin {Répertoire des composants binaire}
+message Set_dir_src {Répertoire des composants source}
 message Xfer_dir {Répertoire de transfert}
 message User {Utilisateur}
 message Password {Mot de passe}
Index: src/distrib/utils/sysinst/msg.mi.pl
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/msg.mi.pl,v
retrieving revision 1.74
diff -u -r1.74 msg.mi.pl
--- src/distrib/utils/sysinst/msg.mi.pl	17 Apr 2011 12:33:42 -0000	1.74
+++ src/distrib/utils/sysinst/msg.mi.pl	26 Dec 2011 10:57:58 -0000
@@ -767,6 +767,24 @@
 message set_X11_prog
 {Programowanie X11}
 
+message set_source
+{Source sets}
+
+message set_syssrc
+{Kernel sources}
+
+message set_src
+{Base sources}
+
+message set_sharesrc
+{Share sources}
+
+message set_gnusrc
+{GNU sources}
+
+message set_xsrc
+{X11 sources}
+
 message cur_distsets_row
 {%-30s %3s}
 
@@ -900,7 +918,8 @@
 message hidden {** ukryte **}
 message Host {Host}
 message Base_dir {Katalog}
-message Set_dir {Katalog}
+message Set_dir_src {Katalog pakiet binary} /* fix XLAT */
+message Set_dir_bin {Katalog pakiet source} /* fix XLAT */
 message Xfer_dir {Transfer Katalog} /* fix XLAT */
 message User {Uzytkownik}
 message Password {Haslo}
Index: src/distrib/utils/sysinst/net.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/net.c,v
retrieving revision 1.127
diff -u -r1.127 net.c
--- src/distrib/utils/sysinst/net.c	4 Apr 2011 08:30:13 -0000	1.127
+++ src/distrib/utils/sysinst/net.c	26 Dec 2011 10:57:58 -0000
@@ -945,7 +945,8 @@
 	const char *ftp_opt;
 	char ftp_user_encoded[STRSIZE];
 	char ftp_dir_encoded[STRSIZE];
-	char *cp, *set_dir2;
+	char *cp;
+	const char *set_dir2;
 	int rval;
 
 	/*
@@ -981,7 +982,7 @@
 	if (cp != ftp_dir_encoded && cp[-1] != '/')
 		*cp++ = '/';
 
-	set_dir2 = set_dir;
+	set_dir2 = set_dir_for_set(set_name);
 	while (*set_dir2 == '/')
 		++set_dir2;
 
@@ -1031,7 +1032,9 @@
 	/* We'll fetch each file just before installing it */
 	fetch_fn = ftp_fetch;
 	ftp.xfer_type = xfer_type;
-	snprintf(ext_dir, sizeof ext_dir, "%s/%s", target_prefix(),
+	snprintf(ext_dir_bin, sizeof ext_dir_bin, "%s/%s", target_prefix(),
+	    xfer_dir + (*xfer_dir == '/'));
+	snprintf(ext_dir_src, sizeof ext_dir_src, "%s/%s", target_prefix(),
 	    xfer_dir + (*xfer_dir == '/'));
 
 	return SET_OK;
@@ -1046,9 +1049,10 @@
 		return SET_RETRY;
 
 	/* If root is on NFS and we have sets, skip this step. */
-	if (statvfs(set_dir, &sb) == 0 &&
+	if (statvfs(set_dir_bin, &sb) == 0 &&
 	    strcmp(sb.f_fstypename, "nfs") == 0) {
-	    	strlcpy(ext_dir, set_dir, sizeof ext_dir);
+	    	strlcpy(ext_dir_bin, set_dir_bin, sizeof ext_dir_bin);
+	    	strlcpy(ext_dir_src, set_dir_src, sizeof ext_dir_src);
 		return SET_OK;
 	}
 
@@ -1062,7 +1066,8 @@
 
 	mnt2_mounted = 1;
 
-	snprintf(ext_dir, sizeof ext_dir, "/mnt2/%s", set_dir);
+	snprintf(ext_dir_bin, sizeof ext_dir_bin, "/mnt2/%s", set_dir_bin);
+	snprintf(ext_dir_src, sizeof ext_dir_src, "/mnt2/%s", set_dir_src);
 
 	/* return location, don't clean... */
 	return SET_OK;
Index: src/distrib/utils/sysinst/util.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/util.c,v
retrieving revision 1.170
diff -u -r1.170 util.c
--- src/distrib/utils/sysinst/util.c	17 Oct 2011 16:35:22 -0000	1.170
+++ src/distrib/utils/sysinst/util.c	26 Dec 2011 10:57:58 -0000
@@ -68,7 +68,7 @@
 #define MD_SETS_SELECTED_NOX SET_KERNEL_1, SET_SYSTEM, SET_MD
 #endif
 #ifndef MD_SETS_VALID
-#define MD_SETS_VALID SET_KERNEL, SET_SYSTEM, SET_X11, SET_MD
+#define MD_SETS_VALID SET_KERNEL, SET_SYSTEM, SET_X11, SET_MD, SET_SOURCE
 #endif
 
 #define MAX_CD_DEVS	256	/* how many cd drives do we expect to attach */
@@ -150,6 +150,14 @@
 	{SET_MD_4_NAME,		SET_MD_4,		MSG_set_md_4, NULL},
 #endif
 
+	{NULL,			SET_GROUP,		MSG_set_source, NULL},
+	{"syssrc",		SET_SYSSRC,		MSG_set_syssrc, NULL},
+	{"src",			SET_SRC,		MSG_set_src, NULL},
+	{"sharesrc",		SET_SHARESRC,		MSG_set_sharesrc, NULL},
+	{"gnusrc",		SET_GNUSRC,		MSG_set_gnusrc, NULL},
+	{"xsrc",		SET_XSRC,		MSG_set_xsrc, NULL},
+	{NULL,			SET_GROUP_END,		NULL, NULL},
+
 	{NULL,			SET_LAST,		NULL, NULL},
 };
 
@@ -357,7 +365,8 @@
 	fetch_fn = floppy_fetch;
 
 	/* Set ext_dir for absolute path. */
-	snprintf(ext_dir, sizeof ext_dir, "%s/%s", target_prefix(), xfer_dir);
+	snprintf(ext_dir_bin, sizeof ext_dir_bin, "%s/%s", target_prefix(), xfer_dir);
+	snprintf(ext_dir_src, sizeof ext_dir_src, "%s/%s", target_prefix(), xfer_dir);
 
 	return SET_OK;
 }
@@ -473,8 +482,9 @@
 
 	mnt2_mounted = 1;
 
-	snprintf(ext_dir, sizeof ext_dir, "%s/%s", "/mnt2", set_dir);
-	return dir_exists_p(ext_dir);
+	snprintf(ext_dir_bin, sizeof ext_dir_bin, "%s/%s", "/mnt2", set_dir_bin);
+	snprintf(ext_dir_src, sizeof ext_dir_src, "%s/%s", "/mnt2", set_dir_src);
+	return dir_exists_p(ext_dir_bin);
 }
 
 
@@ -520,10 +530,11 @@
 	bool silent = false;
 
 	/* If root is a CD-ROM and we have sets, skip this step. */
-	if (statvfs(set_dir, &sb) == 0 &&
+	if (statvfs(set_dir_bin, &sb) == 0 &&
 	    (strcmp(sb.f_fstypename, MOUNT_CD9660) == 0
 		    || strcmp(sb.f_fstypename, MOUNT_UDF) == 0)) {
-	    	strlcpy(ext_dir, set_dir, sizeof ext_dir);
+	    	strlcpy(ext_dir_bin, set_dir_bin, sizeof ext_dir_bin);
+	    	strlcpy(ext_dir_src, set_dir_src, sizeof ext_dir_src);
 		return SET_OK;
 	}
 
@@ -593,8 +604,10 @@
 
 	mnt2_mounted = 1;
 
-	snprintf(ext_dir, sizeof ext_dir, "%s/%s/%s",
-		"/mnt2", localfs_dir, set_dir);
+	snprintf(ext_dir_bin, sizeof ext_dir_bin, "%s/%s/%s",
+		"/mnt2", localfs_dir, set_dir_bin);
+	snprintf(ext_dir_src, sizeof ext_dir_src, "%s/%s/%s",
+		"/mnt2", localfs_dir, set_dir_src);
 
 	return SET_OK;
 }
@@ -614,7 +627,8 @@
 	 * We have to have an absolute path ('cos pax runs in a
 	 * different directory), make it so.
 	 */
-	snprintf(ext_dir, sizeof ext_dir, "/%s/%s", localfs_dir, set_dir);
+	snprintf(ext_dir_bin, sizeof ext_dir_bin, "/%s/%s", localfs_dir, set_dir_bin);
+	snprintf(ext_dir_src, sizeof ext_dir_src, "/%s/%s", localfs_dir, set_dir_src);
 
 	return SET_OK;
 }
@@ -856,7 +870,7 @@
 		make_target_dir(xfer_dir);
 
 	(void)snprintf(path, sizeof path, "%s/%s%s",
-	    ext_dir, dist->name, dist_postfix);
+	    ext_dir_for_set(dist->name), dist->name, dist_postfix);
 
 	owd = getcwd(NULL, 0);
 
@@ -876,7 +890,7 @@
 	 * characters and check again
 	 */
 	(void)snprintf(path, sizeof path, "%s/%.8s%.4s", /* 4 as includes '.' */
-	    ext_dir, dist->name, dist_postfix);
+	    ext_dir_for_set(dist->name), dist->name, dist_postfix);
 		if (!file_exists_p(path)) {
 #endif /* SUPPORT_8_3_SOURCE_FILESYSTEM */
 
@@ -1480,3 +1494,20 @@
 	return 0;
 #endif
 }
+
+int
+set_is_source(const char *set_name) {
+	int len = strlen(set_name);
+	return len >= 3 && memcmp(set_name + len - 3, "src", 3) == 0;
+}
+
+const char *
+set_dir_for_set(const char *set_name) {
+	return set_is_source(set_name) ? set_dir_src : set_dir_bin;
+}
+
+const char *
+ext_dir_for_set(const char *set_name) {
+	return set_is_source(set_name) ? ext_dir_src : ext_dir_bin;
+}
+
