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

Re: hardlinks in packages -- unusable in AFS



Adam Heath <doogie@debian.org> wrote:
> On Sat, 19 Oct 2002, Joerg Sommer wrote:
> 
>> I think I found a way: dpkg calls /bin/tar to extract the tar archive of
>> the debian package. So if a replace /bin/tar with a script, that calls
>> star -symlink, I can unpack the package the same way like in a normal fs.
>> But this script couldn't only call star, because star doesn't accept the
>> same parameters like tar. star whants -x -f instead of xf. And you
>> couldn't determine correctly, how calls the faked /bin/tar.
> 
> dpkg has internal tar.

?-) I am confused? I replace /bin/tar for a test with a shell script to
see, how dpkg calls tar and then run apt-get install foo and I saw, that
/bin/tar was called with 'xf -'. Yesterday I looked at the source code of
dpkg and I found in dpkg-deb/extract.c these lines:

#v+
void extracthalf(const char *debar, const char *directory,
                 const char *taroption, int admininfo) {
[...]
	execlp(TAR,"tar",buffer,"-",(char*)0);
[...]
}

void do_extract(const char *const *argv) { controlextractvextract(0, "xp", argv)
#v-

do_extract() calls controlextractvextract() and this calls extracthalf().
The name do_extract implies, that this function is used for extraction,
but I'm not sure.

What does dpkg realy for extracting the tar archive? If it calls an
external tar, can I submit a bug report (wish) that dpkg should support
customizing of the tar call?

Joerg.



Reply to: