let parse_pin (_,s) =
if Str.string_match pin_re s 0 then
match Str.matched_group 1 s with
|"release" -> Pref.Release (parse_pref_labels (Str.matched_group 2 s))
|"version" -> Pref.Version (Str.matched_group 2 s)
|"origin" -> Pref.Origin (Str.matched_group 2 s)
|s -> fatal "Unkwnon pin type %s" s
else fatal "Unkwnon pin format %s" s