Dne 15.9.2014 14:28, Richard W.M. Jones napsal(a):
> On Mon, Sep 15, 2014 at 10:57:13AM +0200, Vít Ondruch wrote:
>> Every of the script is based on assumption that you already read some
>> library/unit whatever. But that is not enough. I wonder how you want to
>> detect that you need restart in case that I have something like this:
>>
>> $ ls
>> foo.rb
>> bar.rb
>>
>> $ cat foo.rb
>>
>> def some_function
>>   require 'bar'
>> end
>>
>> And now
>>
>> 1) I run some application, which loads my foo.rb file.
>> 2) I later update the package which removes bar.rb file.
>> 3) And I call some_function which fails due to missing bar.rb
> How is this not 'foo' simply being broken?

They might come from different packages. Or there might be also another
level of requires, where bar.rb requires by baz.rb. In case that bar.rb
stays and baz.rb is removed, you still cannot predict that this will
fail in the future, since neither of these files was loaded before.

Or there might be another example of code with similar issues:

$ cat foo.rb

def some_function
  $files.each {|f| require f}
end

$files = Dir.glob('*.rb')

I.e. during initialization, you list available files and you want to
load them later, but at that moment, they are not there already.

>   ie. Not expressing its
> needs properly in its RPM dependencies?


We typically express dependencies between packages, the separate library
files are typically considered just implementation detail. But I agree
that it would be more precise to express dependencies between separate
library files, instead of packages. Anyway, this is case of dynamic
loading, so I am not sure how you would specify the dependencies.


Vít
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Reply via email to