Tags: patch

Here's a patch that fixes the issue.

-- 
Benoît Knecht
diff --git a/qemubuilder.c b/qemubuilder.c
index eec8afa..dab9cbb 100755
--- a/qemubuilder.c
+++ b/qemubuilder.c
@@ -800,6 +800,14 @@ int cpbuilder_build(const struct pbuilderconfig* pc, const char* dscfile)
 
   const char* buildopt="--binary-all"; /* TODO: add --binary-arch option */
 
+  /* Make sure we'll be able to copy the built package to pc->buildresult. */
+  if (mkdir(pc->buildresult,0777))
+    {
+      /* could not create the buildresult here. */
+      perror("mkdir");
+      goto out;
+    }
+
   hoststr=copy_dscfile(dscfile, pc->buildplace);
 
   asprintf(&commandline,
@@ -826,6 +834,7 @@ int cpbuilder_build(const struct pbuilderconfig* pc, const char* dscfile)
      hoststr,
      hoststr2);
 
+ out:
   if(hoststr2) free(hoststr2);
   if(hoststr) free(hoststr);
   if(commandline) free(commandline);

Reply via email to