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

Re: testing config/preinst mods: one approach



>   > To use this approach, place these replacement apt-extracttemplates and
>   > dpkg-deb scripts in your path before /usr/bin.  Extract the original
>   > control files from a package and put them in a subdirectory of
>   > override directory named identically to the .deb file in
>   > /var/cache/apt/archives.  Then edit the modified files freely and
>   > install as usual.
>
>   I did this and get:
>
>   alhambra:~# apt-get install tetex-bin 2>&1 | tee 14.31.log
>   Reading Package Lists...
>   Building Dependency Tree...
>   Reading changelogs...
>   apt-extracttemplates: can't get archive from Check
>   1 packages upgraded, 0 newly installed, 0 to remove and 0  not upgraded.
>   Need to get 0B/3693kB of archives. After unpacking 24.6kB will be used.
>
>   USING /root/control-overrides/tetex-bin_2.0.2-14.31_i386.deb/
>
>   dpkg: error processing /var/cache/apt/archives/tetex-bin_2.0.2-14.31_i386.deb (--unpack):
>    failed to open package info file `/var/lib/dpkg/tmp.ci/control' for reading: No such file or directory
>   Errors were encountered while processing:
>    /var/cache/apt/archives/tetex-bin_2.0.2-14.31_i386.deb
>   E: Sub-process /usr/bin/dpkg returned an error code (1)

The control file not being found is being issued after
apt-extracttemplates is long over since the USING message you see
there is issued by dpkg-deb --control.  It looks like your
/root/control-overrides/tetex-bin_2.0.2-14.31_i386.deb/ directory
didn't contain a control file.  Did you populate it with all the files
from dpkg-deb --control?  I just did the following steps exactly and
it worked fine:

  cd /root/control-overrides
  dpkg -P --force-depends tetex-bin
  apt-get --download-only install tetex-bin
  /usr/bin/dpkg-deb --control /var/cache/apt/archives/tetex-bin_2.0.2-14_i386.deb tetex-bin_2.0.2-14_i386.deb
  path=(~/source/debian/control-overrides $path)
  apt-get install tetex-bin

>   I looked in the code of apt-extracttemplates, but I don't know much
>   Perl. It seems that it is getting the line "Check 0.5.00,1.2.34" from
>   its filehandle, but I don't understand this (there ain't such thing as
>   stdin (-|, right?) when I call apt-extracttemplates $filename)

Open you open(P, "-|"), perl forks.  The child's stdout is read by the
parent from the filehandle P.  So what's read from P is the output of
/usr/bin/apt-extracttemplates run with the same arguments that were
passed to the real one.  Try running /usr/bin/apt-extracttemplates on
the download .deb file and see what you get.  I get this:

/usr/bin/apt-extracttemplates /var/cache/apt/archives/tetex-bin_2.0.2-14_i386.deb
tetex-bin 2.0.2-14 /tmp/tetex-bin.template.99790 /tmp/tetex-bin.config.99791

which looks right.  I'm not sure where the "Check" came from other
than maybe some output from apt-extracttemplates.

Thanks for giving it a try.  I'd be interested to know what the
problem was when you track it down.

--Jay



Reply to: