{"id":29091522,"url":"https://github.com/morganamilo/go-srcinfo","last_synced_at":"2025-07-20T05:33:31.565Z","repository":{"id":57484509,"uuid":"136235097","full_name":"Morganamilo/go-srcinfo","owner":"Morganamilo","description":"A golang package for parsing SRCINFO files","archived":false,"fork":false,"pushed_at":"2019-04-01T16:14:43.000Z","size":291,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-28T06:07:24.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/Morganamilo/go-srcinfo","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Morganamilo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-05T21:08:14.000Z","updated_at":"2024-09-12T18:40:10.000Z","dependencies_parsed_at":"2022-08-26T14:24:13.461Z","dependency_job_id":null,"html_url":"https://github.com/Morganamilo/go-srcinfo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Morganamilo/go-srcinfo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morganamilo%2Fgo-srcinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morganamilo%2Fgo-srcinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morganamilo%2Fgo-srcinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morganamilo%2Fgo-srcinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Morganamilo","download_url":"https://codeload.github.com/Morganamilo/go-srcinfo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morganamilo%2Fgo-srcinfo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266071519,"owners_count":23871940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-28T06:07:14.700Z","updated_at":"2025-07-20T05:33:31.523Z","avatar_url":"https://github.com/Morganamilo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GPL3 license](https://img.shields.io/badge/License-GPL3-blue.svg)](LICENSE)\n[![GoDoc](https://godoc.org/github.com/Morganamilo/go-srcinfo?status.svg)](https://godoc.org/github.com/Morganamilo/go-srcinfo)\n[![Build Status](https://travis-ci.org/Morganamilo/go-srcinfo.svg?branch=master)](https://travis-ci.org/Morganamilo/go-srcinfo)\n[![codecov](https://codecov.io/gh/Morganamilo/go-srcinfo/branch/master/graph/badge.svg)](https://codecov.io/gh/Morganamilo/go-srcinfo)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Morganamilo/go-srcinfo)](https://goreportcard.com/report/github.com/Morganamilo/go-srcinfo)\n\n# go-srcinfo\n\nA golang package for parsing `.SRCINFO` files. [SRCINFO](https://wiki.archlinux.org/index.php/.SRCINFO)\n\ngo-srcinfo aimes to be simple while ensuring each srcinfo is syntactically\ncorrect. Split packages and architecture specific fields are fully supported.\n\n# Examples\n\nReading a srcinfo from a file\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Morganamilo/go-srcinfo\"\n)\n\nfunc main() {\n\tinfo, err := srcinfo.ParseFile(\"SRCINFO\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfmt.Println(info)\n}\n```\n\nReading each package from a split package\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Morganamilo/go-srcinfo\"\n)\n\nfunc main() {\n\tinfo, err := srcinfo.ParseFile(\"SRCINFO\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfor _, pkg := range info.SplitPackages() {\n\t\tfmt.Printf(\"%s-%s: %s\\n\", pkg.Pkgname, info.Version(), pkg.Pkgdesc)\n\t}\n}\n```\n\nShowing the architecture of each source\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Morganamilo/go-srcinfo\"\n)\n\nfunc main() {\n\tinfo, err := srcinfo.ParseFile(\"SRCINFO\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfor _, source := range info.Source {\n\t\tif source.Arch == \"\" {\n\t\t\tfmt.Printf(\"This source is for %s: %s\\n\", \"any\", source.Value)\n\t\t} else {\n\t\t\tfmt.Printf(\"This source is for %s: %s\\n\", source.Arch, source.Value)\n\t\t}\n\t}\n}\n```\n\nReading a srcinfo from a string\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Morganamilo/go-srcinfo\"\n)\n\nconst str = `\npkgbase = gdc-bin\n\tpkgver = 6.3.0+2.068.2\n\tpkgrel = 1\n\turl = https://gdcproject.org/\n\tarch = i686\n\tarch = x86_64\n\tlicense = GPL\n\tsource_i686 = http://gdcproject.org/downloads/binaries/6.3.0/i686-linux-gnu/gdc-6.3.0+2.068.2.tar.xz\n\tmd5sums_i686 = cc8dcd66b189245e39296b1382d0dfcc\n\tsource_x86_64 = http://gdcproject.org/downloads/binaries/6.3.0/x86_64-linux-gnu/gdc-6.3.0+2.068.2.tar.xz\n\tmd5sums_x86_64 = 16d3067ebb3938dba46429a4d9f6178f\n\npkgname = gdc-bin\n\tpkgdesc = Compiler for D programming language which uses gcc backend\n\tdepends = gdc-gcc\n\tdepends = perl\n\tdepends = binutils\n\tdepends = libgphobos\n\tprovides = d-compiler=2.068.2\n\tprovides = gdc=6.3.0+2.068.2\n\npkgname = gdc-gcc\n\tpkgdesc = The GNU Compiler Collection - C and C++ frontends (from GDC, gdcproject.org)\n\tprovides = gcc=6.3.0\n\tprovides = gcc-libs=6.3.0\n\npkgname = libgphobos-lib32\n\tpkgdesc = Standard library for D programming language, GDC port\n\tprovides = d-runtime-lib32\n\tprovides = d-stdlib-lib32\n`\nfunc main() {\n\tinfo, err := srcinfo.Parse(str)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfmt.Println(info)\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganamilo%2Fgo-srcinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorganamilo%2Fgo-srcinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganamilo%2Fgo-srcinfo/lists"}