fix case in which if no source PKGBUILDs were updated, an exception will occur

This commit is contained in:
Evgenii Alekseev 2022-11-03 02:59:15 +02:00
parent 2f8316ecb0
commit 4a5b9d9fa1
10 changed files with 90 additions and 87 deletions

View File

@ -705,43 +705,47 @@ Other topics
How does it differ from %another-manager%? How does it differ from %another-manager%?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Short answer - I do not know. Short answer - I do not know. Also for some references credits to `Alad <https://github.com/AladW>`_, he `did <https://wiki.archlinux.org/title/User:Alad/Local_repo_tools>`_ really good investigation of existing alternatives.
`arch-repo-manager <https://github.com/Martchus/arch-repo-manager>`_
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Looks actually pretty good, in case if I would find it, I would probably didn't start this project, most of features (like web interface or additional helpers) are already implemented or planned to be. However, this project seems to be at early alpha stage (as for Nov 2022), written in C++ (not pro or con) and misses code documentation.
`archrepo2 <https://github.com/lilydjwg/archrepo2>`_ `archrepo2 <https://github.com/lilydjwg/archrepo2>`_
"""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""
Don't know, haven't tried it. But it lacks of documentation at least. Don't know, haven't tried it. But it lacks of documentation at least.
* Web interface. * ``ahriman`` has web interface.
* No synchronization and reporting. * ``archrepo2`` doesn't have synchronization and reporting.
* ``archrepo2`` actively uses direct shell calls and ``yaourt`` components. * ``archrepo2`` actively uses direct shell calls and ``yaourt`` components.
* It has constantly running process instead of timer process (it is not pro or con). * ``archrepo2`` has constantly running process instead of timer process (it is not pro or con).
`repoctl <https://github.com/cassava/repoctl>`_ `repoctl <https://github.com/cassava/repoctl>`_
""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""
* Web interface. * ``ahriman`` has web interface.
* No reporting. * ``repoctl`` does not have reporting feature.
* Local packages and patches support. * ``repoctl`` does not support local packages and patches.
* Some actions are not fully automated (e.g. package update still requires manual intervention for the build itself). * Some actions are not fully automated in ``repoctl`` (e.g. package update still requires manual intervention for the build itself).
* ``repoctl`` has better AUR interaction features. With colors! * ``repoctl`` has better AUR interaction features. With colors!
* ``repoctl`` has much easier configuration and even completion. * ``repoctl`` has much easier configuration and even completion.
* ``repoctl`` is able to store old packages. * ``repoctl`` is able to store old packages.
* Ability to host repository from same command vs external services (e.g. nginx) in ``ahriman``. * Ability to host repository from same command in ``repoctl`` vs external services (e.g. nginx) in ``ahriman``.
`repo-scripts <https://github.com/arcan1s/repo-scripts>`_ `repo-scripts <https://github.com/arcan1s/repo-scripts>`_
""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""
Though originally I've created ahriman by trying to improve the project, it still lacks a lot of features: Though originally I've created ahriman by trying to improve the project, it still lacks a lot of features:
* Web interface. * ``ahriman`` has web interface.
* Better reporting with template support. * ``ahriman`` has better reporting with template support.
* Synchronization features (there was only ``rsync`` based). * ``ahriman`` has more synchronization features (there was only ``rsync`` based).
* Local packages and patches support. * ``ahriman`` supports local packages and patches.
* No dependency management. * ``repo-scripts`` doesn't have dependency management.
* And so on.
``repo-scripts`` also have bad architecture and bad quality code and uses out-of-dated ``yaourt`` and ``package-query``. ...and so on. ``repo-scripts`` also has bad architecture and bad quality code and uses out-of-dated ``yaourt`` and ``package-query``.
`toolbox <https://github.com/chaotic-aur/toolbox>`_ `toolbox <https://github.com/chaotic-aur/toolbox>`_
""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""

View File

@ -216,7 +216,7 @@ class Sources(LazyLogging):
""" """
if commit_message is None: if commit_message is None:
commit_message = f"Autogenerated commit at {datetime.datetime.utcnow()}" commit_message = f"Autogenerated commit at {datetime.datetime.utcnow()}"
Sources._check_output("git", "commit", "--all", "--message", commit_message, Sources._check_output("git", "commit", "--allow-empty", "--message", commit_message,
exception=None, cwd=sources_dir, logger=self.logger) exception=None, cwd=sources_dir, logger=self.logger)
def diff(self, sources_dir: Path) -> str: def diff(self, sources_dir: Path) -> str:

View File

@ -1,21 +1,21 @@
# #
# copyright (c) 2021-2022 ahriman team. # Copyright (c) 2021-2022 ahriman team.
# #
# this file is part of ahriman # This file is part of ahriman
# (see https://github.com/arcan1s/ahriman). # (see https://github.com/arcan1s/ahriman).
# #
# this program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the gnu general public license as published by # it under the terms of the GNU General Public License as published by
# the free software foundation, either version 3 of the license, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# this program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# merchantability or fitness for a particular purpose. see the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# gnu general public license for more details. # GNU General Public License for more details.
# #
# you should have received a copy of the gnu general public license # You should have received a copy of the GNU General Public License
# along with this program. if not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
from ahriman.core.formatters.printer import Printer from ahriman.core.formatters.printer import Printer
from ahriman.core.formatters.string_printer import StringPrinter from ahriman.core.formatters.string_printer import StringPrinter

View File

@ -1,21 +1,21 @@
# #
# copyright (c) 2021-2022 ahriman team. # Copyright (c) 2021-2022 ahriman team.
# #
# this file is part of ahriman # This file is part of ahriman
# (see https://github.com/arcan1s/ahriman). # (see https://github.com/arcan1s/ahriman).
# #
# this program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the gnu general public license as published by # it under the terms of the GNU General Public License as published by
# the free software foundation, either version 3 of the license, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# this program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# merchantability or fitness for a particular purpose. see the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# gnu general public license for more details. # GNU General Public License for more details.
# #
# you should have received a copy of the gnu general public license # You should have received a copy of the GNU General Public License
# along with this program. if not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
from ahriman.core.gitremote.remote_pull_trigger import RemotePullTrigger from ahriman.core.gitremote.remote_pull_trigger import RemotePullTrigger
from ahriman.core.gitremote.remote_push_trigger import RemotePushTrigger from ahriman.core.gitremote.remote_push_trigger import RemotePushTrigger

View File

@ -1,21 +1,21 @@
# #
# copyright (c) 2021-2022 ahriman team. # Copyright (c) 2021-2022 ahriman team.
# #
# this file is part of ahriman # This file is part of ahriman
# (see https://github.com/arcan1s/ahriman). # (see https://github.com/arcan1s/ahriman).
# #
# this program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the gnu general public license as published by # it under the terms of the GNU General Public License as published by
# the free software foundation, either version 3 of the license, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# this program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# merchantability or fitness for a particular purpose. see the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# gnu general public license for more details. # GNU General Public License for more details.
# #
# you should have received a copy of the gnu general public license # You should have received a copy of the GNU General Public License
# along with this program. if not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
import shutil import shutil

View File

@ -1,21 +1,21 @@
# #
# copyright (c) 2021-2022 ahriman team. # Copyright (c) 2021-2022 ahriman team.
# #
# this file is part of ahriman # This file is part of ahriman
# (see https://github.com/arcan1s/ahriman). # (see https://github.com/arcan1s/ahriman).
# #
# this program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the gnu general public license as published by # it under the terms of the GNU General Public License as published by
# the free software foundation, either version 3 of the license, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# this program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# merchantability or fitness for a particular purpose. see the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# gnu general public license for more details. # GNU General Public License for more details.
# #
# you should have received a copy of the gnu general public license # You should have received a copy of the GNU General Public License
# along with this program. if not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
from ahriman.core.configuration import Configuration from ahriman.core.configuration import Configuration
from ahriman.core.gitremote.remote_pull import RemotePull from ahriman.core.gitremote.remote_pull import RemotePull

View File

@ -1,21 +1,21 @@
# #
# copyright (c) 2021-2022 ahriman team. # Copyright (c) 2021-2022 ahriman team.
# #
# this file is part of ahriman # This file is part of ahriman
# (see https://github.com/arcan1s/ahriman). # (see https://github.com/arcan1s/ahriman).
# #
# this program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the gnu general public license as published by # it under the terms of the GNU General Public License as published by
# the free software foundation, either version 3 of the license, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# this program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# merchantability or fitness for a particular purpose. see the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# gnu general public license for more details. # GNU General Public License for more details.
# #
# you should have received a copy of the gnu general public license # You should have received a copy of the GNU General Public License
# along with this program. if not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
import shutil import shutil

View File

@ -1,21 +1,21 @@
# #
# copyright (c) 2021-2022 ahriman team. # Copyright (c) 2021-2022 ahriman team.
# #
# this file is part of ahriman # This file is part of ahriman
# (see https://github.com/arcan1s/ahriman). # (see https://github.com/arcan1s/ahriman).
# #
# this program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the gnu general public license as published by # it under the terms of the GNU General Public License as published by
# the free software foundation, either version 3 of the license, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# this program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# merchantability or fitness for a particular purpose. see the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# gnu general public license for more details. # GNU General Public License for more details.
# #
# you should have received a copy of the gnu general public license # You should have received a copy of the GNU General Public License
# along with this program. if not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
from typing import Iterable from typing import Iterable

View File

@ -17,8 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
# technically we could use python-telegram-bot, but it is just a single request, cmon import requests # technically we could use python-telegram-bot, but it is just a single request, cmon
import requests
from typing import Iterable from typing import Iterable

View File

@ -264,7 +264,7 @@ def test_commit(sources: Sources, mocker: MockerFixture) -> None:
commit_message = "Commit message" commit_message = "Commit message"
sources.commit(local, commit_message=commit_message) sources.commit(local, commit_message=commit_message)
check_output_mock.assert_called_once_with( check_output_mock.assert_called_once_with(
"git", "commit", "--all", "--message", commit_message, "git", "commit", "--allow-empty", "--message", commit_message,
exception=None, cwd=local, logger=pytest.helpers.anyvar(int) exception=None, cwd=local, logger=pytest.helpers.anyvar(int)
) )
@ -278,7 +278,7 @@ def test_commit_autogenerated(sources: Sources, mocker: MockerFixture) -> None:
local = Path("local") local = Path("local")
sources.commit(Path("local")) sources.commit(Path("local"))
check_output_mock.assert_called_once_with( check_output_mock.assert_called_once_with(
"git", "commit", "--all", "--message", pytest.helpers.anyvar(str, strict=True), "git", "commit", "--allow-empty", "--message", pytest.helpers.anyvar(str, strict=True),
exception=None, cwd=local, logger=pytest.helpers.anyvar(int) exception=None, cwd=local, logger=pytest.helpers.anyvar(int)
) )