Bug #142

The 0.64.4 tarball doesn't compile

Added by Ruben Lopez over 7 years ago. Updated over 7 years ago.

Status:FixedStart date:09/17/2010
Priority:NormalDue date:
Assignee:Andreas Schröder% Done:

0%

Category:all
Target version:0.64.5

Description

It fails with the following message:
fatal: Not a git repository

It seems that the SConstruct file does only work if you download the code from a git repo, but not if you download the tarball.

History

#1 Updated by Andreas Schröder over 7 years ago

  • Category set to all
  • Status changed from New to Fixed
  • Assignee set to Andreas Schröder
  • Priority changed from Low to Normal
  • Target version set to 0.64.5

This patch fixes the problem and will be included in the next DrQueue release.

diff --git a/SConstruct b/SConstruct
index ac1112a..32b4f8d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -68,15 +68,18 @@ def copy_with_clean(src_files,dest_files,dest_path,env):
     return rlist

 def get_git_commit():
-       try:
-               gitlog = subprocess.Popen(["git", "show", "--abbrev-commit"], stdout=subprocess.PIPE)
-       except OSError:
-               print("Not a Git repository. Can't fetch commit id.")
-               commit_string = "" 
-       else:
-               commit_string = gitlog.communicate()[0].split("\n")[0].split(" ")[1]
-               print("Current Git commit id is: "+commit_string)
-       return commit_string
+  try:
+    gitlog = subprocess.Popen(["git", "show", "--abbrev-commit"], stdout=subprocess.PIPE)
+  except OSError:
+    commit_string = "" 
+  else:
+    if gitlog.poll() != "0":
+      print("Not a Git repository. Can't fetch commit id.")
+      commit_string = "" 
+    else:
+      commit_string = gitlog.communicate()[0].split("\n")[0].split(" ")[1]
+      print("Current Git commit id is: "+commit_string)
+  return commit_string

 def write_git_rev(commit_id):
        os.chdir("libdrqueue")

Also available in: Atom PDF