<font size="2">Hi Marcelo,<br><br>Sorry to delay. <br><br>So currently repack.sh is getting call with debian/watch file <br></font><pre><font size="2">(uscan --force-download --rename --destdir ../tarballs). <br><br>It was a fix for subversion when you download upstream source and keep it in ../tarballs  before running svn-buildpackage. <br>
</font></pre><font size="2"><br> I haven&#39;t said that it will work as it is, but yes we can take this and modified as per our need. :) <br><br><br><br>Thanks<br>Deepak</font>.<br><br><div class="gmail_quote">On Thu, Apr 22, 2010 at 7:03 PM, Marcelo E. Magallon <span dir="ltr">&lt;<a href="mailto:mmagallo@debian.org">mmagallo@debian.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Thu, Apr 22, 2010 at 09:35:14AM +0530, Deepak Tripathi wrote:<br>
<br>
&gt; 2) I have already created a script repack.sh to convert<br>
&gt; gemtotar format. we can use this (if it is not buggy). its<br>
&gt; available in svn[2]. let me know your input.<br>
<br>
</div> Looking at the script, I&#39;m not sure about its purpose:<br>
<br>
#!/bin/sh<br>
# Repackage upstream source to exclude non-distributable files<br>
# should be called as &quot;repack.sh --upstream-source &lt;ver&gt;<br>
# &lt;downloaded file&gt; (for example, via uscan)<br>
<br>
set -e<br>
set -u<br>
<br>
VER=&quot;$2&quot;<br>
FILE=&quot;$3&quot;<br>
PKG=`dpkg-parsechangelog|grep ^Source:|sed &#39;s/^Source: //&#39;`<br>
<br>
 Does it need an already existing Debian package, or am I<br>
 misunderstanding something?<br>
<br>
 Also:<br>
<br>
# Create an extra directory to cope with rootless tarballs<br>
UP_BASE=&quot;$DIR/unpack&quot;<br>
mkdir &quot;$UP_BASE&quot;<br>
gem unpack &quot;$FILE&quot; --target &quot;$UP_BASE&quot;<br>
<br>
 If I try for example:<br>
<br>
 $ gem unpack caper-0.2.0.gem --target $PWD/test-dir<br>
 ERROR:  While executing gem ... (Gem::FilePermissionError)<br>
     You don&#39;t have write permissions into the /var/lib/gems/1.8 directory.<br>
<br>
 and test-dir/caper-0.2.0 gets created, but it&#39;s empty.<br>
<br>
 When I was exploring a similar idea, I was thinking of going<br>
 with:<br>
<br>
 DIR=`basename &quot;$gem&quot; .gem`<br>
 mkdir &quot;$DIR&quot;<br>
 tar xOf &quot;$gem&quot; data.tar.gz | tar -C &quot;$DIR&quot; -xzf -<br>
<br>
 And using the gem metadata to extract things like the gem name,<br>
 version, etc.<br>
<br>
 But then I realised that it&#39;s better to use Rubygem&#39;s library,<br>
 which allows for something like:<br>
<br>
    require &#39;rubygems/format&#39;<br>
    format = Gem::Format.from_file_by_path ARGV.first<br>
    spec = format.spec<br>
    puts &quot;Gem: #{<a href="http://spec.name" target="_blank">spec.name</a>} (#{spec.version})&quot;<br>
    format.file_entries.each do |entry, data|<br>
       # entry[&#39;path&#39;] is the file&#39;s path<br>
       # entry[&#39;mode&#39;] is the file&#39;s mode<br>
       # data contains the actual file data<br>
<br>
       # you only need to add sanity checks and filters here and<br>
       # write data to entry[&#39;path&#39;]<br>
    end<br>
<br>
 It&#39;s a real pity that the gem spec does not include the license<br>
 information in a machine readable format.<br>
<br>
 Cheers,<br>
<font color="#888888"><br>
 Marcelo<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Deepak Tripathi <br>E3 71V3 8Y C063 (We Live By Code)<br><a href="http://deepaktripathi.blogspot.com">http://deepaktripathi.blogspot.com</a><br><br>