aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Bacherikov <slava@bacher09.org>2012-08-11 18:36:44 +0300
committerSlava Bacherikov <slava@bacher09.org>2012-08-11 18:36:44 +0300
commit3989c5d3aeb690211452bcc2c058689f9ff1be6f (patch)
treef380e5723c6c4e861890b92168bf7ae2bb38b03c
parentFix managers (diff)
downloadgentoo-packages-3989c5d3aeb690211452bcc2c058689f9ff1be6f.tar.gz
gentoo-packages-3989c5d3aeb690211452bcc2c058689f9ff1be6f.tar.bz2
gentoo-packages-3989c5d3aeb690211452bcc2c058689f9ff1be6f.zip
Add mask change methods in scan class
-rw-r--r--gpackages/apps/packages/scan.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/gpackages/apps/packages/scan.py b/gpackages/apps/packages/scan.py
index e42b7fc..660fcc3 100644
--- a/gpackages/apps/packages/scan.py
+++ b/gpackages/apps/packages/scan.py
@@ -772,3 +772,32 @@ class Scanner(object):
# Hack for not update last modified datetime
models.PackageModel.objects.filter(pk = package_id). \
update(latest_ebuild = latest_ebuild)
+
+ def add_mising_ebuilds(self):
+ for ebuild in porttree.iter_ebuilds():
+ try:
+ ebuild_obj = models.EbuildModel.objects.get(ebuild = ebuild)
+ except models.EbuildModel.DoesNotExist:
+ self.output('%-44s [%s]\n', (ebuild,
+ ebuild.package.category.porttree_name))
+ try:
+ package_obj = models.PackageModel.objects. \
+ get(package = ebuild.package)
+
+ except models.PackageModel.DoesNotExist:
+ pass
+ else:
+ self.update_ebuilds(ebuild.package, package_obj)
+
+ def update_ebuild_mask(self):
+ for ebuild in porttree.iter_ebuilds():
+ try:
+ ebuild_obj = models.EbuildModel.objects.get(ebuild = ebuild)
+ except models.EbuildModel.DoesNotExist:
+ continue
+ if ebuild_obj.is_hard_masked != ebuild.is_hard_masked:
+ self.output('%-44s [%s]\n', (ebuild,
+ ebuild.package.category.porttree_name))
+
+ ebuild_obj.is_hard_masked = ebuild.is_hard_masked
+ ebuild_obj.save(force_update = True)