diff --git a/lilac b/lilac index 9856e9d..735b225 100755 --- a/lilac +++ b/lilac @@ -528,18 +528,17 @@ def main_may_raise( failed_info = D.get('failed', {}) - if not pkgs_from_args: - U = set(REPO.lilacinfos) - last_commit = D.get('last_commit', EMPTY_COMMIT) - changed = get_changed_packages(last_commit, 'HEAD') & U - - failed_prev = set(failed_info.keys()) - # no update from upstream, but build instructions have changed; rebuild - # failed ones - need_rebuild_failed = failed_prev & changed - # if pkgrel is updated, build a new release - need_rebuild_pkgrel = {x for x in changed - if pkgrel_changed(last_commit, 'HEAD', x)} - unknown + U = set(REPO.lilacinfos) + last_commit = D.get('last_commit', EMPTY_COMMIT) + changed = get_changed_packages(last_commit, 'HEAD') & U + + failed_prev = set(failed_info.keys()) + # no update from upstream, but build instructions have changed; rebuild + # failed ones + need_rebuild_failed = failed_prev & changed + # if pkgrel is updated, build a new release + need_rebuild_pkgrel = {x for x in changed + if pkgrel_changed(last_commit, 'HEAD', x)} - unknown nv_changed = {} for p, vers in nvdata.items(): @@ -572,17 +571,17 @@ def main_may_raise( if pkgs_from_args: for p in pkgs_from_args: build_reasons[p].append(BuildReason.Cmdline()) - else: - for p in need_rebuild_pkgrel: - build_reasons[p].append(BuildReason.UpdatedPkgrel()) - for p in need_rebuild_failed: - build_reasons[p].append(BuildReason.UpdatedFailed()) + for p in need_rebuild_pkgrel: + build_reasons[p].append(BuildReason.UpdatedPkgrel()) + + for p in need_rebuild_failed: + build_reasons[p].append(BuildReason.UpdatedFailed()) - for p, i in failed_info.items(): - # p might have been removed - if p in REPO.lilacinfos and (deps := i['missing']): - build_reasons[p].append(BuildReason.FailedByDeps(deps)) + for p, i in failed_info.items(): + # p might have been removed + if p in REPO.lilacinfos and (deps := i['missing']): + build_reasons[p].append(BuildReason.FailedByDeps(deps)) if_this_then_those = defaultdict(set) for p, info in REPO.lilacinfos.items(): @@ -630,10 +629,9 @@ def main_may_raise( if x in failed_info: del failed_info[x] # cleanup removed package failed_info - if not pkgs_from_args: - for x in tuple(failed_info.keys()): - if x not in REPO.lilacinfos: - del failed_info[x] + for x in tuple(failed_info.keys()): + if x not in REPO.lilacinfos: + del failed_info[x] D['failed'] = failed_info if config['lilac']['rebuild_failed_pkgs']: diff --git a/lilac2/repo.py b/lilac2/repo.py index 2aa155e..225dca7 100644 --- a/lilac2/repo.py +++ b/lilac2/repo.py @@ -333,14 +333,14 @@ def load_managed_lilac_and_report(self) -> dict[str, tuple[str, ...]]: self.lilacinfos, errors = lilacyaml.load_managed_lilacinfos(self.repodir) failed: dict[str, tuple[str, ...]] = {p: () for p in errors} for name, exc_info in errors.items(): - logger.error('error while loading lilac.py for %s', name, exc_info=exc_info) + logger.error('error while loading lilac.yaml for %s', name, exc_info=exc_info) exc = exc_info[1] if not isinstance(exc, Exception): raise self.send_error_report(name, exc=exc, - subject='为软件包 %s 载入 lilac.py 时失败') + subject='为软件包 %s 载入 lilac.yaml 时失败') build_logger_old.error('%s failed', name) - build_logger.exception('lilac.py error', pkgbase = name, exc_info=exc_info) + build_logger.exception('lilac.yaml error', pkgbase = name, exc_info=exc_info) return failed