X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils.py;h=ef86b5adc736f80ed8afd30814236e9f5a144f1a;hb=8cc4b5cf501b55e4abe98b882f70784da17911d0;hp=40e36cd9c6a1c79111550a616a72ccb095e6320c;hpb=69546c1e264e3333b49830c8f80dc8ab025929f0;p=dak.git diff --git a/utils.py b/utils.py index 40e36cd9..ef86b5ad 100644 --- a/utils.py +++ b/utils.py @@ -1,6 +1,6 @@ # Utility functions # Copyright (C) 2000 James Troup -# $Id: utils.py,v 1.4 2000-11-27 03:15:26 troup Exp $ +# $Id: utils.py,v 1.5 2000-11-30 04:19:30 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -206,6 +206,8 @@ def move (src, dest): os.umask(umask); #print "Moving %s to %s..." % (src, dest); shutil.copy2(src, dest); + if os.path.exists(dest) and stat.S_ISDIR(os.stat(dest)[stat.ST_MODE]): + dest = dest + '/' + os.path.basename(src); os.chmod(dest, 0664); os.unlink(src); @@ -220,6 +222,8 @@ def copy (src, dest): os.umask(umask); #print "Copying %s to %s..." % (src, dest); shutil.copy2(src, dest); + if os.path.exists(dest) and stat.S_ISDIR(os.stat(dest)[stat.ST_MODE]): + dest = dest + '/' + os.path.basename(src); os.chmod(dest, 0664); ######################################################################################