macOS
brew install ohcountlocal Homebrew formula metadata
sudo port install ohcountMacPorts ports tree · textproc/ohcount/Portfile · 来源: api.github.com
安装
brew install ohcountlocal Homebrew formula metadata
sudo port install ohcountMacPorts ports tree · textproc/ohcount/Portfile · 来源: api.github.com
sudo apt install ohcountDebian stable package indexes · ohcount · 来源: deb.debian.org
sudo zypper install ohcountopenSUSE Tumbleweed package metadata · ohcount · 来源: download.opensuse.org
概览
Source code line counter
历史
Ohcount is the Ohloh/Open Hub source-code line counter: a C and Ragel based analyzer with a command-line tool and language-detection library for counting code, comment, and blank lines across source trees.
The project traces back to Ohloh, the open-source project directory and analytics site later associated with Black Duck and Open Hub. Its README says it was originally developed at Ohloh and used to generate the reports at www.openhub.net, which makes it part of the early package-statistics infrastructure rather than just a standalone `wc`-style utility.
The original GitHub source repository was created on 2008-06-09, and the Black Duck fork used by package managers was created on 2010-10-27. The Black Duck repository kept the Ohloh identity in its description while moving the maintained packaging-facing project under the Black Duck Software organization.
Ohcount's most important adoption story is Open Hub itself: the tool was used to generate Open Hub's source-code reports, giving it a role in public open-source metrics. It also reached mainstream Unix packaging through Homebrew, Debian, Ubuntu, MacPorts, and openSUSE-style distributions, but Homebrew analytics generated on 2026-07-01 showed a small niche user base: 49 installs over 365 days.
The package stayed interesting to distributors because it is not a single-language counter. The README describes a detector for primary language family, a parser for line-by-line breakdowns, support for multiple languages in one file, whole-directory counting, language-family file discovery, detailed source annotations, and Ruby bindings.
Developers and auditors use `ohcount` to count individual files or entire directory trees, identify source files by language family, and produce detailed annotations of a file's lines. Its ability to split mixed files, such as HTML with CSS and JavaScript regions, made it more sophisticated than plain line counters.
Package builders care about its implementation details because the Homebrew formula depends on `libmagic`, `pcre2`, and `ragel`, and applies Debian patches for modern build and PCRE2 support. The README also documents Ruby 2.x test expectations, SWIG bindings, and an unsupported Python wrapper.
Ohcount is a package-nerd artifact because it helped produce package metadata about other projects. It sits in the same historical lane as SLOC counters and open-source forges: the tool is small, but the data it helped generate shaped how people compared projects by language mix and code size.
Its formula tells the story of aging infrastructure kept buildable through distro patches. The combination of Ragel-generated scanners, Ruby bindings, PCRE migration, and GPL-2.0-only licensing gives maintainers plenty of packaging surface area for a deceptively simple CLI.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
ohcount | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/blackducksoftware/ohcount
安装元数据
| 软件包键 | brew:ohcount |
|---|---|
| 版本 | 4.0.0 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/ohcount |
| 主页 | https://github.com/blackducksoftware/ohcount |
| 仓库 | https://github.com/blackducksoftware/ohcount |
| 上游文档 | https://github.com/blackducksoftware/ohcount#readme |
| 许可证 | GPL-2.0-only |
| 源码归档 | https://github.com/blackducksoftware/ohcount/archive/refs/tags/4.0.0.tar.gz |
| 最后更新 | 2026-07-11T09:50:47+09:00 |
| Pulse | updated |
| 依赖 | libmagic, pcre2, ragel |
| 构建依赖 | gperf |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | ohcount |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
ohcount 4.0.0-5
Source code line counter
https://github.com/blackducksoftware/ohcount
sudo apt install ohcountohcount-doc 4.0.0-5
Source code line counter - Documentation
https://github.com/blackducksoftware/ohcount
sudo apt install ohcount-docohcount 4.0.0-4build2
Source code line counter
https://github.com/blackducksoftware/ohcount
sudo apt install ohcountohcount-doc 4.0.0-4build2
Source code line counter - Documentation
https://github.com/blackducksoftware/ohcount
sudo apt install ohcount-docohcount 4.0.0-3.3
The Ohloh source code line counter
https://www.openhub.net/p/ohcount
sudo zypper install ohcountohcount
sudo port install ohcount来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.