diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-09-08 15:33:19 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-09-08 15:33:19 +0100 |
commit | bd7b4bcd58998a24149a6e71c603840ffbb3ec62 (patch) | |
tree | eb0cb6a6ee8e2e0b37323499bec9d64ada3c35a4 /obnamlib/plugins/restore_plugin.py | |
parent | acf859f1d445dda1d7541cc9d771ae1e955b2387 (diff) | |
download | obnam-bd7b4bcd58998a24149a6e71c603840ffbb3ec62.tar.gz |
Restore character and block device nodes
Diffstat (limited to 'obnamlib/plugins/restore_plugin.py')
-rw-r--r-- | obnamlib/plugins/restore_plugin.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/obnamlib/plugins/restore_plugin.py b/obnamlib/plugins/restore_plugin.py index 1b191173..2e08dc91 100644 --- a/obnamlib/plugins/restore_plugin.py +++ b/obnamlib/plugins/restore_plugin.py @@ -182,6 +182,8 @@ class RestorePlugin(obnamlib.ObnamPlugin): self.restore_fifo(gen, filename, metadata) elif stat.S_ISSOCK(metadata.st_mode): self.restore_socket(gen, filename, metadata) + elif stat.S_ISBLK(metadata.st_mode) or stat.S_ISCHR(metadata.st_mode): + self.restore_device(gen, filename, metadata) else: msg = ('Unknown file type: %s (%o)' % (filename, metadata.st_mode)) @@ -259,3 +261,8 @@ class RestorePlugin(obnamlib.ObnamPlugin): if self.write_ok: self.fs.mknod('./' + filename, metadata.st_mode) + def restore_device(self, gen, filename, metadata): + logging.debug('restoring device %s' % filename) + if self.write_ok: + self.fs.mknod('./' + filename, metadata.st_mode) + |