def METHOD_NAME(self):
    self.find_program('cabal', var='CABAL')
    self.find_program('ghc-pkg', var='GHCPKG')
    pkgconfd = self.bldnode.abspath() + '/package.conf.d'
    self.env.PREFIX = self.bldnode.abspath() + '/dist'
    self.env.PKGCONFD = pkgconfd
    if self.root.find_node(pkgconfd + '/package.cache'):
        self.msg('Using existing package database', pkgconfd, color='CYAN')
    else:
        pkgdir = self.root.find_dir(pkgconfd)
        if pkgdir:
            self.msg('Deleting corrupt package database', pkgdir.abspath(), color ='RED')
            rmtree(pkgdir.abspath())
            pkgdir = None
        self.cmd_and_log(self.env.GHCPKG + ['init', pkgconfd])
        self.msg('Created package database', pkgconfd, color = 'YELLOW' if pkgdir else 'GREEN')