Skip to content
Commits on Source (3)
......@@ -263,7 +263,7 @@ class DependencyParser:
def _parse_version_dependency(self):
self._cursor.skip_whitespace()
if self._cursor.get_char() == "(":
self._cursor.mynext(self._cursor)
self._cursor.mynext()
self._cursor.skip_whitespace()
opm = self._cursor.match(self._op_pat)
......@@ -285,7 +285,7 @@ class DependencyParser:
self._cursor.skip_whitespace()
if self._cursor.get_char() != ")":
raise DependencySyntaxError("Expected ')'", self._cursor)
self._cursor.mynext(self._cursor)
self._cursor.mynext()
return opm.group(), verm.group()
else:
......@@ -296,13 +296,13 @@ class DependencyParser:
def _parse_arch_restriction(self):
self._cursor.skip_whitespace()
if self._cursor.get_char() == "[":
self.mynext(self._cursor)
self.mynext()
vlist = []
while True:
self._cursor.skip_whitespace()
if self._cursor.get_char() == "]":
self._cursor.mynext(self._cursor)
self._cursor.mynext()
break
m = self._cursor.match(self._arch_pat)
if not m:
......
......@@ -257,6 +257,7 @@ class LogDB:
def create(self, subdir, package, version, contents):
(fd, temp_name) = tempfile.mkstemp(dir=subdir)
contents = contents.encode()
if os.write(fd, contents) != len(contents):
raise Exception("Partial write?")
os.close(fd)
......@@ -815,7 +816,7 @@ class PackagesDB:
if not providers:
return package_state
states = [self.get_package_state(name, resolve_virtual=False, recurse=recurse) for name in [package_name] + providers]
for state in self._good_states + list(self._propagate_waiting_state.keys()) + self._propagate_error_state.keys():
for state in self._good_states + list(self._propagate_waiting_state.keys()) + list(self._propagate_error_state.keys()):
if state in states:
return state
return package_state
......