X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Flib%2Flinux%2Frpmfactory%2FCreateSrpm.java;h=4f9d5b41f816ebcc5800c42c95503bdd0f06215b;hb=070e89e2ceaa7ce0c395f4883c1773dfd1996944;hp=aa19a8342e5f568be84f311b5428a34293e51ba3;hpb=acb97aa6504cf5343c0de86d8a4a7b3991720493;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/linux/rpmfactory/CreateSrpm.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/linux/rpmfactory/CreateSrpm.java index aa19a8342..4f9d5b41f 100644 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/linux/rpmfactory/CreateSrpm.java +++ b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/linux/rpmfactory/CreateSrpm.java @@ -50,17 +50,14 @@ public class CreateSrpm implements Runnable { copyResourceToFile(specFile, targetFile); // Generate rpmbuild config files - File rpmmacroFile = new File(topdir, "rpmmacros"); - File rpmrcFile = new File(topdir, "rpmrc"); - rpmBuildEnvironment.writeRpmbuildConfigFiles(topdir, rpmmacroFile, - rpmrcFile); + rpmBuildEnvironment.writeRpmbuildConfigFiles(topdir); // Build SRPM srpmsDir.mkdirs(); SystemCall packageSrpm = new SystemCall(); packageSrpm.arg("rpmbuild"); packageSrpm.arg("-bs").arg("--nodeps"); - packageSrpm.arg("--rcfile=" + rpmrcFile.getName()); + packageSrpm.arg("--rcfile=rpmrc"); // buildSrpm.arg("-D", "_topdir " + topdir.getCanonicalPath() + ""); packageSrpm.arg("SPECS/" + specFile.getFilename()); packageSrpm.setExecDir(topdir.getCanonicalPath()); @@ -82,6 +79,7 @@ public class CreateSrpm implements Runnable { protected void copyToSources(RpmSpecFile spec, File sourcesDir) { try { List toCopyToSources = new ArrayList(); + List toDownload = new ArrayList(); for (String file : spec.getSources().values()) { try { Resource res; @@ -92,6 +90,7 @@ public class CreateSrpm implements Runnable { } catch (Exception e) { res = new UrlResource(file); + toDownload.add(res); } toCopyToSources.add(res); } catch (Exception e) { @@ -108,6 +107,7 @@ public class CreateSrpm implements Runnable { } } catch (Exception e) { res = new UrlResource(file); + toDownload.add(res); } toCopyToSources.add(res); } catch (Exception e) { @@ -116,9 +116,9 @@ public class CreateSrpm implements Runnable { } // FIXME: we may have missed some files here - copySources: for (Resource res : toCopyToSources) { + for (Resource res : toCopyToSources) { File targetDir; - if (distributionCache != null) { + if (distributionCache != null && toDownload.contains(res)) { if (distributionCache.exists()) distributionCache.mkdirs(); targetDir = distributionCache;