From 481dc1154709d9d1061de259d7133335c7497051 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Thu, 21 Jan 2016 17:11:11 +0000 Subject: bitbake: toaster: make locale packages uneditable in custom image page When the packages associated with a custom image recipe are shown in the customrecipe editing page, locale packages are shown in the same way as all other packages. This gives the false impression that these packages can be removed, when in fact they are automatically added due to the IMAGE_LINGUAS build variable. Modify the customrecipe page so that locale packages cannot be removed, and provide some help text explaining why. [YOCTO #8927] (Bitbake rev: b2208e53c00a67a7d0345e7378e6806b8ae40fb4) Signed-off-by: Elliot Smith Signed-off-by: brian avery Signed-off-by: Richard Purdie --- bitbake/lib/toaster/orm/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bitbake/lib/toaster/orm') diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 1cf997cfe5..b70fa18feb 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -749,6 +749,20 @@ class Package(models.Model): section = models.CharField(max_length=80, blank=True) license = models.CharField(max_length=80, blank=True) + @property + def is_locale_package(self): + """ Returns True if this package is identifiable as a locale package """ + if self.name.find('locale') != -1: + return True + return False + + @property + def is_packagegroup(self): + """ Returns True is this package is identifiable as a packagegroup """ + if self.name.find('packagegroup') != -1: + return True + return False + class CustomImagePackage(Package): # CustomImageRecipe fields to track pacakges appended, # included and excluded from a CustomImageRecipe -- cgit v1.2.3-54-g00ecf