added error callback, call binary packaging
authormarc <devnull@localhost>
Tue, 19 Dec 1995 21:05:39 +0000 (21:05 +0000)
committermarc <devnull@localhost>
Tue, 19 Dec 1995 21:05:39 +0000 (21:05 +0000)
CVS patchset: 67
CVS date: 1995/12/19 21:05:39

rpm.c

diff --git a/rpm.c b/rpm.c
index 9db4dbd..925730a 100755 (executable)
--- a/rpm.c
+++ b/rpm.c
@@ -2,6 +2,14 @@
 #include "spec.h"
 #include "build.h"
 #include "messages.h"
+#include "pack.h"
+#include "rpmerr.h"
+
+void printerror(void)
+{
+    fprintf(stderr, "ERRORCODE  : %d\n", errCode());
+    fprintf(stderr, "ERRORSTRING: %s\n", errString());
+}
 
 void main(int argc, char **argv)
 {
@@ -9,11 +17,14 @@ void main(int argc, char **argv)
     Spec s;
 
     setVerbosity(MESS_DEBUG);
+    errSetCallback(printerror);
 
     f = fopen(argv[1], "r");
-    s = parseSpec(f);
-    fclose(f);
+    if ((s = parseSpec(f))) {
+       execPrep(s);
+/*     dumpSpec(s); */
+       packageBinaries(s);
+    }
 
-    dumpSpec(s, stdout);
-    execPrep(s);
+    fclose(f);
 }