Better deal with non-mounted workspaces
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 12 Jun 2014 14:25:04 +0000 (14:25 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 12 Jun 2014 14:25:04 +0000 (14:25 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@7054 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.rpmfactory/src/main/java/org/argeo/slc/rpmfactory/core/RpmFactoryImpl.java

index 3ab7e7df255c8754bbc11b4aa7972be341dfcd68..4d5df3bd40dd5bbbc2030d7a6f57fd9e1a6b6295 100644 (file)
@@ -134,20 +134,24 @@ public class RpmFactoryImpl implements RpmFactory {
                        for (String arch : archs) {
                                Node archFolder = JcrUtils.mkfolders(session, "/" + arch);
                                session.save();
-                               if (!archFolder.hasNode("repodata")) {
-                                       File workspaceDir = getWorkspaceDir(workspace);
-                                       // touch a file in order to make sue this is properly
-                                       // mounted.
-                                       File touch = new File(workspaceDir, ".touch");
-                                       touch.createNewFile();
-                                       touch.delete();
-
-                                       SystemCall createrepo = new SystemCall();
-                                       createrepo.arg("createrepo");
-                                       createrepo.arg("-q");
-                                       File archDir = new File(workspaceDir, arch);
-                                       createrepo.arg(archDir.getAbsolutePath());
-                                       createrepo.run();
+                               File workspaceDir = getWorkspaceDir(workspace);
+                               try {
+                                       if (!archFolder.hasNode("repodata")) {
+                                               // touch a file in order to make sure this is properly
+                                               // mounted.
+                                               File touch = new File(workspaceDir, ".touch");
+                                               touch.createNewFile();
+                                               touch.delete();
+
+                                               SystemCall createrepo = new SystemCall();
+                                               createrepo.arg("createrepo");
+                                               createrepo.arg("-q");
+                                               File archDir = new File(workspaceDir, arch);
+                                               createrepo.arg(archDir.getAbsolutePath());
+                                               createrepo.run();
+                                       }
+                               } catch (IOException e) {
+                                       log.error(workspaceDir + " not properly mounted.", e);
                                }
                        }
                } catch (Exception e) {