[Frugalware-darcs] setup-current: select: new function: fw_select()

VMiklos vmiklos at frugalware.org
Thu Mar 16 18:08:00 CET 2006


[select: new function: fw_select()
VMiklos <vmiklos at frugalware.org>**20051117191204] {
hunk ./src/plugins/select.c 235
-		g_strdup_printf(("Please select which categories to install from the %s section:"), category),
+		g_strdup_printf(("Please select packages to install from the %s section:"), category),
hunk ./src/plugins/select.c 311
+#ifdef FINAL
hunk ./src/plugins/select.c 314
+#else
+				catlist = g_list_append(catlist,
+					"   ");
+#endif
hunk ./src/plugins/select.c 336
-		_("Please select which categories to install:"),
+		repo ? _("Please select which extra categories to install:") :
+		_("Please select which frugalware categories to install:"),
hunk ./src/plugins/select.c 347
+	int extra=0;
+#ifdef FINAL
hunk ./src/plugins/select.c 350
+#endif
hunk ./src/plugins/select.c 352
-	pacbindir = g_strdup_printf("%s/frugalware-%s", SOURCEDIR, ARCH);
+	if((!strcmp(repo, "extra"))||(!strcmp(repo, "extra-current")))
+		extra=1;
+	if(!extra)
+		pacbindir = g_strdup_printf("%s/frugalware-%s",
+			SOURCEDIR, ARCH);
+	else
+		pacbindir = g_strdup_printf("%s/extra/frugalware-%s",
+			SOURCEDIR, ARCH);
hunk ./src/plugins/select.c 377
-			if((!strcmp(repo, "frugalware"))||(!strcmp(repo, "frugalware-current")))
+			if(!extra)
hunk ./src/plugins/select.c 399
-int run(GList **config)
+int fw_select(char *repo, GList **config, int selpkgc)
hunk ./src/plugins/select.c 401
-	int i, selpkgc;
+	int i, extra=0;
hunk ./src/plugins/select.c 405
-	chdir(TARGETDIR);
+	if((!strcmp(repo, "extra"))||(!strcmp(repo, "extra-current")))
+		extra=1;
hunk ./src/plugins/select.c 408
-	prepare_pkgdb(PACCONF, config);
-	dialog_vars.backtitle=gen_backtitle(_("Selecting packages"));
-	selpkgc = selpkg_confirm();
-	cats = selcat(0);
+	if(!extra)
+	{
+		prepare_pkgdb(PACCONF, config);
+		prepare_pkgdb(PACEXCONF, config);
+		dialog_vars.backtitle=gen_backtitle(_("Selecting frugalware "
+			"packages"));
+		cats = selcat(0);
+	}
+	else
+	{
+		dialog_vars.backtitle=gen_backtitle(_("Selecting extra "
+			"packages"));
+		cats = selcat(1);
+	}
hunk ./src/plugins/select.c 438
-	data_put(config, "packages", allpkgs);
+	if(!extra)
+		data_put(config, "packages", allpkgs);
+	else
+		data_put(config, "expackages", allpkgs);
+	return(0);
+}
+int run(GList **config)
+{
+	int selpkgc;
+
+	selpkgc = selpkg_confirm();
+	chdir(TARGETDIR);
+	fw_select("frugalware", config, selpkgc);
+	fw_select("extra", config, selpkgc);
}


More information about the Frugalware-darcs mailing list