Logo Search packages:      
Sourcecode: falcon version File versions  Download package

def falcon::pocket::Pocket::export (   self  ) 

Export repository info to the metadata (Sources/Packages/Release)

Definition at line 91 of file pocket.py.

00091                     :
        """Export repository info to the metadata (Sources/Packages/Release)"""
        releasefiles = {}
        for c in self.components:

        md5sums = "".join([" %s %16d %s\n" % (releasefiles[name][1], releasefiles[name][0], name) for name in sorted(releasefiles.keys())])
        sha1sums = "".join([" %s %16d %s\n" % (releasefiles[name][2], releasefiles[name][0], name) for name in sorted(releasefiles.keys())])
        sha256sums = "".join([" %s %16d %s\n" % (releasefiles[name][3], releasefiles[name][0], name) for name in sorted(releasefiles.keys())])

        rel = pocket_release_template.render(Context({'conf': falcon.conf,
                                              'p': self,
                                              'md5sums': md5sums,
                                              'sha1sums': sha1sums,
                                              'sha256sums': sha256sums}))
        rf = os.path.join(self.distpath, 'Release')
        if falcon.util.writefile(rf, rel) or (falcon.conf.gpgkey and not os.path.exists(rf + '.gpg')):
            falcon.util.debug(_("Signing %s") % rf)
            if falcon.conf.gpgkey:
                if os.path.exists(rf + '.gpg'):
                    os.unlink(rf + '.gpg')
                    falcon.util.run(['gpg', '-u', falcon.conf.gpgkey, '--detach-sig', '--armor', '--output', '%s.gpg' % rf, rf])
                    falcon.util.warning(_("Failed to sign the release file"))

            # Generate contents list
            if falcon.conf.create_filelist:
                fl = {}
                for a in falcon.conf.architectures:
                    fl[a] = FileList()
                falcon.util.output(_("Creating file listings for pocket '%s'") % self.name)
                binaries = falcon.package.BinaryPackage.objects.filter(sourcepackage__component__pocket = self)
                for b in binaries:
                    tag = '%s/%s' % (b.controlfields['Section'], b.packagename)
                    for f in b.files:
                        if not f.endswith('/'):
                            if b.architecture == 'all':
                                for a in falcon.conf.architectures:
                                    fl[a][f] = tag
                                fl[b.architecture][f] = tag
                for a in falcon.conf.architectures:
                    fo = os.path.join(self.distpath, 'Contents-%s' % a)
                    falcon.util.writefile(fo, fl[a].as_list())
                    falcon.util.run(['gzip', '-f', fo])

        if falcon.conf.webbase:
            appinstall = False
                appinstall = falcon.plugins.app_install.AppInstallDataPlugin.conf.enabled
            template = falcon.util.get_template('pocket.html')
            context = Context({'p': self, 'conf': falcon.conf, 'dots': '../../','components': self.components, 'appinstall': appinstall})
            falcon.util.writefile(os.path.join(self.distpath, 'index.html'), template.render(context))

    def __str__(self):

Generated by  Doxygen 1.6.0   Back to index