aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mailcap
diff options
context:
space:
mode:
authorLi xin <lixin.fnst@cn.fujitsu.com>2014-12-17 10:04:52 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2014-12-19 20:10:57 +0100
commit5fb87a31b92911cbfbdcf24080fa83c20e67c5d5 (patch)
tree81b7d76cbf1488378c5e2350d85605740991c958 /meta-oe/recipes-support/mailcap
parenta079fe2754ca0ac60ca00ca1653f770fc7b9ce14 (diff)
downloadmeta-openembedded-contrib-5fb87a31b92911cbfbdcf24080fa83c20e67c5d5.tar.gz
mailcap: add new recipe
The mailcap file is used by the metamail program. Metamail reads the mailcap file to determine how it should display non-text or multimedia material. Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/mailcap')
-rw-r--r--meta-oe/recipes-support/mailcap/mailcap_2.1.43.bb23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/mailcap/mailcap_2.1.43.bb b/meta-oe/recipes-support/mailcap/mailcap_2.1.43.bb
new file mode 100644
index 0000000000..bcc649695b
--- /dev/null
+++ b/meta-oe/recipes-support/mailcap/mailcap_2.1.43.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Helper application and MIME type associations for file types"
+DESCRIPTION = "The mailcap file is used by the metamail program. Metamail reads the \
+mailcap file to determine how it should display non-text or multimedia \
+material. Basically, mailcap associates a particular type of file \
+with a particular program that a mail agent or other program can call \
+in order to handle the file. Mailcap should be installed to allow \
+certain programs to be able to handle non-text files. \
+\
+Also included in this package is the mime.types file which contains a \
+list of MIME types and their filename extension associations, used \
+by several applications e.g. to determine MIME types for filenames."
+
+SECTION = "System Environment/Base"
+
+SRC_URI = "https://git.fedorahosted.org/cgit/${PN}.git/snapshot/r2-1-43.tar.gz"
+SRC_URI[md5sum] = "8fd185ffae710301de3bc297877a404b"
+SRC_URI[sha256sum] = "a630892b5fe59eb9e3bef30c597de1c2b7f35243dea4b0c995fd482aa20c2d6b"
+LICENSE = "PD MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=100fcfb84512ccc03ffc7d89ac391305"
+S = "${WORKDIR}/r2-1-43"
+do_install() {
+ oe_runmake install DESTDIR=${D} sysconfdir=${sysconfdir} mandir=${mandir}
+}
OpenEmbedded Core user contribution treesGrokmirror user
summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/remotedata.py
blob: 7391e1b45c350397c4cf26b13dbe32896ea8dd78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
"""
BitBake 'remotedata' module

Provides support for using a datastore from the bitbake client
"""

# Copyright (C) 2016  Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#

import bb.data

class RemoteDatastores:
    """Used on the server side to manage references to server-side datastores"""
    def __init__(self, cooker):
        self.cooker = cooker
        self.datastores = {}
        self.locked = []
        self.nextindex = 1

    def __len__(self):
        return len(self.datastores)

    def __getitem__(self, key):
        if key is None:
            return self.cooker.data
        else:
            return self.datastores[key]

    def items(self):
        return self.datastores.items()

    def store(self, d, locked=False):
        """
        Put a datastore into the collection. If locked=True then the datastore
        is understood to be managed externally and cannot be released by calling
        release().
        """
        idx = self.nextindex
        self.datastores[idx] = d
        if locked:
            self.locked.append(idx)
        self.nextindex += 1
        return idx

    def check_store(self, d, locked=False):
        """
        Put a datastore into the collection if it's not already in there;
        in either case return the index
        """
        for key, val in self.datastores.items():
            if val is d:
                idx = key
                break
        else:
            idx = self.store(d, locked)
        return idx

    def release(self, idx):
        """Discard a datastore in the collection"""
        if idx in self.locked:
            raise Exception('Tried to release locked datastore %d' % idx)
        del self.datastores[idx]

    def receive_datastore(self, remote_data):
        """Receive a datastore object sent from the client (as prepared by transmit_datastore())"""
        dct = dict(remote_data)
        d = bb.data_smart.DataSmart()
        d.dict = dct
        while True:
            if '_remote_data' in dct:
                dsindex = dct['_remote_data']['_content']
                del dct['_remote_data']
                if dsindex is None:
                    dct['_data'] = self.cooker.data.dict
                else:
                    dct['_data'] = self.datastores[dsindex].dict
                break
            elif '_data' in dct:
                idct = dict(dct['_data'])
                dct['_data'] = idct
                dct = idct
            else:
                break
        return d

    @staticmethod
    def transmit_datastore(d):
        """Prepare a datastore object for sending over IPC from the client end"""
        # FIXME content might be a dict, need to turn that into a list as well
        def copy_dicts(dct):
            if '_remote_data' in dct:
                dsindex = dct['_remote_data']['_content'].dsindex
                newdct = dct.copy()
                newdct['_remote_data'] = {'_content': dsindex}
                return list(newdct.items())
            elif '_data' in dct:
                newdct = dct.copy()
                newdata = copy_dicts(dct['_data'])
                if newdata:
                    newdct['_data'] = newdata
                return list(newdct.items())
            return None
        main_dict = copy_dicts(d.dict)
        return main_dict