diff --git a/po/aurweb.pot b/po/aurweb.pot index aeed9f02..1f7e8784 100644 --- a/po/aurweb.pot +++ b/po/aurweb.pot @@ -568,6 +568,15 @@ msgstr "" msgid "Flag Package Out-Of-Date" msgstr "" +#: templates/packages/flag.html +msgid "This seems to be a VCS package. Please do %snot%s flag " +"it out-of-date if the package version in the AUR does " +"not match the most recent commit. Flagging this package " +"should only be done if the sources moved or changes in " +"the PKGBUILD are required because of recent upstream " +"changes." +msgstr "" + #: html/pkgflag.php #, php-format msgid "" diff --git a/templates/packages/flag.html b/templates/packages/flag.html index 4e133acb..0335cf18 100644 --- a/templates/packages/flag.html +++ b/templates/packages/flag.html @@ -18,6 +18,20 @@ {% endfor %} + {% if pkgbase.Name.endswith(('-cvs', '-svn', '-git', '-hg', '-bzr', '-darcs')) %} +

+ {# TODO: This error is not yet translated. #} + {{ + "This seems to be a VCS package. Please do %snot%s flag " + "it out-of-date if the package version in the AUR does " + "not match the most recent commit. Flagging this package " + "should only be done if the sources moved or changes in " + "the PKGBUILD are required because of recent upstream " + "changes." | tr | format("", "") | safe + }} +

+ {% endif %} +

{{ "Please do %snot%s use this form to report bugs. " diff --git a/test/test_packages_routes.py b/test/test_packages_routes.py index e2811a46..7eb4e532 100644 --- a/test/test_packages_routes.py +++ b/test/test_packages_routes.py @@ -1762,6 +1762,27 @@ def test_pkgbase_flag(client: TestClient, user: User, maintainer: User, assert pkgbase.Flagger is None +def test_pkgbase_flag_vcs(client: TestClient, user: User, package: Package): + # Morph our package fixture into a VCS package (-git). + with db.begin(): + package.PackageBase.Name += "-git" + package.Name += "-git" + + cookies = {"AURSID": user.login(Request(), "testPassword")} + with client as request: + resp = request.get(f"/pkgbase/{package.PackageBase.Name}/flag", + cookies=cookies) + assert resp.status_code == int(HTTPStatus.OK) + + expected = ("This seems to be a VCS package. Please do " + "not flag it out-of-date if the package " + "version in the AUR does not match the most recent commit. " + "Flagging this package should only be done if the sources " + "moved or changes in the PKGBUILD are required because of " + "recent upstream changes.") + assert expected in resp.text + + def test_pkgbase_notify(client: TestClient, user: User, package: Package): pkgbase = package.PackageBase