<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>No Znx! &#187; rpm</title>
	<atom:link href="http://znx.no/tag/rpm/feed/" rel="self" type="application/rss+xml" />
	<link>http://znx.no</link>
	<description>the pigeons!!!!</description>
	<lastBuildDate>Tue, 20 Dec 2011 22:42:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Unrar Bug</title>
		<link>http://znx.no/2010/02/unrar-bu/</link>
		<comments>http://znx.no/2010/02/unrar-bu/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 01:29:50 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://znx.no/?p=274</guid>
		<description><![CDATA[So I was recently scripting with the unrar tool and discovered something stupid: unrar t file.rar if &#91; $? -eq 0 &#93;; then echo &#34;Rar file is good?&#34; fi However it was returning zero all the time, even when the file wasn&#8217;t a rar: # unrar t file.rar &#160; UNRAR 3.80 freeware Copyright &#40;c&#41; 1993-2008 [...]]]></description>
			<content:encoded><![CDATA[<p>So I was recently scripting with the unrar tool and discovered something stupid:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">unrar t file.rar
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rar file is good?&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>However it was returning zero all the time, even when the file wasn&#8217;t a rar:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># unrar t file.rar</span>
&nbsp;
UNRAR <span style="color: #000000;">3.80</span> freeware      Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1993</span>-<span style="color: #000000;">2008</span> Alexander Roshal
&nbsp;
file.rar is not RAR archive
<span style="color: #666666; font-style: italic;"># echo $?</span>
<span style="color: #000000;">0</span></pre></div></div>

<p>So it fails the test but returns zero regardless. This makes it very unhelpful for using in scripting. Fortunately enough a mate on IRC discovered that his version did.</p>
<p>So I first download the existing SRPM and installed it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yumdownloader --source unrar</span>
<span style="color: #666666; font-style: italic;"># rpm -i unrar*.srpm</span></pre></div></div>

<p>Then I installed that and simply modified  so I downloaded the latest, created a RPM and installed.</p>
<p>I have submitted the updated spec file to <a href='https://bugzilla.rpmfusion.org/show_bug.cgi?id=1091'>RPMfusion</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2010/02/unrar-bu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

