Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <17F5FEED8AA6D41185B100508BAF1B0608E3EF45@meteor.tls.fr.astrium.corp> From: "ZXPLESPAC001, Ext" To: "'Cygwin List'" Subject: RE: tar and the symlinks Date: Tue, 6 Jul 2004 09:49:29 +0200 MIME-Version: 1.0 Content-type: multipart/mixed; boundary="=_IS_MIME_Boundary" --=_IS_MIME_Boundary Content-Type: text/plain; charset="ISO-8859-1" > -----Original Message----- > From: Larry Hall [mailto:cygwin-lh AT cygwin DOT com] > Sent: Monday, July 05, 2004 8:09 PM > To: lassauge AT users DOT sourceforge DOT net; 'cygwin AT sources DOT redhat DOT com' > Subject: Re: tar and the symlinks > > > At 06:54 AM 7/5/2004, you wrote: > > Hi, > >I (tried to) read the FAQ carefully and did'nt find a clue. > > > >The problem is for the packaging of applications that install > >some of their files in a directory that is a link. > >On NT4 I have a strange behavior: the directory is hidding > >the link and the files didn't mix. OK, I know that my english is not > >very clear (sorry but I'm french :->), > > > I'm sorry too. ;-) ;-) ;-) > > >so let's explain with an > >example: > > > >1/ I am porting the xlockmore application. This is an X11 program > >and after being compiled and configured the X11 resource files > >will be installed in $prefix/lib/X11/app-defaults (prefix is > /usr/X11R6) > >2/ I package the file within a bzip2 compress tar-ball, and this tar > >(for example for the motif GUI xmlock) contains: > >usr/ > >usr/X11R6/ > >usr/X11R6/bin/ > >usr/X11R6/bin/xmlock.exe > >usr/X11R6/lib/ > >usr/X11R6/lib/X11/ > >usr/X11R6/lib/X11/app-defaults/ > >usr/X11R6/lib/X11/app-defaults/XmLock > >3/ after using setup to install this package I have in /usr/X11R6 > >a directory named app-defaults (which is "hiding" the > symlink for the > >initial app-defaults which is a link to /etc/X11/app-defaults and is > >created when installing xorg): > > > Right. This is standard 'tar' behavior. There's nothing > Cygwin specific > here. 'tar's info page has this to say: > > > When extracting files, if `tar' discovers that the extracted file > already exists, it normally replaces the file by removing it before > extracting it, to prevent confusion in the presence of hard > or symbolic > links. (If the existing file is a symbolic link, it is removed, not > followed.) However, if a directory cannot be removed because it is > nonempty, `tar' neither removes it nor modifies its ownership, > permissions, or time stamps. OK. This is tar normal behavior (never really asked myself what tar was doing in that case). I even tried this on a linux box: [user AT linux]$ tree . |-- link_to_dir -> real_dir/ |-- package.tar.bz2 |-- real_dir | `-- real_file `-- temp_root_for_package `-- link_to_dir `-- added_file [user AT linux]$ tar xvjf package.tar.bz2 ./ ./link_to_dir/ ./link_to_dir/added_file [user AT linux]$ tree . |-- link_to_dir | `-- added_file |-- package.tar.bz2 |-- real_dir | `-- real_file `-- temp_root `-- link_to_dir `-- added_file The answer to my question is finally: "you have to know that a dir in your install tree is a symlink before doing the package." and "you MUST use the real dir name (not the link) when packaging you application" (maybe this should be added somewhere in the packager documentation ?). Maybe setup.exe could verify that before installing ? > > To be more cautious and prevent existing files from being replaced, > use the `--keep-old-files' (`-k') option. It causes `tar' to > refuse to > replace or update a file that already exists, i.e., a file with the > same name as an archive member prevents extraction of that archive > member. Instead, it reports an error. > > To be more aggressive about altering existing files, use the > `--overwrite' option. It causes `tar' to overwrite existing files and > to follow existing symbolic links when extracting. The > `--overwrite-dir' option is somewhat more conservative than > `--overwrite': it overwrites metadata (ownership, permission, > etc.) for > directories, but removes other files before extracting them. > > > Make sense? > > > -- > Larry Hall http://www.rfk.com > RFK Partners, Inc. (508) 893-9779 - RFK Office > 838 Washington Street (508) 893-9889 - FAX > Holliston, MA 01746 > > -- Eric Lassauge ASTRIUM - SPACEBEL - TRASYS G2i --=_IS_MIME_Boundary Content-Type: text/plain;charset=us-ascii; name="important_notice.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="important_notice.txt" --------------------------------------------------------- CE COURRIER ELECTRONIQUE EST A USAGE STRICTEMENT INFORMATIF ET NE SAURAIT ENGAGER DE QUELQUE MANIERE QUE CE SOIT EADS ASTRIUM SAS, NI SES FILIALES. SI UNE ERREUR DE TRANSMISSION OU UNE ADRESSE ERRONEE A MAL DIRIGE CE COURRIER, MERCI D'EN INFORMER L'EXPEDITEUR EN LUI FAISANT UNE REPONSE PAR COURRIER ELECTRONIQUE DES RECEPTION. SI VOUS N'ETES PAS LE DESTINATAIRE DE CE COURRIER, VOUS NE DEVEZ PAS L'UTILISER, LE CONSERVER, EN FAIRE ETAT, LE DISTRIBUER, LE COPIER, L'IMPRIMER OU EN REVELER LE CONTENU A UNE TIERCE PARTIE. This email is for information only and will not bind EADS Astrium SAS in any contract or obligation, nor its subsidiaries. If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it. --------------------------------------------------------- --=_IS_MIME_Boundary Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --=_IS_MIME_Boundary--