summaryrefslogtreecommitdiff
path: root/doc/todo/bytes_in_privData__63__/comment_7_d6c4c2645696eac448e906d812c2de62._comment
blob: 07bc81459b606b5b381e1e1c03eedda3eaa90d63 (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
[[!comment format=mdwn
 username="joey"
 subject="""mostly done"""
 date="2015-09-15T00:26:10Z"
 content="""
A recent change converted PrivData to a newtype.
There are no longer any things that directly use PrivData; all use
should be via accessor functions like privDataLines and privDataVal.
Which helps with this.

So, I've instead implemented a `privDataByteString :: PrivData -> ByteString`, 
and I've adjusted the privdata serialization so it shouldn't crash
on arbitrarily encoded data when eg, a binary file is fed into `propellor --set`.

(Note that I was wrong earlier when I said it'd be safe to change the 
serialization to use ByteString; it must use String. While `"foo"`
can be Read as a ByteString same as a string, `"foo\1000"`,
when Read as a ByteString, truncates the big unicode character to 
a single byte. So, PrivData is still stored as Strings internally.)

The final step would be to make `hasPrivContent` use `privDataByteString`
instead of `privDataLines`. Which needs some more work to add Properties to
ensure a file contains a ByteString. This should be pretty easy to do,
but I lost steam..
"""]]