diff options
Diffstat (limited to 'meta/lib/oe/reproducible.py')
-rw-r--r-- | meta/lib/oe/reproducible.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/meta/lib/oe/reproducible.py b/meta/lib/oe/reproducible.py index a9f717159e..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 | ||
77 | def find_git_folder(d, sourcedir): | 77 | def 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 | ||
102 | def get_source_date_epoch_from_git(d, sourcedir): | 103 | def get_source_date_epoch_from_git(d, sourcedir): |