Removed unused variables
Changed update-repo in order to support rebuilding the database file in a temp dir instead of inplace