Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201319 - Don't duplicate broken files output (revdep-rebuild, gentoolkit-0.2.4_pre7)
Summary: Don't duplicate broken files output (revdep-rebuild, gentoolkit-0.2.4_pre7)
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 170220
  Show dependency tree
 
Reported: 2007-12-05 03:18 UTC by Katerina Barone-Adesi
Modified: 2008-02-21 01:54 UTC (History)
1 user (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 Katerina Barone-Adesi 2007-12-05 03:18:19 UTC
Part of the output of revdep-rebuild:

 * Found some broken files that weren't associated with known packages
 * The broken files are:
 *   /usr/lib64/blas/atlas/libblas.la
 *   /usr/lib64/blas/atlas/libblas.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libpoppler-cairo.la

Some of the files are listed more than once.

Reproducible: Always

Steps to Reproduce:
1. Run revdep-rebuild, with at least one library which is multiply broken: ie, part of the revdep-rebuild output should look like this:
[ 66% ]  *   broken /usr/lib64/libGraphicsMagick++.la (requires /usr/lib64/libGraphicsMagick.la)
 *   broken /usr/lib64/libGraphicsMagick++.la (requires //usr/lib64/libdpstk.la)
 *   broken /usr/lib64/libGraphicsMagick++.la (requires //usr/lib64/libdps.la)
 *   broken /usr/lib64/libGraphicsMagick++.la (requires /-lstdc++)

I'm not sure how to create such a file.
Actual Results:  
 * Found some broken files that weren't associated with known packages
 * The broken files are:
 *   /usr/lib64/blas/atlas/libblas.la
 *   /usr/lib64/blas/atlas/libblas.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libpoppler-cairo.la

Expected Results:  
 * Found some broken files that weren't associated with known packages
 * The broken files are:
 *   /usr/lib64/blas/atlas/libblas.la
 *   /usr/lib64/libGraphicsMagick++.la
 *   /usr/lib64/libpoppler-cairo.la
Comment 1 Zac Medico gentoo-dev 2007-12-05 03:59:24 UTC
With portage-2.1.3.x you can use portageq owners. This works regardless of symlinked directories too (by comparison of inodes).

   owners <root> [<filename>]+
      Given a list of files, print the packages that own the files and which
      files belong to each package. Files owned by a package are listed on
      the lines below it, indented by a single tab character (\t). All file
      paths must start with <root>. Returns 1 if no owners could be found,
      and 0 otherwise.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-12-05 12:24:34 UTC

*** This bug has been marked as a duplicate of bug 93574 ***
Comment 3 Paul Varner (RETIRED) gentoo-dev 2007-12-05 14:55:23 UTC
Not a duplicate
Comment 4 michael@smith-li.com 2008-01-23 03:51:03 UTC
Change this function (around line 785) from
show_unowned_files() {
  if grep -qF '(none)' "$LIST.4_package_owners"; then
    ewarn "Found some broken files that weren't associated with known packages"
    ewarn "The broken files are:"
    while read filename junk; do
      [[ $junk = *none* ]] && ewarn "  $filename"
    done < "$LIST.4_package_owners"
  fi
}

to
show_unowned_files() {
  if grep -qF '(none)' "$LIST.4_package_owners"; then
    ewarn "Found some broken files that weren't associated with known packages"
    ewarn "The broken files are:"
    while read filename junk; do
      [[ $junk = *none* ]] && ewarn "  $filename"
    done < "$LIST.4_package_owners" | awk '!s[$0]++' # (omit dupes)
  fi
}

And that should do it.
Comment 5 Paul Varner (RETIRED) gentoo-dev 2008-02-18 18:17:50 UTC
$ svn diff revdep-rebuild
Index: revdep-rebuild
===================================================================
--- revdep-rebuild      (revision 464)
+++ revdep-rebuild      (working copy)
@@ -840,7 +840,7 @@
                ewarn "The broken files are:"
                while read filename junk; do
                        [[ $junk = *none* ]] && ewarn "  $filename"
-               done < "$LIST.4_package_owners"
+               done < "$LIST.4_package_owners" | awk '!s[$0]++' # (omit dupes)
        fi
 }

$ svn commit -m "Don't duplicate broken file output. (Bug 201319)"
Sending        revdep-rebuild/revdep-rebuild
Transmitting file data .
Committed revision 465.
Comment 6 Paul Varner (RETIRED) gentoo-dev 2008-02-21 01:54:22 UTC
Released in gentoolkit-0.2.4_rc2