uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike O\\\'Leary <tmole...@uw.edu>
Subject Re: Repackaging an unpackaged pear file
Date Fri, 27 Apr 2012 22:41:18 GMT
Thilo Goetz <twgoetz@...> writes:

> 
> On 27/04/12 00:52, Mike O'Leary wrote:
> > Mike O'Leary <tmoleary@...> writes:
> > 
> >>
> >> Thilo Goetz <twgoetz@...> writes:
> >>
> >>>
> >>> On 26/04/12 18:10, Marshall Schor wrote:
> >>>> Thanks Thilo.
> >>>>
> >>>> Could you unzip the pear with an unzipper, and do the change to fix
the
> >>>> file path and then zip it back up again?  That way the variable
> >>>> replacement stuff wouldn't run.
> >>>>
> >>>> -Marshall
> >>>>
> >>>
> >>> Yes but you need the original pear to do that.  If somebody
> >>> installed the pear, made modifications and then just zipped
> >>> it up, it wouldn't work.  On the other hand, a pear that was
> >>> just unzipped, not installed, will not run.  It was my
> >>> understanding that the original poster did not in fact have
> >>> the original pear file.
> >>>
> >>> So what you do, and I suspect that is what Jens also does,
> >>> is install the pear, run it, make modifications, and then
> >>> migrate your changes from the installed pear into the zip
> >>> file.  That works, but it's not exactly a smooth process.
> >>>
> >>> --Thilo
> >>>
> >>>
> >>
> >> I do have the original pear file. Would it work to do the following steps:
> >> 1. Change the pear file extension from .pear to .zip.
> >> 2. Unzip the archive.
> >> 3. Change the pathnames in the file from absolute to the correct relative 
> >> pathnames.
> >> 4. Rezip the unzipped directory structure.
> >> 5. Change the extension back to .pear.
> >>
> >> If that works, then I can easily do it. I didn't realize that .pear files 
used 
> >> compression that is compatible with that used for .zip files.
> >> Thanks,
> >> Mike
> >>
> >>
> > 
> > I guess there must be more to it. When I tried using WinZip and whatever 
similar 
> > capability is built into Windows 7 to expand a pear file, change the 
pathnames 
> > and rezip it, the archive that was produced was slightly larger than the 
> > original, and when I tried to install it, I got an IOException with the 
message 
> > "installation descriptor not found". I didn't change anything other than the 
> > pathnames in one file, so the installation descriptor was still in the right 
> > place. I assume it couldn't find the installation descriptor because it 
didn't 
> > recognize the format of the compressed file. What would be a good tool for 
> > expanding and compressing pear files (without interpreting their contents)?
> > Thanks,
> > Mike
> > 
> > 
> 
> Mike,
> 
> a pear file is nothing but a zip file with a specific
> structure and certain files.  If you have a pear file
> with absolute paths in it, that sounds like a contradiction
> to me.  I would go back to the source and ask them to
> give you a properly packaged pear, with no absolute paths.
> 
> If that is not possible, your only option is to dive into
> the pear documentation and try to reconstruct a proper
> pear from what you have (which may not be that difficult).
> 
> --Thilo
> 
> 

I found a solution after some trial and error with unzipping and rezipping the 
pear file in ways that didn't produce a pear file that UIMA recognized. Instead 
of unzipping the pear file (renamed to have a .zip extension), I just right-
clicked on it and selected Open With->Windows Explorer, which opens the zip file 
as if it is a directory. I couldn't open any files for editing from that 
directory, but I did copy the offending file into a normal directory, changed 
the absolute pathnames to relative ones, copied the file back into the directory 
representing the zip file, and closed that directory. The result was a zip file 
of the same size as the original pear file, and when I installed it, it didn't 
complain about not being able to find the installation descriptor. So fully 
unzipping and rezipping the pear file didn't work for me, but changing one file 
while disturbing the pear file as little as possible did. Thank you to everyone 
who provided information and advice.
Mike



Mime
View raw message