https://github.com/freaky/pkg-cruft
Find cruft on pkgng systems like FreeBSD
https://github.com/freaky/pkg-cruft
Last synced: 11 months ago
JSON representation
Find cruft on pkgng systems like FreeBSD
- Host: GitHub
- URL: https://github.com/freaky/pkg-cruft
- Owner: Freaky
- Created: 2018-07-18T19:50:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-15T01:04:57.000Z (almost 8 years ago)
- Last Synced: 2025-01-13T07:32:09.920Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 38.1 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pkg-cruft
A small Ruby script for helping deal with cruft on pkgng (FreeBSD etc) systems.
## Requirements
* pkgng (tested on FreeBSD 11.2)
* procstat (for checkrestart)
* Ruby (tested on 2.4.4 and 2.5.1); no gems used or needed.
## Synopsis
```
% pkg-cruft [ help | defunct | files | dirs | libcheck | checkrestart ]
```
## Subcommands:
### libcheck
Check for packaged files that link against unpackaged, compat, or obsolete
libraries, ignoring files specified in env `IGNORE_LLD`.
```
% pkg-cruft libcheck
compat10x-amd64-10.3.1003000.20170608: /usr/local/lib/compat/pam_ssh.so.5 missing library libssh.so.5
compat10x-amd64-10.3.1003000.20170608: /usr/local/lib32/compat/pam_ssh.so.5 missing library libssh.so.5
```
### checkrestart
Check for running processes that may require restarting due to replaced
executables or libraries. Named for the similar Linux command.
Run as root to check all running processes. False-positives are possible.
```
# pkg-cruft checkrestart
[MISSING EXECUTABLE] (tmux-2.7)? running as 17319 (tmux)
[MISSING EXECUTABLE] (zsh-5.5.1)? running as 20115 (zsh)
[MISSING EXECUTABLE] (weechat-2.2)? running as 36747 (weechat)
/usr/local/bin/mosh-server (mosh-1.3.2_4) running as 53815 (mosh-server)
```
### files
List files in PREFIX that are not provided by any installed package, ignoring
files specified in env `IGNORE_UNPACKAGED`.
```
# pkg-cruft files
/usr/local/apache-tomcat-6.0/conf/Catalina/localhost/host-manager.xml
/usr/local/apache-tomcat-6.0/conf/Catalina/localhost/manager.xml
...
```
### dirs
List directories in PREFIX that do not contain any packaged files, ignoring
any specified in `IGNORE_UNPACKAGED`.
```
# pkg-cruft dirs
/usr/local/openjdk8/jre/lib/applet
/usr/local/share/texmf/tex/latex
...
```
### defunct
List local packages that are not available from remote repositories.
```
% pkg-cruft defunct
bsdpan-Mail-SpamAssassin-CompiledRegexps-body_0
```
## Configuration
Configuration is via environment variables:
| Variable | Default | Description |
|----------|---------|-------------|
| `PREFIX` | `/usr/local` | Installation prefix |
| `CONCURRENCY` | `16` | Workers to use for `libcheck` |
| `IGNORE_UNPACKAGED` | `www:poudriere:varnish` | :-separated patterns to ignore in `files` and `dirs`, anchored on PREFIX |
| `IGNORE_LLD` | `go/src/*/testdata/*` | :-separated patterns to ignore in `libcheck` |