On Sat, 22 Sep 2007 00:39:14 +0200, Hisham Muhammad <[EMAIL PROTECTED]> wrote:

> On 9/21/07, Jonas Karlsson <[EMAIL PROTECTED]> wrote:
>> On Fri, 21 Sep 2007 20:30:15 +0200, Hisham Muhammad <[EMAIL PROTECTED]> 
>> wrote:
>>
>> > On 9/21/07, Jonas Karlsson <[EMAIL PROTECTED]> wrote:
>> >> 2007/9/21, Hisham Muhammad <[EMAIL PROTECTED]>:
>> >> > On 9/20/07, Jonas Karlsson <[EMAIL PROTECTED]> wrote:
>> >> > > I have written a small script (see below) to find what applications
>> >> > > are dependant on a given application. Before I commit it I'd like some
>> >> > > feedback, if there are things I can change and make better (or
>> >> > > differently).
>> >> >
>> >> > Looks like --specific-version is not taking version operators into
>> >> > account. I didn't find much use for this option.
>> >> >
>> >> With --specific-version the script will be more specific when grepping
>> >> though the Dependencies and BuildInformation files. It narrows the
>> >> hits down, but may miss dependencies, since a later version of the
>> >> dependency may be added since those file were created. I don't know if
>> >> it is really usefull, it just felt like it when I wrote the script.
>> >>
>> >> > Cross-checking with ldd will cause hand-added dependencies to be
>> >> > missed. As a consequence, "CheckDependants python" missed Subversion,
>> >> > for example, while "CheckDependants --fast python" got it.
>> >> >
>> >> > On the other hand, when checking a non-Current version of GTK+, --fast
>> >> > got it wrong and the slow mode got it right.
>> >> >
>> >> > My suggestion is to make the "fast" mode the default when no version
>> >> > is given. When a version is given, the cross-check should skip the
>> >> > dependency only if the dependency is returned by ldd but it is not the
>> >> > requested version. May cause the odd false-positive, but it's better
>> >> > than missing hand-added dependencies.
>> >> >
>> >> Besides changing default to '--fast' when no version is given, what is
>> >> the difference from the original implementation?
>> >> Another option for not missing hand added dependencies would be to
>> >> make a diff between Dependencies and BuildInformation and not run the
>> >> cross-check for entries only in the Dependencies file.
>> >>
>> >> > Here's a version with the suggested changes:
>> >> > http://hisham.gobolinux.org/CheckDependants
>> >>
>> >> Why is the grep at the end of the pipe split? Unecessary imo.
>> >
>> > Because it implements the other feature I mentioned: "cross-check
>> > should skip the dependency only if the dependency is returned by ldd
>> > but it is not the requested version."
>> >
>> That's how it was done before as well.
>
> No. You missed the difference both in the implementation and the description.
>
> In full (not fast) mode, the old dependency missed Subversion from the
> Python dependants, the new one doesn't.
>
You kept the comment, "if nothing was returned...", unchenged which made me
make wrong assumptions abuot the implementation. I guess your implementation
is a simpler way of what I later suggested - to only make cross-check against
applications found in BuildInformation and Dependencies and skip it with
applications found only in Dependencies. Otoh my approach is a bit faster, as
GenBuldInformation isn't run for the applications only found in Dependencies.

>> > This improves the full scan. The new version no longer misses
>> > Subversion when checking dependants of Python, and it is still able to
>> > correctly identify that my old version of GTK+ is not really used.
>> >
>> But that's due to not using the cross-check, not because you split the
>> grep expression.
>
> It's because I split the grep expression. I was talking about the full
> scan with cross-check (ie, running "CheckDependants Python 2.5" and
> "CheckDependants GTK+ 2.10.10").
>
But with this new implementation, why default to '--fast' when no version is
specified, as the new way of grepping does find hand added dependencies as
well? This suggestion from you also added to my misconception of that something
was not completly right with your implementation.

I guess I misunderstood your implementation. But I suggest *not* defaulting to
'--fast' when no version is given, as the new implementation of full does find
hand added dependencies. Perhaps adding a note right efter the dependants:

CheckDependants Python 2.4.4
EXO 0.3.2                   (Dependencies)
Gnome-Python 2.15.4         (BuildInformation)
Gnome-Python-Extras 2.14.2  (Dependencies)
KDE-Bindings 3.5.6          (Dependencies)
KDE-Utils 3.5.6             (BuildInformation)
PyGObject 2.11.3            (Dependencies)
PyORbit 2.14.1              (BuildInformation)
SCons 0.96.1                (Dependencies)
Subversion 1.4.4            (Dependencies)

to point out if the dependant application is linked against the application or
just need the binary. This is to make it easier to spot false positives.

>> >> And with
>> >> the last regex for grepping for the version, one miss the feature of
>> >> just checking for major version or major + minor version, and skipping
>> >> bugfix releases and below.
>> >
>> > It was not a feature, it was a bug. For example, I checked dependants
>> > of "GTK+ 2.10.1" to see if I could delete it and keep only the newer
>> > GTK+ 2.10.14, it returned a lot of false hits.
>> >
>> For me it was a feature.
>
> It produced incorrect results.
>
Yes, with my last implementation, but that can be fixed.

>> How about checking if the version specified
>> exists and if so, add '$' to the end of the grep expression, otherwice
>> just leave it?
>
> Personally, I would find that behavior inconsistent from a user perspective.
>
Why? Imo "tweakability" is a good thing, and I believe this adds this. You are
also presented with this information in the CheckDependants help.

-- 
/Jonas

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to