mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-15 23:09:56 +00:00
fix descriptions
This commit is contained in:
@ -67,7 +67,8 @@ class Packages(Properties):
|
||||
:param without_dependencies: if set, dependency check will be disabled
|
||||
"""
|
||||
package = Package.load(source, PackageSource.AUR, self.repository.pacman, self.repository.aur_url)
|
||||
self.repository.database.build_queue_insert(package)
|
||||
|
||||
self.database.build_queue_insert(package)
|
||||
|
||||
with tmpdir() as local_path:
|
||||
Sources.load(local_path, package.git_url, self.database.patches_get(package.base))
|
||||
@ -93,7 +94,8 @@ class Packages(Properties):
|
||||
cache_dir = self.repository.paths.cache_for(package.base)
|
||||
shutil.copytree(Path(source), cache_dir) # copy package to store in caches
|
||||
Sources.init(cache_dir) # we need to run init command in directory where we do have permissions
|
||||
self.repository.database.build_queue_insert(package)
|
||||
|
||||
self.database.build_queue_insert(package)
|
||||
|
||||
self._process_dependencies(cache_dir, known_packages, without_dependencies)
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
||||
from sqlite3 import Connection
|
||||
|
||||
from ahriman.core.configuration import Configuration
|
||||
from ahriman.core.database.data.package_statuses import migrate_package_statuses
|
||||
from ahriman.core.database.data.patches import migrate_patches
|
||||
from ahriman.core.database.data.users import migrate_users_data
|
||||
from ahriman.core.database.data.package_statuses import migrate_package_statuses
|
||||
from ahriman.models.migration_result import MigrationResult
|
||||
from ahriman.models.repository_paths import RepositoryPaths
|
||||
|
||||
@ -37,7 +37,7 @@ def migrate_data(result: MigrationResult, connection: Connection,
|
||||
:param paths: repository paths instance
|
||||
"""
|
||||
# initial data migration
|
||||
if result.old_version == 0:
|
||||
if result.old_version <= 0:
|
||||
migrate_package_statuses(connection, paths)
|
||||
migrate_users_data(connection, configuration)
|
||||
migrate_patches(connection, paths)
|
||||
migrate_users_data(connection, configuration)
|
||||
|
@ -17,8 +17,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from sqlite3 import Connection
|
||||
from typing import List, Optional
|
||||
|
||||
@ -75,7 +73,7 @@ class AuthOperations(Operations):
|
||||
|
||||
def user_update(self, user: User) -> None:
|
||||
"""
|
||||
get user by username
|
||||
update user by username
|
||||
:param user: user descriptor
|
||||
"""
|
||||
def run(connection: Connection) -> None:
|
||||
|
@ -22,6 +22,7 @@ from __future__ import annotations
|
||||
import json
|
||||
import sqlite3
|
||||
|
||||
from pathlib import Path
|
||||
from sqlite3 import Connection
|
||||
from typing import Type
|
||||
|
||||
@ -46,10 +47,20 @@ class SQLite(AuthOperations, BuildOperations, PackageOperations, PatchOperations
|
||||
:param configuration: configuration instance
|
||||
:return: fully initialized instance of the database
|
||||
"""
|
||||
database = cls(configuration.getpath("settings", "database"))
|
||||
path = cls.database_path(configuration)
|
||||
database = cls(path)
|
||||
database.init(configuration)
|
||||
return database
|
||||
|
||||
@staticmethod
|
||||
def database_path(configuration: Configuration) -> Path:
|
||||
"""
|
||||
read database from configuration
|
||||
:param configuration: configuration instance
|
||||
:return: database path according to the configuration
|
||||
"""
|
||||
return configuration.getpath("settings", "database")
|
||||
|
||||
def init(self, configuration: Configuration) -> None:
|
||||
"""
|
||||
perform database migrations
|
||||
|
@ -35,6 +35,7 @@ class PackageSource(Enum):
|
||||
:cvar Directory: source is a directory which contains packages
|
||||
:cvar Local: source is locally stored PKGBUILD
|
||||
:cvar Remote: source is remote (http, ftp etc) link
|
||||
:cvar Repository: source is official repository
|
||||
"""
|
||||
|
||||
Auto = "auto"
|
||||
@ -43,6 +44,7 @@ class PackageSource(Enum):
|
||||
Directory = "directory"
|
||||
Local = "local"
|
||||
Remote = "remote"
|
||||
Repository = "repository"
|
||||
|
||||
def resolve(self, source: str) -> PackageSource:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user