Lines Matching refs:fmri
52 def __init__(self, fmri):
54 self.fmri = fmri
65 def __init__(self, fmri, reason, detail=None, nested_exc=None):
66 FmriError.__init__(self, fmri)
72 outstr = "{0} '{1}': ".format(self.msg_prefix, self.fmri)
87 the fmri since version information is missing."""
91 self.fmri)
111 def __init__(self, fmri=None, build_release=None, publisher=None,
113 if fmri is not None:
114 fmri = fmri.rstrip()
117 PkgFmri._gen_fmri_indexes(fmri)
123 publisher = fmri[pubidx:nameidx - 1]
126 self.pkg_name = fmri[nameidx:veridx]
129 fmri[veridx + 1:], build_release)
131 raise IllegalFmri(fmri,
135 self.pkg_name = fmri[nameidx:]
152 raise IllegalFmri(fmri, IllegalFmri.SYNTAX_ERROR,
156 raise IllegalFmri(fmri, IllegalFmri.BAD_PACKAGENAME,
177 def _gen_fmri_indexes(fmri):
181 veridx = fmri.rfind("@")
186 if fmri.startswith("pkg://"):
187 nameidx = fmri.find("/", 6, veridx)
189 raise IllegalFmri(fmri,
200 elif fmri.startswith("pkg:/"):
203 elif fmri.startswith("//"):
204 nameidx = fmri.find("/", 2, veridx)
206 raise IllegalFmri(fmri,
216 elif fmri.startswith("/"):
374 to reference this fmri."""
401 return "<pkg.fmri.PkgFmri '{0}' at {1:#x}".format(fmristr,
566 raise IllegalMatchingFmri(e.fmri, e.reason,
586 def extract_pkg_name(fmri):
589 fmri = fmri.rstrip()
591 veridx, nameidx, pubidx = PkgFmri._gen_fmri_indexes(fmri)
594 pkg_name = fmri[nameidx:veridx]
596 pkg_name = fmri[nameidx:]