summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/reproducible.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/reproducible.py')
-rw-r--r--meta/lib/oe/reproducible.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/meta/lib/oe/reproducible.py b/meta/lib/oe/reproducible.py
index 448befce33..1957c97434 100644
--- a/meta/lib/oe/reproducible.py
+++ b/meta/lib/oe/reproducible.py
@@ -75,10 +75,10 @@ def get_source_date_epoch_from_known_files(d, sourcedir):
75 return source_date_epoch 75 return source_date_epoch
76 76
77def find_git_folder(d, sourcedir): 77def find_git_folder(d, sourcedir):
78 # First guess: WORKDIR/git 78 # First guess: UNPACKDIR/git
79 # This is the default git fetcher unpack path 79 # This is the default git fetcher unpack path
80 workdir = d.getVar('WORKDIR') 80 unpackdir = d.getVar('UNPACKDIR')
81 gitpath = os.path.join(workdir, "git/.git") 81 gitpath = os.path.join(unpackdir, "git/.git")
82 if os.path.isdir(gitpath): 82 if os.path.isdir(gitpath):
83 return gitpath 83 return gitpath
84 84
@@ -88,15 +88,16 @@ def find_git_folder(d, sourcedir):
88 return gitpath 88 return gitpath
89 89
90 # Perhaps there was a subpath or destsuffix specified. 90 # Perhaps there was a subpath or destsuffix specified.
91 # Go looking in the WORKDIR 91 # Go looking in the UNPACKDIR
92 exclude = set(["build", "image", "license-destdir", "patches", "pseudo", 92 for root, dirs, files in os.walk(unpackdir, topdown=True):
93 "recipe-sysroot", "recipe-sysroot-native", "sysroot-destdir", "temp"])
94 for root, dirs, files in os.walk(workdir, topdown=True):
95 dirs[:] = [d for d in dirs if d not in exclude]
96 if '.git' in dirs: 93 if '.git' in dirs:
97 return os.path.join(root, ".git") 94 return os.path.join(root, ".git")
98 95
99 bb.warn("Failed to find a git repository in WORKDIR: %s" % workdir) 96 for root, dirs, files in os.walk(sourcedir, topdown=True):
97 if '.git' in dirs:
98 return os.path.join(root, ".git")
99
100 bb.warn("Failed to find a git repository in UNPACKDIR: %s" % unpackdir)
100 return None 101 return None
101 102
102def get_source_date_epoch_from_git(d, sourcedir): 103def get_source_date_epoch_from_git(d, sourcedir):
@@ -120,7 +121,7 @@ def get_source_date_epoch_from_git(d, sourcedir):
120 return int(p.stdout.decode('utf-8')) 121 return int(p.stdout.decode('utf-8'))
121 122
122def get_source_date_epoch_from_youngest_file(d, sourcedir): 123def get_source_date_epoch_from_youngest_file(d, sourcedir):
123 if sourcedir == d.getVar('WORKDIR'): 124 if sourcedir == d.getVar('UNPACKDIR'):
124 # These sources are almost certainly not from a tarball 125 # These sources are almost certainly not from a tarball
125 return None 126 return None
126 127