From 09252b5dea87e2d07634dc11980c6fcd17383d92 Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Mon, 22 Mar 2010 15:42:03 +0000 Subject: fix migration from 0.82 data store (#1838) Upgrading directly from 0.82 to 0.86/0.88 didn't migrate the data store contents because LayoutManager._is_empty() doesn't check for 0.82 data store entries. This patch fixes _is_empty() to recognize 0.82 data store contents. Signed-off-by: Sascha Silbe --- diff --git a/src/carquinyol/layoutmanager.py b/src/carquinyol/layoutmanager.py index 0b0b91a..8402b6d 100644 --- a/src/carquinyol/layoutmanager.py +++ b/src/carquinyol/layoutmanager.py @@ -114,6 +114,14 @@ class LayoutManager(object): return uids def _is_empty(self): + """Check if there is any existing entry. + + All data store layout versions are handled. Will err on the safe + side (i.e. return False if there might be any entry).""" + if os.path.exists(os.path.join(self._root_path, 'store')): + # unmigrated 0.82 data store + return False + for f in os.listdir(self._root_path): if os.path.isdir(os.path.join(self._root_path, f)) and len(f) == 2: for g in os.listdir(os.path.join(self._root_path, f)): -- cgit v0.9.1