From ebd22c6b6ffbcb564eee7bab85af3200d2c0d519 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Thu, 12 Jun 2014 14:25:04 +0000 Subject: [PATCH] Better deal with non-mounted workspaces git-svn-id: https://svn.argeo.org/slc/trunk@7054 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../slc/rpmfactory/core/RpmFactoryImpl.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/runtime/org.argeo.slc.rpmfactory/src/main/java/org/argeo/slc/rpmfactory/core/RpmFactoryImpl.java b/runtime/org.argeo.slc.rpmfactory/src/main/java/org/argeo/slc/rpmfactory/core/RpmFactoryImpl.java index 3ab7e7df2..4d5df3bd4 100644 --- a/runtime/org.argeo.slc.rpmfactory/src/main/java/org/argeo/slc/rpmfactory/core/RpmFactoryImpl.java +++ b/runtime/org.argeo.slc.rpmfactory/src/main/java/org/argeo/slc/rpmfactory/core/RpmFactoryImpl.java @@ -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) { -- 2.39.2