MCPcopy Create free account
hub / github.com/aptly-dev/aptly / parsePackageRef

Function parsePackageRef

query/syntax.go:112–123  ·  view source on GitHub ↗

isPackageRef returns ok true if field has format pkg_version_arch

(query string)

Source from the content-addressed store, hash-verified

110
111// isPackageRef returns ok true if field has format pkg_version_arch
112func parsePackageRef(query string) (pkg, version, arch string, ok bool) {
113 i := strings.Index(query, "_")
114 if i != -1 {
115 pkg, query = query[:i], query[i+1:]
116 j := strings.LastIndex(query, "_")
117 if j != -1 {
118 version, arch = query[:j], query[j+1:]
119 ok = true
120 }
121 }
122 return
123}
124
125// D := <field> <condition> <arch_condition> | <package>_<version>_<arch>
126// field := <package-name> | <field> | $special_field

Callers 1

DMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected