Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 5239 - dep-clean: /bin/fgrep: Argument list too long
Summary: dep-clean: /bin/fgrep: Argument list too long
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Dave Nellans
URL:
Whiteboard:
Keywords:
: 6243 9359 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-07-19 08:28 UTC by Patrick Naubert
Modified: 2011-10-30 22:18 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Naubert 2002-07-19 08:28:55 UTC
Here is the full error:

darkstar root # dep-clean
/usr/bin/dep-clean: /bin/fgrep: Argument list too long
There appears to be an unresolved dependency in your world file.
Please check for masking errors or other world file issues,
and then try again.

The following is the emerge output for your reference:

These are the packages that I would merge, in order.


darkstar root #
Comment 1 Olivier Crete (RETIRED) gentoo-dev 2002-07-19 09:13:06 UTC
Problem is at line 182
and the script output 4783 parameters.. which seems a little too much...
Comment 2 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2002-07-22 13:59:46 UTC
Hmm.. yes. It's a common bug in our bash scripts. Time to think up a really good
 solution to this one...
Comment 3 SpanKY gentoo-dev 2002-08-09 07:46:03 UTC
*** Bug 6243 has been marked as a duplicate of this bug. ***
Comment 4 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2002-08-26 11:33:35 UTC
A minor one, but I cannot reproduce it.
Comment 5 Olivier Crete (RETIRED) gentoo-dev 2002-08-26 11:52:43 UTC
I can't reproduce anymore either..
Comment 6 PJ 2002-10-20 06:49:02 UTC
This just began happening to me today out of the blue. I have no idea what 
caused it. I seem to be able to reproduce it, as it occurs everytime I run dep-
clean. Here is a log.

--------
root@hive /port/profiles: dep-clean -vv
Retrieving currently merged packages.
 179 currently merged packages.

Retrieving system packages.
 91 packages contained in system.

Preparing world file.
 37 packages contained in world.

Listing world and total dependencies.
/usr/bin/dep-clean: /bin/fgrep: Argument list too long
 96 packages contained in final image.

These packages have no other packages depending on them.
*SNIP*
About 100 lines of packages installed on my PC
*SNIP*
Total of 88 unneeded packages.

These packages are depended upon but are not present on the system.
Tell
emerge
to
run
the
ebuild
command
in
grep: unrecognized option `--debug'
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
--debug
mode.
In
this
ebuilds
and
tbz2s
*would*
have
been
installed
if
grep: unrecognized option `--pretend'
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
--pretend
ebuilds,
or
deps
you
specify
on
on
the
command-line
*will*
cause
tell
emerge
to
build
binary
packages
for
all
ebuilds
processed
...
Total of 43 needed packages.

These packages are installed but not in the portage tree.
/usr/bin/dep-clean: /bin/fgrep: Argument list too long
Total of 0 removed packages.
root@hive /port/profiles:
---------

Sorry for the long post, but I wanted to be sure you got all the info you 
needed. I have no idea if the "depended" msg is trying to tell me how to fix 
the problem, or if its just going nuts.

I am running Gentoo 1.4rc1, with gcc 3.2.

-PJ
http://www.elitegamer.com
Comment 7 Olivier Crete (RETIRED) gentoo-dev 2002-10-20 18:05:35 UTC
Is has re-appeared exactly as described in comment #6... 
Comment 8 Paul Belt 2002-10-21 11:04:18 UTC
--- dep-clean.orig      2002-10-21 09:52:15.000000000 -0400
+++ dep-clean   2002-10-21 12:01:51.000000000 -0400
@@ -173,15 +173,28 @@
 [ ${verb} ] && \
 echo -e "${CY}Listing world and total dependencies.${NO}"
 
+# This section rewritten by Paul Belt <gaarde at users dot sourceforge dot net>
+# This was done to eliminate the limit of arguments fgrep can accept.
 qpkg -I -nc -vv | \
-        grep ebuild | \
-        fgrep "`cat ${tmp}/world`" | \
-        cut -f5,6 -d"/" > ${tmp}/world.all
-
-cat ${tmp}/world.all | sed -e s:$:xxx: | \
-       fgrep "`find /usr/portage/ -iname '*.ebuild'|cut -f4,6 -d/ | \
-               sed -e s:\\.ebuild:xxx:`" | \
-               sed -e "s:^:\\\=:" -e "s:xxx::" > ${tmp}/world.new
+        grep ebuild > ${tmp}/all_ebuilds
+
+for f in `cat /var/cache/edb/world`; do
+   grep $f ${tmp}/all_ebuilds \
+   | cut -f5,6 -d"/"
+done >> ${tmp}/world.all
+
+cat ${tmp}/world.all | sed -e 's:$:xxx:' > ${tmp}/world.all.2
+
+find /usr/portage/ -iname '*.ebuild' \
+| cut -f4,6 -d'/' \
+| sed -e s:\\.ebuild:xxx: > ${tmp}/all.available
+
+for f in `cat ${tmp}/world.all.2`; do
+   grep $f ${tmp}/all.available \
+   | sed -e 's:^:\\\=:' -e 's:xxx::'
+done >> ${tmp}/world.new
+
+# End section
Comment 9 Nicholas Jones (RETIRED) gentoo-dev 2002-10-22 23:33:00 UTC
This is integrated into portage now.
>=portage-2.0.41

'emerge depclean'
Comment 10 Nicholas Jones (RETIRED) gentoo-dev 2002-11-09 01:26:02 UTC
*** Bug 9359 has been marked as a duplicate of this bug. ***
Comment 11 Jonas Berlin 2002-11-24 20:05:10 UTC
I have yet another patch; it should be faster as I only tell fgrep to read the regular expressions from a file in one nice swoop instead of grepping with one expression at a time.. Feel free not to use it.. =)

http://outerspace.dyndns.org/html/personal_pages/xkr47/tmp/dep-clean-fgrep-fix.diff