[maemo-developers] Maemo-Optify & Builder Bots = Broken?

From: Ed Bartosh bartosh at gmail.com
Date: Wed Oct 21 21:26:11 EEST 2009
2009/10/21 Nathan Anderson <nathan at andersonsplace.net>:
...
> Selecting previously deselected package clucene-core.
> Unpacking clucene-core (from .../clucene-core_0.9.21b-0maemo1_armel.deb) ...
> dpkg: error processing
> /var/cache/apt/archives/clucene-core_0.9.21b-0maemo1_armel.deb (--unpack):
>  trying to overwrite `/opt', which is also in package base-files
>                      ^^^^
> Uhm, this is not good.   Each of my "optified" packages throws this error.
> That kinda makes optifing the libraries a pointless exercise if I can't use
> them later in the buildbot.  And Lib-icu is about 16 MEGS of libraries, so I
> would think it would be a great canidate for optification.     Do I need to
> resubmit everything w/o optification, or are the build bots broken?
>
Have you tried to reproduce this issue in your build environment by
installing your library and base-files locally inside scratchbox?

Below are my attempts to reproduce and fix the problem:

This is what I see in autobulder environment:
> grep /opt$ /var/lib/dpkg/info/base-files.list
/opt
It means that /opt belongs to base-files package.
And I can easily reproduce the error if I try to install any package
with /opt directory inside it:
 > fakeroot apt-get install clucene-core
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  clucene-core
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 319kB of archives.
After unpacking 1085kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  clucene-core
Install these packages without verification [y/N]? y
Get:1 http://osso.stage.dmz fremantle/free clucene-core 0.9.21b-0maemo1 [319kB]
Fetched 319kB in 0s (329kB/s)
/scratchbox/tools/bin/sh: line 1: /usr/sbin/dpkg-preconfigure: No such
file or directory
Selecting previously deselected package clucene-core.
(Reading database ... 6395 files and directories currently installed.)
Unpacking clucene-core (from .../clucene-core_0.9.21b-0maemo1_armel.deb) ...
dpkg: error processing
/var/cache/apt/archives/clucene-core_0.9.21b-0maemo1_armel.deb
(--unpack):
 trying to overwrite `/opt', which is also in package base-files
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/clucene-core_0.9.21b-0maemo1_armel.deb
E: Sub-process /scratchbox/devkits/debian-etch/bin/dpkg returned an
error code (1)

Hmm. Let's remove /opt from base-files.list and see what happens:
Unpacking clucene-core (from .../clucene-core_0.9.21b-0maemo1_armel.deb) ...
dpkg: error processing
/var/cache/apt/archives/clucene-core_0.9.21b-0maemo1_armel.deb
(--unpack):
 error creating directory `./opt': Permission denied
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/clucene-core_0.9.21b-0maemo1_armel.deb

It didn't help, but we can see that dpkg tries to create directory
/opt and fails because symlink /opt already exists.
OK, then. Let's put /opt back to base-files.list and create directory
/opt instead of symlink:
$ sudo rm /scratchbox/users/ed/opt
$ sudo mkdir /scratchbox/users/ed/opt
$ sudo chown ed /scratchbox/users/ed/opt
And try again:
> fakeroot apt-get install clucene-core
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  clucene-core
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0B/319kB of archives.
After unpacking 1085kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  clucene-core
Install these packages without verification [y/N]? y
/scratchbox/tools/bin/sh: line 1: /usr/sbin/dpkg-preconfigure: No such
file or directory
(Reading database ... 6395 files and directories currently installed.)
Unpacking clucene-core (from .../clucene-core_0.9.21b-0maemo1_armel.deb) ...
Setting up clucene-core (0.9.21b-0maemo1) ...

It works! Hurray! :)

So, my conclusion is this is scratchbox problem, not autobuilder one.
It's not autobuilder, who creates /opt symlinks. They're created by
scratchbox for each user.
May be scratchbox guys can explain how to fix it properly. Of course I
can remove symlinks and create directories instead for all builders,
but may be there is better way to solve the problem?

-- 
BR,
Ed
More information about the maemo-developers mailing list