Skip to content

Commit

Permalink
Merge pull request #76 from getsolus/fix-check
Browse files Browse the repository at this point in the history
Fix usr-merge file checking
  • Loading branch information
ReillyBrogan authored Jul 19, 2024
2 parents 277eb50 + 26248b0 commit ed9331b
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions pisi/operations/check.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2005-2011 TUBITAK/UEKAE, 2013-2017 Ikey Doherty, Solus Project
# SPDX-License-Identifier: GPL-2.0-or-later

from copy import deepcopy
import os
import pisi
import pisi.context as ctx
Expand Down Expand Up @@ -34,18 +35,39 @@ def file_corrupted(pfile):
"modules.symbols.bin",
]

_top_level_dirs = [
"/bin/",
"/lib/",
"/lib32/",
"/lib64/",
"/sbin/",
]

_empty_results = {
'missing' : [],
'corrupted' : [],
'denied' : [],
'config' : [],
}


def ignorance_is_bliss(f):
"""Too many complaints about things that are missing."""
p = f
if not p.startswith("/"):
p = "/{}".format(f)

if not p.startswith("/usr"):
for top in _top_level_dirs:
if p.startswith(top):
if os.path.islink(top.rstrip("/")):
return True

pbas = os.path.basename(p)
p = p.replace("/lib64/", "/lib/")

# Ignore kernel depmod changes?
if p.startswith("/lib/modules"):
if p.startswith("/lib/modules") or p.startswith("/usr/lib/modules"):
if pbas in _blessed_kernel_borks:
return True

Expand All @@ -55,12 +77,7 @@ def ignorance_is_bliss(f):


def check_files(files, check_config=False):
results = {
"missing": [],
"corrupted": [],
"denied": [],
"config": [],
}
results = deepcopy(_empty_results)

for f in files:
if not check_config and f.type == "config":
Expand Down Expand Up @@ -106,6 +123,9 @@ def check_package_files(package):


def check_package(package, config=False):
# Temporary hack until epoch
if package == "baselayout":
return deepcopy(_empty_results)
if config:
return check_config_files(package)
else:
Expand Down

0 comments on commit ed9331b

Please sign in to comment.