import org.argeo.jcr.JcrUtils;
import org.argeo.slc.SlcException;
import org.argeo.slc.core.execution.tasks.SystemCall;
-import org.springframework.core.io.ByteArrayResource;
/**
* Gather RPMs from various sources (local builds or third party) into a
SystemCall repoquery = new SystemCall();
repoquery.arg(repoqueryExecutable);
- File yumConfigFile = rpmFactory.getYumConfigFile(arch);
+ File yumConfigFile = rpmFactory.getYumRepoFile(arch);
repoquery.arg("-c", yumConfigFile.getAbsolutePath());
repoquery.arg("--requires");
repoquery.arg("--resolve");
}
}
+ // createrepo
+ File workspaceDir = rpmFactory.getWorkspaceDir(rpmDistribution
+ .getId());
+ SystemCall createrepo = new SystemCall();
+ createrepo.arg("createrepo");
+ createrepo.arg("-q");
+ createrepo.arg("-d");
+ File archDir = new File(workspaceDir.getPath()
+ + targetFolder.getPath());
+ createrepo.arg(archDir.getAbsolutePath());
+ createrepo.run();
} catch (Exception e) {
throw new SlcException("Cannot generate distribution "
+ rpmDistribution.getId(), e);
buf.append("baseurl=").append(proxiedReposBase)
.append(repository.getId()).append('/').append(arch)
.append('/').append("\n");
+ if (((ThirdPartyRpmRepository) repository).getYumConf() != null)
+ buf.append(
+ ((ThirdPartyRpmRepository) repository).getYumConf()
+ .trim()).append('\n');
}
}
buf.append('[').append(workspace).append("]\n");
buf.append("baseurl=").append(managedReposBase).append(workspace)
.append('/').append(arch).append('/').append("\n");
+ buf.append("gpgcheck=0").append("\n");
}
/** Creates a mock config file. */
}
/** Creates a yum config file. */
- public File getYumConfigFile(String arch) {
- File yumConfigFile = new File(yumConfDir, getIdWithArch(arch) + ".conf");
+ public File getYumRepoFile(String arch) {
+ File yumConfigFile = new File(yumConfDir, getIdWithArch(arch) + ".repo");
try {
FileUtils.writeStringToFile(yumConfigFile,
generateYumConfigFile(arch));
* will be cached within the system.
*/
public class ThirdPartyRpmRepository extends AbstractRpmRepository {
+ private String yumConf;
+
+ public String getYumConf() {
+ return yumConf;
+ }
+
+ public void setYumConf(String yumConf) {
+ this.yumConf = yumConf;
+ }
}