I have written a small script for adding a symbolic link to a tar file.

Let's say that you would normally create a symbolic link in your file
system as follows:

    ln -s /usr/lib/libdog.so /usr/lib/libcat.so

Well in order to do this within a tar file, you would invoke my script with
4 arguments like this:

    addsymlink [archive] [target] [directory] [link]

    addsymlink mytarfile.tar /usr/lib/libdog.so /usr/lib libcat.so

Internally my script does the following:
* Create a symbolic link in "/tmp" and have it point to "/usr/lib/libdog.so"
* Use "tar -r"  along with "--transform" to add the symbolic link to the
tar file
* Delete the temporary link

Is there a better way of doing this?

Should a new command line option be added to the 'tar' program so that we
can do something like the following?:

    tar -f mytarfile.tar --add-symlink /usr/lib/libdog.so /usr/lib/libcat.so

Reply via email to