<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Handling_Dependencies</id>
	<title>Handling Dependencies - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Handling_Dependencies"/>
	<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Handling_Dependencies&amp;action=history"/>
	<updated>2026-04-24T01:31:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.8</generator>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Handling_Dependencies&amp;diff=10620&amp;oldid=prev</id>
		<title>Dct05r: /* Rendering Helpful messages for users */</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Handling_Dependencies&amp;diff=10620&amp;oldid=prev"/>
		<updated>2012-08-03T13:48:16Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Rendering Helpful messages for users&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:48, 3 August 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l44&quot; &gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Rendering Helpful &lt;/del&gt;messages for users=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Providing persistant helpful &lt;/ins&gt;messages for users=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A &amp;quot;render_messages&amp;quot; method can be used to provide useful messages to the user about how they need to configure their package, e.g. what dependencies they need. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A &amp;quot;render_messages&amp;quot; method can be used to provide useful messages to the user about how they need to configure their package, e.g. what dependencies they need. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l67&quot; &gt;Line 67:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $self-&amp;gt;{processor}-&amp;gt;add_message('message',$msg);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $self-&amp;gt;{processor}-&amp;gt;add_message('message',$msg);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $frag-&amp;gt;appendChild( $repo-&amp;gt;render_message( 'error', $msg ) );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $frag-&amp;gt;appendChild( $repo-&amp;gt;render_message( 'error', $msg ) );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dct05r</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Handling_Dependencies&amp;diff=10619&amp;oldid=prev</id>
		<title>Dct05r: Handling Dependencies for Bazaar Packages</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Handling_Dependencies&amp;diff=10619&amp;oldid=prev"/>
		<updated>2012-08-03T13:47:43Z</updated>

		<summary type="html">&lt;p&gt;Handling Dependencies for Bazaar Packages&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page outlines several methods to check dependancies on Bazaar package. &lt;br /&gt;
&lt;br /&gt;
All Dependency checking is done with a packages EPMC screen, so you will need to configure a basic EPMC screen for your plugin.&lt;br /&gt;
&lt;br /&gt;
=Checking Perl Library Dependencies=&lt;br /&gt;
&lt;br /&gt;
The following block of code checks for perl libraries, in this case Digest::HMAC_SHA1.&lt;br /&gt;
&lt;br /&gt;
If any of the dependancies are missing we can handle these later in render_messages.&lt;br /&gt;
&lt;br /&gt;
This piece of code is designed to exist in the enable method of an EPMC screen. &lt;br /&gt;
&lt;br /&gt;
  my @prereqs = qw/ Digest::HMAC_SHA1 /;&lt;br /&gt;
  &lt;br /&gt;
  my $evalstring;&lt;br /&gt;
  foreach my $l (@prereqs)&lt;br /&gt;
  {&lt;br /&gt;
        $evalstring .= &amp;quot;use $l;\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  eval $evalstring;&lt;br /&gt;
  if (!$@)&lt;br /&gt;
  {&lt;br /&gt;
       $self-&amp;gt;SUPER::action_enable( $skip_reload );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
This example is from the AmazonS3 plugin. &lt;br /&gt;
&lt;br /&gt;
=Checking Binary Dependencies=&lt;br /&gt;
&lt;br /&gt;
Ideally users should be able to specify the paths to binary executables in a config file and your config file should list the most &amp;quot;default&amp;quot; location. &lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
&lt;br /&gt;
  $c-&amp;gt;{&amp;quot;exif_import&amp;quot;}-&amp;gt;{&amp;quot;exif_path&amp;quot;} = '/usr/bin/exiftool';&lt;br /&gt;
&lt;br /&gt;
The you can use the following code to check for the binary on the system. &lt;br /&gt;
&lt;br /&gt;
  my $exiftool = $repo-&amp;gt;get_repository-&amp;gt;get_conf( &amp;quot;exif_import&amp;quot;, &amp;quot;exif_path&amp;quot; );&lt;br /&gt;
  &lt;br /&gt;
   if (! (-e $exiftool) ) &lt;br /&gt;
   {&lt;br /&gt;
       #binary not found&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
=Rendering Helpful messages for users=&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;render_messages&amp;quot; method can be used to provide useful messages to the user about how they need to configure their package, e.g. what dependencies they need. &lt;br /&gt;
&lt;br /&gt;
This example comes from the exiftool import package. &lt;br /&gt;
&lt;br /&gt;
  sub render_messages&lt;br /&gt;
  {&lt;br /&gt;
        my( $self ) = @_;&lt;br /&gt;
  &lt;br /&gt;
        my $repo = $self-&amp;gt;{repository};&lt;br /&gt;
        my $xml = $repo-&amp;gt;xml;&lt;br /&gt;
  &lt;br /&gt;
        my $frag = $xml-&amp;gt;create_document_fragment;&lt;br /&gt;
  &lt;br /&gt;
        my $exiftool = $repo-&amp;gt;get_repository-&amp;gt;get_conf( &amp;quot;exif_import&amp;quot;, &amp;quot;exif_path&amp;quot; );&lt;br /&gt;
        if ( -e $exiftool ) {&lt;br /&gt;
        } else {&lt;br /&gt;
                my $msg = $xml-&amp;gt;create_document_fragment;&lt;br /&gt;
  &lt;br /&gt;
                $msg-&amp;gt;appendChild($xml-&amp;gt;create_text_node('exiftool not found on your system. You need to install exiftool and/or configure this plugin with the location of exiftool.'));&lt;br /&gt;
  &lt;br /&gt;
                $self-&amp;gt;{processor}-&amp;gt;add_message('message',$msg);&lt;br /&gt;
&lt;br /&gt;
                $frag-&amp;gt;appendChild( $repo-&amp;gt;render_message( 'error', $msg ) );&lt;br /&gt;
        }&lt;br /&gt;
  &lt;br /&gt;
        return $frag;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:EPrints_Bazaar]]&lt;/div&gt;</summary>
		<author><name>Dct05r</name></author>
		
	</entry>
</feed>