[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: suggestions needed: woes of extracting /usr/doc/ files



On Tue, Aug 17, 1999 at 08:04:16AM +1000, Craig Small wrote:
> James A. Treacy said:
> > The lintian repository on master is currently supplying the
> > usr/doc/{copyright,changelog.Debian.gz} files for the Packages
> > pages. It is just not reliable enough for us(*) so I'm looking
> > into extracting the files using a script.
> > 
> > I'm considering serving the /usr/doc files dynamically.
> > This meas ripping the .deb apart (trivial) and extracting
> > the /usr/doc (and /usr/share/doc) portions of data.tar.gz.
> > Instead of writing them to disc, I was hoping to store
> > the information directly in perl. Anyone have a suggestion
> > on how to do this?
> You get the data.tar.gz file, then run something in perl like:
>   $copyright = `tar xfOz data.tar.gz /usr/doc/$package/copyright`;
>   $changelog = `tar xfOz data.tar.gz /usr/doc/$package/changelog.Debian.gz`;
> 
> etc
> The O means send the file to stdout.
> 
You have answered a different question. I'll explain why I abandoned that
approach.

Extracting the files one at a time doesn't work well because it
doesn't give helpful information when things go wrong. What can go wrong?
 - the usr/doc/package (usr/doc/share/package) directory may not exist
   (Yes this shouldn't happen and yes I've already filed bugs)
 - the file may not exist
 - the file may be a symlink
 - the file pointed to by the symlink may not exist
 - the symlink may even be to a file in another package (this is
   allowed in certain cases)

So, you really need to have a look at the contents to decide what to do.
The possible solutions are:
 - unpack the usr/doc/package (usr/share/doc/package) directory to the
   filesystem
 - unpack the usr/doc/package (usr/share/doc/package) directory to some
   kind of virtual file system.

I was hoping to avoid having to deal with lots of temporary directories
so wrote the original mail. If you have used the tar mode in emacs you
will know what I am looking for. Guess I could read up on the tar
format and do it myself.

Jay Treacy


Reply to: