Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefixed tarfilesets, dpkg: error creating directory #54

Open
GoogleCodeExporter opened this issue Jun 12, 2015 · 0 comments
Open

prefixed tarfilesets, dpkg: error creating directory #54

GoogleCodeExporter opened this issue Jun 12, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

If there is a tarfileset whose prefix path is set, and there is another 
tarfileset that contains the parent directory of the prefix path, then dpkg 
will fail to install the package.

The error message displayed by dpkg (or gdebi): 
error creating directory `./usr/share/mireka/bin': No such file or directory

I am using the current trunk with my patch for issue 53 (which likely fixes 
issue 47 too. It is on Windows but likely that does not matter.

Result of dpkg -c, which demonstrates the underlying issue: 
...
./usr/share/mireka/bin/
./usr/
./usr/share/
./usr/share/mireka/
./usr/share/mireka/lib/
./usr/share/mireka/lib/configuration.js
...
./usr/share/mireka/bin/start.sh

Looking at the code of Deb.java, the following happens:
1. It collects those destination directories that has a corresponding actually 
existing source directory. These paths are stored in existingDirs variable.
2. In the _dataFolders variable it collects those destination directories that 
has no corresponding actual source directories. This happens when a tarfileset 
is included with the prefix attribute set. In that case the destination (tar) 
paths will contain the directories that are part of the prefix.
3. It adds the - virtual only - _dataFolders directories to the tar file first, 
and the actual files and directories.
4. Here comes the problem. Assume that we have a prefix /usr/share/mireka/bin 
and that we also have a real file in the real directory /usr/share/mireka/lib/. 
Notice that the beginning of the two paths (/usr/share/mireka) are identical. 
The tar file will start with the virtual/prefix path /usr/share/mireka/bin. It 
does not start with the parent directories of that directory, because those has 
a corresponding real directory, so they are included in the second step. When 
dpkg tries to create the first directory it will fail, because its parent does 
not exist.

I would add that tar - in contrast to dpkg - extracts the files without issues. 
Unfortunately I cannot see an easy solution here.

Original issue reported on code.google.com by [email protected] on 7 Jun 2012 at 10:56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant