Comment 7 for bug 484386

Revision history for this message
Steve Langasek (vorlon) wrote :

On Tue, Nov 24, 2009 at 11:44:16AM -0000, Giuseppe Iuculano wrote:
> This doesn't work.

What didn't work? Comparing the diffs, I see a bug in mine that I used the
'filename' variable twice when the first instance should have been
'module_in_tree'; but your version instead introduces new variables
(PACKAGE_NAME?) that aren't defined anywhere in the script. I guess this
comes from the source/dkms.conf; should this value always be the same as the
directory name, or is there ever a reason to prefer one or the other?

- version_in_tree="$filename"
+ version_in_tree="$(basename $filename)"

This adds an extra fork for each directory. Can be done in shell instead
as:

  version_in_tree=${filename##*/}
  module_in_tree=${filename%/*}
  module_in_tree=${module_in_tree##*/}

Also, the double for loop is needed because we care about counting how many
versions are available for the same module; with your changes, we lose that
information.

Updated patch attached.