google-code-export / gambas

Automatically exported from code.google.com/p/gambas
1 stars 0 forks source link

COPY snaps symlinks #329

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) Describe the problem.
I discovered this when using the IDE Save Project As... menu item.

If a project contains symlinks, then when Project.CopyProject() issues the 
"Copy sSrc &/ sFile To sDst &/ sFile" command at line 2443, the links are 
snapped and the target files are copied in.

This contrary to the way that shell copies (bash:cp) work.  On a command line 
    cp -R sourceprojectdir targetprojectdir
preserves the symlinks.

I have marked this as an "Other" type as you may have some reason for this 
behaviour.  But here is why I see it as possibly a bug.  We use a lot of 
symlinks in projects to images and boilerplate text and code in the 
"corporate-image" directory.  These are all maintained in one place and when 
changes occur, all the projects that link to them are automagically updated.  

Regardless of the Save Project As... matter, I'd think that any other use of 
the COPY keyword in code could be expected to behave the same, i.e. symlinks 
should be preserved as they are a symlink for some reason.

2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):
N/A

3) Provide a little project that reproduces the bug or the crash.
N/A

4) If your project needs a database, try to provide it, or part of it.
N/A

5) Explain clearly how to reproduce the bug or the crash.
N/A

6) By doing that carefully, you have done 50% of the bug fix job!

IMPORTANT NOTE: if you encounter several different problems or bugs, (for
example, a bug in your project, and an interpreter crash while debugging
it), please create distinct issues!

Original issue reported on code.google.com by adamn...@gmail.com on 13 Sep 2012 at 3:26

GoogleCodeExporter commented 9 years ago

Original comment by benoit.m...@gmail.com on 13 Sep 2012 at 9:04

GoogleCodeExporter commented 9 years ago
Hmmm, just had a thought about this.

There is one exception, if the IDE Packager classes/modules uses Copy when it 
is creating temp dirs to do its' tricks then the symlinks need to be snapped.  
I had a quick look at the IDE code and it does look like there are some Copy's 
in there.

Thinking quickly, I think that this is an internal exception.

I'll have a deeper look tomorrow.

B

Original comment by adamn...@gmail.com on 14 Sep 2012 at 12:22

GoogleCodeExporter commented 9 years ago
I don't understand your last comment. But the bug should have been fixed in 
revision #5166.

Original comment by benoit.m...@gmail.com on 14 Sep 2012 at 11:52

GoogleCodeExporter commented 9 years ago
Confirmed fix in 5166 is OK.  Also my comment is incorrect so please disregard.

However, I may have mislead you with the example.  It's not so much the IDE, I 
believe that COPY is at fault.

Original comment by adamn...@gmail.com on 15 Sep 2012 at 2:54