Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
add branch to packet-name if not build from master
sixcooler518962002685
diff --git a/build.properties b/build.propertiesindex c60617636..bbb1c37c5 100644--- a/build.properties+++ b/build.properties@@ -4,7 +4,7 @@ javacTarget=1.6# Release ConfigurationreleaseVersion=1.62-stdReleaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz+stdReleaseFile=yacy${branch}_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gzsourceReleaseFile=yacy_src_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gzreleaseFileParentDir=yacyprivateKeyFile=private.keydiff --git a/build.xml b/build.xmlindex c3cc74876..344202fbd 100644--- a/build.xml+++ b/build.xml@@ -58,6 +58,9 @@<property name="git" location=".git"/><property name="defaults" location="defaults"/><property name="RDFaParser" location="RDFaParser"/>++ <!-- pseudo default branch as fallback -->+ <property name="branch" value="" /><!-- pseudo default releaseNr as fallback --><property name="releaseNr" value="9000" />@@ -98,7 +101,7 @@<pathelement location="${libbuild}/org.eclipse.jgit-1.1.0.201109151100-r.jar" /></classpath></taskdef>- <gitRev repoPath="${yacyroot}" revprop="releaseNr" dateprop="DSTAMP" />+ <gitRev repoPath="${yacyroot}" branchprop="branch" revprop="releaseNr" dateprop="DSTAMP" /></target><!-- reading the build properties from file -->@@ -115,6 +118,9 @@<!-- YaCy Release Date --><filter token="REPL_DATE" value="${DSTAMP}"/><filter token="REPL_RELEASE" value="${stdReleaseFile}"/>++ <!-- YaCy Brach -->+ <echo message="YaCy Branch: ${branch}" /><!-- YaCy Release Version number --><echo message="YaCy Version number: ${releaseVersion}" />diff --git a/libbuild/GitRevTask/GitRevTask.java b/libbuild/GitRevTask/GitRevTask.javaindex 78cd8df80..f01f0f222 100644--- a/libbuild/GitRevTask/GitRevTask.java+++ b/libbuild/GitRevTask/GitRevTask.java@@ -21,18 +21,23 @@ import org.eclipse.jgit.storage.file.FileRepositoryBuilder;public class GitRevTask extends org.apache.tools.ant.Task {private String repoPath;+ private String branchprop;private String revprop;private String dateprop;public void setRepoPath(final String repoPath) {this.repoPath = repoPath;}++ public void setBranchprop(final String branchprop) {+ this.branchprop = branchprop;+ }- public void setRevprop(String revprop) {+ public void setRevprop(final String revprop) {this.revprop = revprop;}- public void setDateprop(String dateprop) {+ public void setDateprop(final String dateprop) {this.dateprop = dateprop;}@@ -46,6 +51,7 @@ public class GitRevTask extends org.apache.tools.ant.Task {return;}+ String branch = null;String revision = null;String lastTag = null;String commitDate = null;@@ -53,6 +59,8 @@ public class GitRevTask extends org.apache.tools.ant.Task {final File src = new File(repoPath);final Repository repo = new FileRepositoryBuilder().readEnvironment().findGitDir(src).build();+ branch = repo.getBranch();+ branch = "master".equals(branch)? "" : "_" + branch;final ObjectId head = repo.resolve("HEAD");final Git git = new Git(repo);@@ -86,7 +94,9 @@ public class GitRevTask extends org.apache.tools.ant.Task {Project theProject = getProject();if (theProject != null) {- theProject.setProperty(this.revprop, revision);+ theProject.setProperty(this.branchprop, branch);+ log("Property '" + this.branchprop + "' set to '" + branch + "'", Project.MSG_VERBOSE);+ theProject.setProperty(this.revprop, revision);log("Property '" + this.revprop + "' set to '" + revision + "'", Project.MSG_VERBOSE);theProject.setProperty(this.dateprop, commitDate);log("Property '" + this.dateprop + "' set to '" + commitDate + "'", Project.MSG_VERBOSE);@@ -105,12 +115,14 @@ public class GitRevTask extends org.apache.tools.ant.Task {} else {gitRevTask.setRepoPath(args[0]);}+ gitRevTask.setBranchprop("brnach");gitRevTask.setRevprop("baseRevisionNr");gitRevTask.setDateprop("DSTAMP");Project p = new Project();gitRevTask.setProject(p);gitRevTask.execute();+ String branch = gitRevTask.getProject().getProperty("branch");String version = gitRevTask.getProject().getProperty("baseRevisionNr");String commitDate = gitRevTask.getProject().getProperty("DSTAMP");@@ -123,7 +135,7 @@ public class GitRevTask extends org.apache.tools.ant.Task {try {f.createNewFile();FileWriter w = new FileWriter(f);-+ w.append("branch=" + branch + "\n");w.append("releaseNr=" + version + "\n");w.append("DSTAMP=" + commitDate + "\n");w.close();