Skip to content

Commit

Permalink
version 1.10.1
Browse files Browse the repository at this point in the history
fix database self crc with --posix on windows
  • Loading branch information
elesiuta committed Oct 5, 2021
1 parent a15800a commit 9b1e88b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions backupy/filescanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def getSets(self) -> tuple:
def saveDatabase(self, db_name: str = "database.json") -> None:
"""Write database to config_dir on self and other if enabled"""
self_entry = os.path.join(self.config_dir, "database")
if self.force_posix_path_sep:
self_entry = self_entry.replace(os.path.sep, "/")
self_crc = self.calcDatabaseCrc(self.dict_current)
assert self_entry not in self.dict_current
self.dict_current[self_entry] = {"size": 0, "mtime": 0, "crc": self_crc, "dir": False}
Expand Down Expand Up @@ -119,6 +121,8 @@ def calcDatabaseCrc(self, database: dict) -> str:
def verifyDatabaseCrc(self, database: dict, abs_db_path: str) -> None:
"""Verify the data in the database matches the CRC and pops the entry, otherwise raises exception"""
self_entry = os.path.join(self.config_dir, "database")
if self.force_posix_path_sep:
self_entry = self_entry.replace(os.path.sep, "/")
if self_entry in database:
crc_record = database.pop(self_entry)["crc"]
crc_calc = self.calcDatabaseCrc(database)
Expand Down
2 changes: 1 addition & 1 deletion backupy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


def getVersion() -> str:
return "1.10.0"
return "1.10.1"


def getString(text: str) -> str:
Expand Down

0 comments on commit 9b1e88b

Please sign in to comment.