SF.net SVN: morphix: [2365] trunk/mmaker/src

[email protected] Thu, 20 Jul 2006 14:44:40 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2365
Author:   alextreme
Date:     2006-07-20 14:44:32 -0700 (Thu, 20 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/morphix/?rev=2365&view=rev

Log Message:
-----------
  * adding fallback options for apt-get source (if an archive is not found, ie. binary-only repositories)

Modified Paths:
--------------
    trunk/mmaker/libmorphix/makemodule.c
    trunk/mmaker/src/main.c
    trunk/mmaker/templates/lightgui.xml
Modified: trunk/mmaker/libmorphix/makemodule.c
===================================================================
--- trunk/mmaker/libmorphix/makemodule.c	2006-07-20 11:57:40 UTC (rev 2364)
+++ trunk/mmaker/libmorphix/makemodule.c	2006-07-20 21:44:32 UTC (rev 2365)
@@ -1213,18 +1213,19 @@
 	gchar **buf_array = NULL;
 
 	gint count = 5; // skip first 5 lines of dpkg -l
-
+	fprintf(stderr,"Info: In getAptPackageSources\n");
 	if (sources_location == NULL) { // no sources wanted
 		return TRUE;
 	}
 
+	fprintf(stderr,"Info: making /sources directory\n");	
 	cmdline = g_strdup_printf("%s/sources", module->dirname);
 	if (mkdir(cmdline,0755) != 0) {
 		g_free(cmdline);
 		return FALSE;
 	}
 	g_free(cmdline);
-
+	fprintf(stderr,"Info: Retrieving dpkg -l\n");
 	/** 
 	    Why via dpkg -l? Well, we also want to download
 	    the source to all dependancies, module->packagelist
@@ -1236,14 +1237,16 @@
 	g_free(cmdline);
 	buf_array = g_strsplit(stdinput,"\n",0);
 
+	fprintf(stderr,"Info: Parsing dpkg -l\n");
 	/** Each line looks like: XXX  packagename version description */
 
 	while(buf_array[count] != NULL) {
 		if (buf_array[count][0] == 'i') { // package installed
 			gchar packagename[160] = "";
 			gint ret = sscanf(buf_array[count],"ii  %159s",packagename);
+			fprintf(stderr,"Info: Downloading sources for package %s\n", packagename);
 			if (ret > 0) {
-				cmdline = g_strdup_printf("%s %s cd /sources && apt-get --download-only source %s",P_CHROOT, module->dirname, packagename);
+				cmdline = g_strdup_printf("%s %s sh -c \"cd /sources && apt-get -f -m --download-only source %s\"",P_CHROOT, module->dirname, packagename);
 				ExecuteCommand(cmdline);
 				g_free(cmdline);
 			}

Modified: trunk/mmaker/src/main.c
===================================================================
--- trunk/mmaker/src/main.c	2006-07-20 11:57:40 UTC (rev 2364)
+++ trunk/mmaker/src/main.c	2006-07-20 21:44:32 UTC (rev 2365)
@@ -82,7 +82,7 @@
 		return(EXIT_FAILURE);
 	}
 	
-	while ((optchar = getopt(argc,argv,"t:d:g:b:k:m:p:icv")) != -1) {
+	while ((optchar = getopt(argc,argv,"t:d:g:b:k:m:p:s:icv")) != -1) {
 	  switch (optchar) {
 	  case 't':
 		  // set temporary directory

Modified: trunk/mmaker/templates/lightgui.xml
===================================================================


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV