# menu options using "make menuconfig" and by running "make" with appropriate
# packages enabled.
+import os
import re
from checkpackagelib.base import _CheckFunction
class RemoveDefaultPackageSourceVariable(_CheckFunction):
packages_that_may_contain_default_source = ["binutils", "gcc", "gdb"]
- PACKAGE_NAME = re.compile("/([^/]+)\.mk")
def before(self):
- package = self.PACKAGE_NAME.search(self.filename).group(1)
+ package, _ = os.path.splitext(os.path.basename(self.filename))
package_upper = package.replace("-", "_").upper()
self.package = package
self.FIND_SOURCE = re.compile(
"TARGET_FINALIZE_HOOKS",
"TARGETS_ROOTFS",
"XTENSA_CORE_NAME"]))
- PACKAGE_NAME = re.compile("/([^/]+)\.mk")
VARIABLE = re.compile("^([A-Z0-9_]+_[A-Z0-9_]+)\s*(\+|)=")
def before(self):
- package = self.PACKAGE_NAME.search(self.filename).group(1)
+ package, _ = os.path.splitext(os.path.basename(self.filename))
package = package.replace("-", "_").upper()
# linux tools do not use LINUX_TOOL_ prefix for variables
package = package.replace("LINUX_TOOL_", "")
# functions don't need to check for things already checked by running
# "make package-dirclean package-patch".
+import os
import re
from checkpackagelib.base import _CheckFunction
class ApplyOrder(_CheckFunction):
- APPLY_ORDER = re.compile("/\d{1,4}-[^/]*$")
+ APPLY_ORDER = re.compile("\d{1,4}-[^/]*$")
def before(self):
- if not self.APPLY_ORDER.search(self.filename):
+ if not self.APPLY_ORDER.match(os.path.basename(self.filename)):
return ["{}:0: use name <number>-<description>.patch "
"({}#_providing_patches)"
.format(self.filename, self.url_to_manual)]