Branch: master

cfa9446f 2014-11-20 10:36:29 Timothy Pearson
Use compressed-ppd:<database name>:<ppd name> as compressed PPD URI
M tdeprint/cups/make_driver_db_cups.c
diff --git a/tdeprint/cups/make_driver_db_cups.c b/tdeprint/cups/make_driver_db_cups.c
index bba9adc..0a01602 100644
--- a/tdeprint/cups/make_driver_db_cups.c
+++ b/tdeprint/cups/make_driver_db_cups.c
@@ -164,7 +164,18 @@
 					char * pos2 = strstr(pos1 + 1, "\"");
 					if (pos2 >= 0) {
 						*pos2 = 0;
-						addFile(line+1, dirname);
+						char * pos3 = strstr(pos1 + 1, ":");
+						if (pos3 >= 0) {
+							char *ppduri;
+							int n2 = strlen("compressed-ppd:")+strlen(pos3+1);
+							ppduri = (char*)malloc(n2*sizeof(char)+1);
+							memset(ppduri,0,n2);
+							strcat(ppduri, "compressed-ppd:");
+							strcat(ppduri, pos3+1);
+							addFile(ppduri, dirname);
+							free(ppduri);
+							ppduri = NULL;
+						}
 					}
 				}
 			}
@@ -232,7 +243,7 @@
 		size_t len = 0;
 		ssize_t read;
 
-		fprintf(output_file,"FILE=foomatic-db-compressed-ppds:%s\n",ppdfilename);
+		fprintf(output_file,"FILE=compressed-ppd:%s:%s\n", origin, ppdfilename);
 
 		while ((read = getline(&line, &len, file)) != -1) {
 			PROCESS_PPD_FILE_CONTENTS
@@ -257,7 +268,7 @@
 int main(int argc, char *argv[])
 {
 	registerHandler("ppd:", initPpd, parsePpdFile);
-	registerHandler("foomatic-db-compressed-ppds:", initPpd, parseCompressedPpdFile);
+	registerHandler("compressed-ppd:", initPpd, parseCompressedPpdFile);
 	initFoomatic();
 	return execute(argc, argv);
 }