Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 231482 | Differences between
and this patch

Collapse All | Expand All

(-)config.py (-1 / +17 lines)
Lines 486-495 Link Here
486
486
487
        group.add_option('--soft',
487
        group.add_option('--soft',
488
                         action='store_true',
488
                         action='store_true',
489
                         help = 'Use symbolic links instead of hard links'
489
                         help  = 'Use symbolic links instead of hard links'
490
                         ' when creating virtual files. <NOTE>: some pack'
490
                         ' when creating virtual files. <NOTE>: some pack'
491
                         'ages will not work if you use this option')
491
                         'ages will not work if you use this option')
492
492
493
        group.add_option('--cp',
494
                         '--copy',
495
                         action='store_true',
496
                         help  = 'Directly copy the webapp files from'
497
             ' the /usr/share/webapps/ directory when installing'
498
             ' the webapp.')
499
493
        group.add_option('--virtual-files',
500
        group.add_option('--virtual-files',
494
                         '--vf',
501
                         '--vf',
495
                         type = 'choice',
502
                         type = 'choice',
Lines 845-850 Link Here
845
                            'user'         : 'vhost_config_uid',
852
                            'user'         : 'vhost_config_uid',
846
                            'group'        : 'vhost_config_gid',
853
                            'group'        : 'vhost_config_gid',
847
                            'soft'         : 'g_soft',
854
                            'soft'         : 'g_soft',
855
                            'copy'         : 'g_copy',
848
                            'virtual_files': 'vhost_config_virtual_files',
856
                            'virtual_files': 'vhost_config_virtual_files',
849
                            'default_dirs' : 'vhost_config_default_dirs',
857
                            'default_dirs' : 'vhost_config_default_dirs',
850
                            'pretend'      : 'g_pretend',
858
                            'pretend'      : 'g_pretend',
Lines 990-995 Link Here
990
            OUT.debug('Selecting soft links' , 7)
998
            OUT.debug('Selecting soft links' , 7)
991
999
992
            self.config.set('USER', 'g_link_type', 'soft')
1000
            self.config.set('USER', 'g_link_type', 'soft')
1001
1002
        elif (self.config.has_option('USER', 'g_copy') and 
1003
              self.config.getboolean('USER', 'g_copy')):
1004
	
1005
            OUT.debug('Selecting copying of links', 7)
1006
1007
            self.config.set('USER', 'g_link_type', 'clone')
1008
993
        else:
1009
        else:
994
1010
995
            OUT.debug('Selecting hard links' , 7)
1011
            OUT.debug('Selecting hard links' , 7)
(-)worker.py (-1 / +37 lines)
Lines 493-500 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:
Lines 502-513 Link Here
502
                    if self.__v:
506
                    if self.__v:
503
                        OUT.warn('Failed to softlink (' + str(e) + ')')
507
                        OUT.warn('Failed to softlink (' + str(e) + ')')
504
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) + ')')
527
505
            elif os.path.islink(src_name):
528
            elif os.path.islink(src_name):
506
                try:
529
                try:
507
530
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-528 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:
553
                        if self.__v:
554
                            print("\n>>> HARDLINKING FILE: ")
555
                            print(">>> Source: " + src_name +
556
                                  "\n>>> Destination: " + dst_name + "\n")
526
                        os.link(src_name, dst_name)
557
                        os.link(src_name, dst_name)
527
558
528
                    my_contenttype = 'file'
559
                    my_contenttype = 'file'
Lines 533-539 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:
569
                if self.__v:
570
                    print("\n>>> COPYING FILE: ")
571
                    print(">>> Source: " + src_name +
572
                          "\n>>> Destination: " + dst_name + "\n")
537
                shutil.copy(src_name, dst_name)
573
                shutil.copy(src_name, dst_name)
538
            my_contenttype = 'file'
574
            my_contenttype = 'file'

Return to bug 231482