![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package backup-manager checked in at Tue Oct 14 17:47:24 CEST 2008. -------- --- GNOME/backup-manager/backup-manager.changes 2008-10-01 22:39:47.000000000 +0200 +++ /mounts/work_src_done/STABLE/backup-manager/backup-manager.changes 2008-10-14 15:52:45.208142000 +0200 @@ -1,0 +2,7 @@ +Tue Oct 14 16:02:26 CEST 2008 - crivera@suse.de + +- Fix a problem with how paths are handled when restoring individual + files. +- Allow the backup path to be a FUSE mount. + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ backup-manager.spec ++++++ --- /var/tmp/diff_new_pack.B29523/_old 2008-10-14 17:44:15.000000000 +0200 +++ /var/tmp/diff_new_pack.B29523/_new 2008-10-14 17:44:15.000000000 +0200 @@ -25,7 +25,7 @@ Requires: python >= 2.6 python-gtk python-setuptools rdiff-backup PolicyKit PolicyKit-gnome dbus-1 dbus-1-python libnotify AutoReqProv: on Version: 0.1.0 -Release: 7 +Release: 8 Summary: A simple backup application for GNOME Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -74,6 +74,10 @@ %postun %changelog +* Tue Oct 14 2008 crivera@suse.de +- Fix a problem with how paths are handled when restoring individual + files. +- Allow the backup path to be a FUSE mount. * Thu Oct 02 2008 crivera@suse.de - Remove bundled json module and use python 2.6's standard module. ++++++ backup-manager-0.1.0.tar.gz ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/backup-manager-0.1.0/backup_manager/core.py new/backup-manager-0.1.0/backup_manager/core.py --- old/backup-manager-0.1.0/backup_manager/core.py 2008-10-01 06:42:56.000000000 +0200 +++ new/backup-manager-0.1.0/backup_manager/core.py 2008-10-10 05:34:39.000000000 +0200 @@ -2,6 +2,7 @@ import os import pwd import time +import string import subprocess import json import errno @@ -48,6 +49,10 @@ ret += "%s: %s\n" % (k, v) return ret + def remove (self, name): + if self.__dict__.has_key (name): + del self.__dict__[name] + def load (self, conf): fo = file (conf, 'r') self.__dict__ = json.loads (fo.read ()) @@ -204,14 +209,15 @@ return ret / 1024 -def get_mount_point (path): +def get_mount_info (path): mp = None mp_len = 0 mp_dev = None + mp_type = None fo = file ('/proc/mounts', 'r') for l in fo: - if l[0] != '/': + if l.startswith ("rootfs"): continue fields = l.split (' ') @@ -219,9 +225,10 @@ mp = fields[1] mp_len = len (fields[1]) mp_dev = fields[0] + mp_type = fields[2] fo.close () - return mp, mp_dev + return mp, mp_dev, mp_type def get_volume_info (): """Returns a hash of tuples (mount_point, label, device) keyed of uuid""" @@ -240,16 +247,42 @@ dev.GetProperty ("block.device")) return ret -def find_backup_path (config): - vol_info = get_volume_info () - if not vol_info.has_key (config.device_uuid): - raise BackupManagerException ("Backup device is not attached") +def set_backup_path (config, path): + mp, dev, typ = get_mount_info (path) + if typ.find ("fuse") != -1: + config.fuse_type = typ + config.fuse_name = dev + config.fuse_path = path + config.remove ("backup_path") + config.remove ("device_uuid") + else: + i = string.find (path, mp) + config.backup_path = path[i + len (mp):] + config.device_uuid = uuid_from_device (dev) + config.remove ("fuse_type") + config.remove ("fuse_name") + config.remove ("fuse_path") + +def get_backup_path (config): + if config.fuse_type: + mp, dev, typ = get_mount_info (config.fuse_path) + if typ != config.fuse_type: + raise BackupManagerException ("FUSE backup path is not mounted") + + if dev != config.fuse_name: + raise BackupManagerException ("FUSE backup path is using a different target") - mp, label, dev = vol_info[config.device_uuid] - if not mp or mp == "": - raise BackupManagerException ("Backup device is not mounted") + return config.fuse_path + else: + vol_info = get_volume_info () + if not vol_info.has_key (config.device_uuid): + raise BackupManagerException ("Backup device is not attached") + + mp, label, dev = vol_info[config.device_uuid] + if not mp or mp == "": + raise BackupManagerException ("Backup device is not mounted") - return os.path.join (mp, config.backup_path) + return os.path.join (mp, config.backup_path) def uuid_from_device (dev): vol_info = get_volume_info () diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/backup-manager-0.1.0/backup_manager/rdiff.py new/backup-manager-0.1.0/backup_manager/rdiff.py --- old/backup-manager-0.1.0/backup_manager/rdiff.py 2008-10-01 06:53:43.000000000 +0200 +++ new/backup-manager-0.1.0/backup_manager/rdiff.py 2008-10-10 05:32:26.000000000 +0200 @@ -40,7 +40,7 @@ def backup (self, config): self.verify_config (config) - path = find_backup_path (config) + path = get_backup_path (config) hd = pwd.getpwnam (os.getlogin ())[5] use_fl = self._generate_file_list (config, get_file_list_location (), hd) @@ -72,19 +72,19 @@ if subprocess.call (["rdiff-backup", "--version"]) != 0: raise BackupManagerException (_("Failed to find rdiff-backup")) - path = find_backup_path (config) + path = get_backup_path (config) hd = pwd.getpwnam (os.getlogin ())[5] - hd_mp, hd_dev = get_mount_point (hd) - bp_mp, bp_dev = get_mount_point (path) + hd_mp, hd_dev, hd_type = get_mount_info (hd) + bp_mp, bp_dev, bp_type = get_mount_info (path) if hd_mp == None: raise BackupManagerException (_("Unable to get mount point for %s") % hd) if bp_mp == None: raise BackupManagerException (_("Unable to get mount point for %s") % path) - - if hd_mp == bp_mp: - raise BackupManagerException (_("%s and %s can't be on the same partition") % (hd, path)) + + if hd_dev == bp_dev: + raise BackupManagerException (_("'%s' and '%s' can't be on the same device") % (hd, path)) if not os.access (path, os.R_OK | os.W_OK): raise BackupManagerException (_("You don't have read-write access to %s") % path) @@ -146,8 +146,8 @@ src_len = len (src) for f in files: - df = os.path.join (dest, f[src_len:]) - + df = dest + os.path.sep + f[src_len:] + try: os.makedirs (os.path.dirname (df), mode=0755) os.chmod (os.path.dirname (df), 0755) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/backup-manager-0.1.0/backup_manager/restore.py new/backup-manager-0.1.0/backup_manager/restore.py --- old/backup-manager-0.1.0/backup_manager/restore.py 2008-10-01 06:56:43.000000000 +0200 +++ new/backup-manager-0.1.0/backup_manager/restore.py 2008-10-10 04:55:14.000000000 +0200 @@ -69,9 +69,9 @@ self._backup_device_chooser = gtk.FileChooserButton (_("Select Backup Device")) self._backup_device_chooser.set_action (gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) - if self._config.device_uuid: + if self._config.device_uuid or self._config.fuse_type: try: - self._path = find_backup_path (config) + self._path = get_backup_path (config) label = gtk.Label(self._path) label.set_alignment (0.0, 0.5) self._location_hbox.pack_start (label) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/backup-manager-0.1.0/backup_manager/settings.py new/backup-manager-0.1.0/backup_manager/settings.py --- old/backup-manager-0.1.0/backup_manager/settings.py 2008-10-01 05:48:10.000000000 +0200 +++ new/backup-manager-0.1.0/backup_manager/settings.py 2008-10-10 01:10:01.000000000 +0200 @@ -101,9 +101,9 @@ else: self._include_radio.set_active (True) - if self._config.device_uuid: + if self._config.device_uuid or self._config.fuse_type: try: - path = find_backup_path (self._config) + path = get_backup_path (self._config) self._chooser_button.set_current_folder (path) except BackupManagerException, e: print >> sys.stderr, str (e) @@ -130,11 +130,7 @@ self._config.backup_schedule = self._backup_combo.get_active () fn = self._chooser_button.get_filename() - mp, dev = get_mount_point (fn) - i = string.find (fn, mp) - - self._config.backup_path = fn[i + len (mp):] - self._config.device_uuid = uuid_from_device (dev) + set_backup_path (self._config, fn) self._config.backup_time = "%s:%s:%s" % (self._hour_spin_button.get_value_as_int (), self._minute_spin_button.get_value_as_int (), ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org