|
Lines 493-506
Link Here
|
| 493 |
OUT.debug('Trying to softlink', 8) |
493 |
OUT.debug('Trying to softlink', 8) |
| 494 |
|
494 |
|
| 495 |
if not self.__p: |
495 |
if not self.__p: |
|
|
496 |
if self.__v: |
| 497 |
print("\n>>> SOFTLINKING FILE: ") |
| 498 |
print(">>> Source: " + src_name + |
| 499 |
"\n>>> Destination: " + dst_name + "\n") |
| 496 |
os.symlink(src_name, dst_name) |
500 |
os.symlink(src_name, dst_name) |
| 497 |
|
501 |
|
| 498 |
my_contenttype = 'sym' |
502 |
my_contenttype = 'sym' |
| 499 |
|
503 |
|
| 500 |
except Exception as e: |
504 |
except Exception as e: |
| 501 |
|
505 |
|
| 502 |
if self.__v: |
506 |
if self.__v: |
| 503 |
OUT.warn('Failed to softlink (' + str(e) + ')') |
507 |
OUT.warn('Failed to softlink (' + str(e) + ')') |
|
|
508 |
|
| 509 |
elif self.__link_type == 'clone': |
| 510 |
try: |
| 511 |
|
| 512 |
OUT.debug('Trying to copy files directly', 8) |
| 513 |
|
| 514 |
if not self.__p: |
| 515 |
if self.__v: |
| 516 |
print("\n>>> COPYING FILE: ") |
| 517 |
print(">>> Source: " + src_name + |
| 518 |
"\n>>> Destination: " + dst_name + "\n") |
| 519 |
shutil.copy(src_name, dst_name) |
| 520 |
|
| 521 |
my_contenttype = 'file' |
| 522 |
|
| 523 |
except Exception as e: |
| 524 |
|
| 525 |
if self.__v: |
| 526 |
OUT.warn('Failed to copy (' + str(e) + ')') |
| 504 |
|
527 |
|
| 505 |
elif os.path.islink(src_name): |
528 |
elif os.path.islink(src_name): |
| 506 |
try: |
529 |
try: |
|
Lines 508-513
Link Here
|
| 508 |
OUT.debug('Trying to copy symlink', 8) |
531 |
OUT.debug('Trying to copy symlink', 8) |
| 509 |
|
532 |
|
| 510 |
if not self.__p: |
533 |
if not self.__p: |
|
|
534 |
if self.__v: |
| 535 |
print("\n>>> SYMLINK COPY: ") |
| 536 |
print(">>> Source: " + src_name + |
| 537 |
"\n>>> Destination: " + dst_name + "\n") |
| 511 |
os.symlink(os.readlink(src_name), dst_name) |
538 |
os.symlink(os.readlink(src_name), dst_name) |
| 512 |
|
539 |
|
| 513 |
my_contenttype = 'sym' |
540 |
my_contenttype = 'sym' |
|
Lines 523-529
Link Here
|
| 523 |
OUT.debug('Trying to hardlink', 8) |
550 |
OUT.debug('Trying to hardlink', 8) |
| 524 |
|
551 |
|
| 525 |
if not self.__p: |
552 |
if not self.__p: |
| 526 |
os.link(src_name, dst_name) |
553 |
if self.__v: |
|
|
554 |
print("\n>>> HARDLINKING FILE: ") |
| 555 |
print(">>> Source: " + src_name + |
| 556 |
"\n>>> Destination: " + dst_name + "\n") |
| 557 |
os.link(src_name, dst_name) |
| 527 |
|
558 |
|
| 528 |
my_contenttype = 'file' |
559 |
my_contenttype = 'file' |
| 529 |
|
560 |
|
|
Lines 533-540
Link Here
|
| 533 |
OUT.warn('Failed to hardlink (' + str(e) + ')') |
564 |
OUT.warn('Failed to hardlink (' + str(e) + ')') |
| 534 |
|
565 |
|
| 535 |
if not my_contenttype: |
566 |
if not my_contenttype: |
|
|
567 |
|
| 536 |
if not self.__p: |
568 |
if not self.__p: |
| 537 |
shutil.copy(src_name, dst_name) |
569 |
if self.__v: |
|
|
570 |
print("\n>>> COPYING FILE: ") |
| 571 |
print(">>> Source: " + src_name + |
| 572 |
"\n>>> Destination: " + dst_name + "\n") |
| 573 |
shutil.copy(src_name, dst_name) |
| 538 |
my_contenttype = 'file' |
574 |
my_contenttype = 'file' |
| 539 |
|
575 |
|
| 540 |
|
576 |
|