Skip to content

Commit a3b49f7

Browse files
committed
Revert "Merge pull request #21 from ConchuOD/pre-reqs"
This reverts commit c6b2e3a, reversing changes made to c277cfd.
1 parent df6077c commit a3b49f7

File tree

5 files changed

+7
-72
lines changed

5 files changed

+7
-72
lines changed

core/series.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,3 @@ def add_patch(self, patch):
4343

4444
def is_pure_pull(self):
4545
return bool(self.pull_url)
46-
47-
def depends_from_cover(self):
48-
if not self.cover_letter:
49-
return False
50-
51-
depends_section = re.compile(r'(?:based.on|depends.on|depend(?:a|e)ncies):\n(?:\S+@\S+\n)*', re.IGNORECASE | re.MULTILINE)
52-
depends = re.compile(r'\S+@\S+', re.IGNORECASE)
53-
match = depends_section.search(self.cover_letter)
54-
55-
if not match:
56-
# fall back to patchew's git trailer style & try that
57-
patchew_section = re.compile(r'(?:based.on: \S+@\S+\n)+', re.IGNORECASE | re.MULTILINE)
58-
match = patchew_section.search(self.cover_letter)
59-
60-
if match:
61-
return depends.findall(match.group(0))
62-
63-
return False

core/tester.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,13 @@ def _test_series_patches(self, tree, series, series_dir):
157157
fp.write("0")
158158
with open(os.path.join(series_apply, "desc"), "w+") as fp:
159159
fp.write(f"Patch already applied to {tree.name}")
160-
return [already_applied], [already_applied]
161160
else:
162161
core.log("Series does not apply", "")
163-
if not tree.check_applies_with_depends(series):
164-
with open(os.path.join(series_apply, "retcode"), "w+") as fp:
165-
fp.write("1")
166-
with open(os.path.join(series_apply, "desc"), "w+") as fp:
167-
fp.write(f"Patch does not apply to {tree.name}")
168-
return [already_applied], [already_applied]
169-
else:
170-
with open(os.path.join(series_apply, "retcode"), "w+") as fp:
171-
fp.write("0")
172-
with open(os.path.join(series_apply, "desc"), "w+") as fp:
173-
fp.write(f"Patch does not apply to {tree.name} without dependencies")
162+
with open(os.path.join(series_apply, "retcode"), "w+") as fp:
163+
fp.write("1")
164+
with open(os.path.join(series_apply, "desc"), "w+") as fp:
165+
fp.write(f"Patch does not apply to {tree.name}")
166+
return [already_applied], [already_applied]
174167

175168
series_ret = []
176169
patch_ret = []

core/tree.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import core
1212
import core.cmd as CMD
13-
import core.series as SERIES
1413
from core import Patch
1514

1615

@@ -158,19 +157,6 @@ def _apply_patch_safe(self, patch):
158157
pass
159158
raise PatchApplyError(e) from e
160159

161-
def apply_prereqs(self, prereqs):
162-
for link in prereqs:
163-
command = ["/stuff/b4/b4.sh", "shazam", link]
164-
try:
165-
CMD.cmd_run(command, cwd=self.path)
166-
except CMD.CmdError as e:
167-
print(f"failed! {e}")
168-
try:
169-
self.git(["am", "--abort"])
170-
except CMD.CmdError:
171-
pass
172-
raise PatchApplyError(e) from e
173-
174160
def apply(self, thing):
175161
if isinstance(thing, Patch):
176162
self._apply_patch_safe(thing)
@@ -193,25 +179,6 @@ def check_applies(self, thing):
193179

194180
return ret
195181

196-
def check_applies_with_depends(self, thing):
197-
core.log_open_sec("Test-applying " + thing.title)
198-
try:
199-
self.reset()
200-
201-
if hasattr(thing, "cover_letter"):
202-
depends = thing.depends_from_cover()
203-
if depends:
204-
self.apply_prereqs(depends)
205-
206-
self.apply(thing)
207-
ret = True
208-
except PatchApplyError:
209-
ret = False
210-
finally:
211-
core.log_end_sec()
212-
213-
return ret
214-
215182
def _pull_safe(self, pull_url):
216183
try:
217184
self.git_pull(pull_url)

ingest_mdir.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@
6565
tree = Tree(args.tree_name, args.tree_name, args.tree, branch=args.tree_branch)
6666
if not tree.check_applies(series):
6767
print("Patch series does not apply cleanly to the tree")
68-
if tree.check_applies_with_depends(series):
69-
print("woo!")
7068
os.sys.exit(1)
7169

7270
try:

pw_poller.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,8 @@ def _series_determine_tree(self, s: PwSeries) -> str:
105105

106106
if "fixes" in self._trees and netdev.series_is_a_fix_for(s, self._trees["fixes"]):
107107
s.tree_name = "fixes"
108-
elif "for-next" in self._trees:
109-
if self._trees["for-next"].check_applies(s):
110-
s.tree_name = "for-next"
111-
elif self._trees["for-next"].check_applies_with_depends(s):
112-
s.tree_name = "for-next"
113-
log(f"Target tree - {s.tree_name} (with dependencies)", "")
114-
return "Guessed tree name to be for-next, with dependencies"
108+
elif "for-next" in self._trees and self._trees["for-next"].check_applies(s):
109+
s.tree_name = "for-next"
115110
elif "master" in self._trees and self._trees["master"].check_applies(s):
116111
s.tree_name = "master"
117112

0 commit comments

Comments
 (0)