256
256
ti.mode = self.mode
257
257
ti.uid, ti.gid = self.stat.st_uid, self.stat.st_gid
258
258
if self.stat.st_mtime < 0:
259
log.Warn("Warning: %s has negative mtime, treating as 0."
259
log.Warn(_("Warning: %s has negative mtime, treating as 0.")
260
260
% (self.get_relative_path(),))
323
323
def log_diff(log_string):
324
log_str = "Difference found: " + log_string
324
log_str = _("Difference found:") + " " + log_string
325
325
log.Log(log_str % (self.get_relative_path(),), 4)
327
327
if not self.type and not other.type:
329
329
if not self.stat and other.stat:
330
log_diff("New file %s")
330
log_diff(_("New file %s"))
332
332
if not other.stat and self.stat:
333
log_diff("File %s is missing")
333
log_diff(_("File %s is missing"))
335
335
if self.type != other.type:
336
log_diff("File %%s has type %s, expected %s" %
336
log_diff(_("File %%s has type %s, expected %s") %
337
337
(other.type, self.type))
340
340
if self.isreg() or self.isdir() or self.isfifo():
341
341
if not self.perms_equal(other):
342
log_diff("File %%s has permissions %o, expected %o" %
342
log_diff(_("File %%s has permissions %o, expected %o") %
343
343
(other.getperms(), self.getperms()))
345
345
if ((int(self.stat.st_mtime) != int(other.stat.st_mtime)) and
346
346
(self.stat.st_mtime > 0 or other.stat.st_mtime > 0)):
347
log_diff("File %%s has mtime %s, expected %s" %
347
log_diff(_("File %%s has mtime %s, expected %s") %
348
348
(dup_time.timetopretty(int(other.stat.st_mtime)),
349
349
dup_time.timetopretty(int(self.stat.st_mtime))))
360
360
if self.symtext == other.symtext:
363
log_diff("Symlink %%s points to %s, expected %s" %
363
log_diff(_("Symlink %%s points to %s, expected %s") %
364
364
(other.symtext, self.symtext))
366
366
elif self.isdev():
367
367
if not self.perms_equal(other):
368
log_diff("File %%s has permissions %o, expected %o" %
368
log_diff(_("File %%s has permissions %o, expected %o") %
369
369
(other.getperms(), self.getperms()))
371
371
if self.devnums != other.devnums:
372
log_diff("Device file %%s has numbers %s, expected %s"
372
log_diff(_("Device file %%s has numbers %s, expected %s")
373
373
% (other.devnums, self.devnums))
517
517
"""Make a directory at specified path"""
518
log.Log("Making directory %s" % (self.name,), 7)
518
log.Log(_("Making directory %s") % (self.name,), 7)
520
520
os.mkdir(self.name)
536
536
"""Open the file, write 0 bytes, close"""
537
log.Log("Touching %s" % (self.name,), 7)
537
log.Log(_("Touching %s") % (self.name,), 7)
538
538
fp = self.open("wb")
541
541
def deltree(self):
542
542
"""Remove self by recursively deleting files under it"""
543
543
import duplicity.selection as selection # todo: avoid circ. dep. issue
544
log.Log("Deleting tree %s" % (self.name,), 7)
544
log.Log(_("Deleting tree %s") % (self.name,), 7)
545
545
itr = IterTreeReducer(PathDeleter, [])
546
546
for path in selection.Select(self).set_iter():
547
547
itr(path.index, path)