Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 142217 | Differences between
and this patch

Collapse All | Expand All

(-)man.orig/mkman.sh (-1 / +3 lines)
Lines 4-10 Link Here
4
APPLETS=$(../q | grep -e ' : ' | awk '{print $1}' | grep ^q$1)
4
APPLETS=$(../q | grep -e ' : ' | awk '{print $1}' | grep ^q$1)
5
5
6
for applet in $APPLETS; do
6
for applet in $APPLETS; do
7
	help2man -N -S "Gentoo Foundation" -m ${applet} -s 1 -o ${applet}.1 "../q $applet"
7
	help2man -N -S "Gentoo Foundation" -m ${applet} -s 1 \
8
		$(for incl in ${applet}-*.include; do echo "-I ${incl}"; done) \
9
		-o ${applet}.1 "../q $applet"
8
	[[ $? == 0 ]] || continue;
10
	[[ $? == 0 ]] || continue;
9
	sed  -i -e s/'PORTAGE-UTILS-CVS:'/${applet}/g \
11
	sed  -i -e s/'PORTAGE-UTILS-CVS:'/${applet}/g \
10
		-e s/'portage-utils-cvs:'/${applet}/g \
12
		-e s/'portage-utils-cvs:'/${applet}/g \
(-)man.orig/qfile-01-owners.include (+41 lines)
Line 0 Link Here
1
[Finding files owners]
2
.PP
3
This is the default behavior of \fBqfile\fP.  It will list the packages which
4
own the files (or directories, or symlinks, or anything else Portage can 
5
install) you are querying.  Query items may be file paths or simple file names.
6
By default, output includes packages names and the complete paths to
7
the matching files.  If using \fB\-\-exact\fP, versions of the packages will 
8
also be shown.  At the contrary, when using \fB\-\-quiet\fP, only package 
9
names are listed, without files paths.  Finally, \fB\-\-verbose\fP is similar
10
to \fB\-\-exact\fP, but may adds a few warnings.  The return status of 
11
\fBqfile\fP will be \fI0\fP as soon as an owning package has been found for 
12
one of the query items.
13
.PP
14
Find names of package(s) owning "/bin/bash":
15
.nf\fI
16
	$ qfile -q /bin/bash
17
	app-shells/bash
18
.fi
19
.PP
20
Find package(s) owning any file named "bash", and show paths of this files:
21
.nf\fI
22
	$ qfile bash
23
	app-shells/bash (/bin/bash)
24
	app-shells/bash (/etc/bash)
25
.fi
26
.PP
27
Find packages(s) owning the file named "bash" in the current directory. Also 
28
display their exact version:
29
.nf\fI
30
	$ cd /bin
31
	$ qfile -e ./bash
32
	app-shells/bash-3.1_p17 (/bin/bash)
33
.fi
34
.PP
35
Find the package(s) owning the libraries needed by the Bash binary:
36
.nf\fI
37
	$ qfile $(scanelf -nq -F%n#F /bin/bash | tr , '\\n')
38
	sys-libs/ncurses (/lib/libncurses.so.5)
39
	sys-libs/glibc (/lib/libdl.so.2)
40
	sys-libs/glibc (/lib/libc.so.6)
41
.fi
(-)man.orig/qfile-02-orphans.include (+41 lines)
Line 0 Link Here
1
[Finding orphan files]
2
.PP
3
\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files which are 
4
not owned by any package.  This behavior is the opposite of the usual file 
5
owner search: the output is the list of query items for which no reference has
6
been found in your installed packages database.  The \fB\-\-exact\fP option has
7
no effect in this mode, whereas \fB\-\-verbose\fP may add a few warning 
8
messages.  As for \fB\-\-quiet\fP, it will completly turn off the output, 
9
leaving just a silent test command, which returns \fI0\fP if and only if
10
there was no orphan in your query items.
11
.PP
12
Find the orphan libtool files of your system:
13
.nf\fI
14
	$ qfile -o $(find /lib /usr/lib -name "*.la")
15
	/usr/lib/libGL.la
16
.fi
17
.PP
18
Find the libraries needed by the binary "foo" which have not been installed by
19
any package:
20
.nf\fI
21
	$ qfile -o $(scanelf -nq -F%n#F /path/to/foo | tr , '\\n')
22
	libinstalledmanually.so.2
23
.fi
24
.PP
25
Script to find the orphan config files on your system 
26
(\fBIMPORTANT:\fP this script is just a quick example.  Do not blindly delete
27
the files it will list!):
28
.nf\fI
29
	#!/bin/bash
30
	SEARCH_PATHS="$(portageq envvar CONFIG_PROTECT)"
31
	SEARCH_MASK="$(portageq envvar CONFIG_PROTECT_MASK) \\
32
		/etc/runlevels /etc/portage \\
33
		/etc/ssl/certs /etc/ssh \\
34
		/etc/bash_completion.d /etc/cups"
35
	for path in ${SEARCH_MASK} ; do
36
		EXCLUDE="${EXCLUDE} -not -path ${path}/*"
37
	done
38
	set -f
39
	find ${SEARCH_PATHS} ${EXCLUDE} -print0 \\
40
		| xargs -0 -n 500 qfile -o
41
.fi
(-)man.orig/qfile-03-ROOT.include (+40 lines)
Line 0 Link Here
1
[Handling of the ROOT variable]
2
.PP
3
By setting the \fIROOT\fP environment variable, you can force \fBqfile\fP to
4
work in the sytem of your choice. This example shows queries for owner of 
5
"/bin/sh", first on your main system, and then on a system mounted on "/mnt":
6
.nf\fI
7
	$ qfile -q /bin/sh
8
	app-shells/bash
9
	$ ROOT=/mnt qfile -q /bin/sh
10
	sys-apps/busybox
11
.fi
12
.PP
13
Note that the query item is "/bin/sh" in both commands: by default, what 
14
\fBqfile\fP looks for is file paths as they are recorded in the packages 
15
database of the target system, and this paths don't include \fI$ROOT\fP.
16
If, at the contrary, you want to query files with their current actual 
17
paths (including the mount point), you should add the \fB\-\-root\-prefix\fP 
18
(\fB\-R\fP) option:
19
.nf\fI
20
	$ ROOT=/mnt qfile -Rq /mnt/bin/sh
21
	sys-apps/busybox
22
.fi
23
.PP
24
The other difference beetween defaults and \fB\-R\fP queries is the output 
25
of files paths.  The former doesn't include the \fI$ROOT\fP prefix, and the 
26
later does:
27
.nf\fI
28
	$ ROOT=/mnt qfile sh
29
	sys-apps/busybox (/bin/sh)
30
	$ ROOT=/mnt qfile -R sh
31
	sys-apps/busybox (/mnt/bin/sh)
32
.fi
33
.PP
34
Sure, the same differences hold when querying for orphan files:
35
.nf\fI
36
	$ ROOT=/mnt qfile -o $(ls /mnt/bin/ | sed 's:^/mnt::')
37
	/bin/dostuff.sh
38
	$ ROOT=/mnt qfile -Ro /mnt/bin/*
39
	/mnt/bin/dostuff.sh
40
.fi

Return to bug 142217