def hardlink_db001()

in dcrpm/dcrpm.py [0:0]


    def hardlink_db001(self):
        # type: () -> str
        old_path = join(self.args.dbpath, "__db.001")
        new_path = join(self.args.dbpath, "__dcrpm_py_inode_pointer")

        # Make sure it doesn't exist.
        try:
            os.unlink(new_path)
        except OSError:
            pass

        # Then save it.
        try:
            os.link(old_path, new_path)
            return new_path
        except OSError:
            self.status_logger.warning("link_failed")
            raise DcRPMException("Could not save __db.001 failed")