<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'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"><<a href="mailto:mmagallo@debian.org">mmagallo@debian.org</a>></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>
> 2) I have already created a script repack.sh to convert<br>
> gemtotar format. we can use this (if it is not buggy). its<br>
> available in svn[2]. let me know your input.<br>
<br>
</div> Looking at the script, I'm not sure about its purpose:<br>
<br>
#!/bin/sh<br>
# Repackage upstream source to exclude non-distributable files<br>
# should be called as "repack.sh --upstream-source <ver><br>
# <downloaded file> (for example, via uscan)<br>
<br>
set -e<br>
set -u<br>
<br>
VER="$2"<br>
FILE="$3"<br>
PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'`<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="$DIR/unpack"<br>
mkdir "$UP_BASE"<br>
gem unpack "$FILE" --target "$UP_BASE"<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'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's empty.<br>
<br>
When I was exploring a similar idea, I was thinking of going<br>
with:<br>
<br>
DIR=`basename "$gem" .gem`<br>
mkdir "$DIR"<br>
tar xOf "$gem" data.tar.gz | tar -C "$DIR" -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's better to use Rubygem's library,<br>
which allows for something like:<br>
<br>
require 'rubygems/format'<br>
format = Gem::Format.from_file_by_path ARGV.first<br>
spec = format.spec<br>
puts "Gem: #{<a href="http://spec.name" target="_blank">spec.name</a>} (#{spec.version})"<br>
format.file_entries.each do |entry, data|<br>
# entry['path'] is the file's path<br>
# entry['mode'] is the file'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['path']<br>
end<br>
<br>
It'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>