Changeset 47

Show
Ignore:
Timestamp:
20/11/06 00:00:19 (5 years ago)
Author:
andy
Message:

Fix bug #33 "Backing up homedir to homedir causes infinite loop" and bug #34 "Can't backup broken symlinks"

Location:
trunk/src/pybackpack
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/pybackpack/gui.py

    r45 r47  
    521521                                for dirname, dirs, files in os.walk(path): 
    522522                                        for file in files: 
    523                                                 buf.insert(buf.get_end_iter(), "   %s" % os.path.join(dirname,file)) 
    524                                                 if os.access(os.path.join(dirname,file), os.R_OK): 
     523                                                fullpath = os.path.join(dirname,file) 
     524                                                buf.insert(buf.get_end_iter(), "   %s" % fullpath) 
     525                                                # We might be backing up a broken symlink, but who cares, we're not following them 
     526                                                if os.path.islink(fullpath): 
    525527                                                        filecount += 1 
    526                                                         buf.insert(buf.get_end_iter(), " [OK]\n") 
     528                                                        # buf.insert(buf.get_end_iter(), " [OK:SYM]\n") 
     529                                                elif os.access(fullpath, os.R_OK): 
     530                                                        filecount += 1 
     531                                                        # buf.insert(buf.get_end_iter(), " [OK]\n") 
    527532                                                else: 
    528                                                         problems.append((os.path.join(dirname,file), "File")) 
    529                                                         buf.insert(buf.get_end_iter(), " [ERR]\n") 
     533                                                        problems.append((fullpath, "File")) 
     534                                                        # buf.insert(buf.get_end_iter(), " [ERR]\n") 
    530535                                        for dir in dirs: 
    531                                                 if os.access(os.path.join(dirname,dir), os.R_OK|os.X_OK): 
     536                                                fullpath = os.path.join(dirname,dir) 
     537                                                if os.access(fullpath, os.R_OK|os.X_OK): 
    532538                                                        filecount += 1 
    533539                                                else: 
    534                                                         problems.append((os.path.join(dirname,dir),"Directory")) 
     540                                                        problems.append((fullpath,"Directory")) 
    535541                        elif os.access(path, os.R_OK): 
    536542                                filecount += 1 
  • trunk/src/pybackpack/rdiff_interface.py

    r45 r47  
    238238        exitfunction = sys.exit 
    239239        sys.exit = SysExit 
    240         arglist = ['--terminal-verbosity', '5', '--verbosity', '9', '--include-globbing-filelist', setspath+set['path']+"/filelist", "/", dest] 
     240        arglist = ['--terminal-verbosity', '5', '--verbosity', '9', '--exclude', dest, '--include-globbing-filelist', setspath+set['path']+"/filelist", "/", dest] 
    241241        sys.stdout = output 
    242242        sys.stderr = err_output