Tricky cases

A package rarely contains only regular files. Most often, it contains oddities like directories or even symbolic links . This section explains how list2pkg deals with those when they are part of the file list.

Directories

list2pkg tries to preserve a directory's permission and ownership. However, as previously mentioned, it will not copy its content if it is not explicitly given in the file list. For example, if the file list contains only /home, the package will only have an empty /home directory in it.

Symbolic links

A symbolic link can be in the file list in two ways: it can be explicitly given, i.e as if it were a regular file, or it can be implicitly given, i.e as if it was part of the file's path.

For example, if /lib/libc.so.6 is a symbolic link to libc-2.7.so , and /lib/libc.so.6 is given on the file list, then it is considered an explicit symlink. However, if /usr/share/man is a symlink to /usr/man, and one file which is in the file list is /usr/share/man/man1/ld.1 , then it is considered an implicit symlink.

Explicit symlinks are copied as is to the package tree directory. Regardless of whether they are absolute or relative symlinks, they should be recreated on the target system.

On the other hand, path involving implicit symlinks are not created as they are given on the file list. Instead, all symbolic links are first resolved before the file's copy. Therefore, if we take our /usr/share/man/man1/ld.1 example, it will be created as /usr/man/man1/ld.1 in the package.