Age | Commit message (Collapse) | Author | Files | Lines |
|
Move and rename the existing git-interface tests such that tests for
other scripts can be added easily.
In particular, the following changes are made:
* Move the existing tests from git-interface/test/ to test/.
* Rename t0001-auth.sh to t1100-git-auth.sh.
* Rename t0002-serve.sh to t1200-git-serve.sh.
* Rename t0003-update.sh to t1300-git-update.sh.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Determine the top-level directory before running tests and make all
script paths relative to that directory.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Instead of using relative imports, add support for installing the config
and db Python modules to a proper location using setuptools. Change all
git-interface scripts to access those modules from the search path.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Move the main program logic of git-update to a main() method such that
it can be used as a module and easily be invoked by setuptools wrapper
scripts.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Move the main program logic of git-serve to a main() method such that it
can be used as a module and easily be invoked by setuptools wrapper
scripts.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Move the main program logic of git-server to a main() method such that
it can be used as a module and easily be invoked by setuptools wrapper
scripts.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Move the main program logic of git-auth to a main() method such that it
can be used as a module and easily be invoked by setuptools wrapper
scripts.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add support for changing co-maintainers from the SSH interface. The
syntax is `set-comaintainers <pkgbase> <user1> <user2>...`.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add support for disowning packages from the SSH interface. The syntax is
`disown <pkgbase>`.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add support for adopting packages from the SSH interface. The syntax is
`adopt <pkgbase>`.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Remove the formatting of the usage text and add code to columnize it
automatically instead.
Also, add more strict tests for the usage output. These new tests ensure
that the usage header is printed, commands are indented properly and no
overly long lines are produced.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Since 0c1187c (git-serve: Deprecate setup-repo, 2016-07-24), it is no
longer recommended to use setup-repo. Mark the command as deprecated in
the usage/help text.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
The repo variable is already used to store the pygit2.Repository.
Fixes a regression introduced in d273ee5 (Use the official provider list
to detect duplicates, 2016-05-17).
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
When using SQLite as backend, we need to close the cursor before closing
the database to avoid the following error:
sqlite3.OperationalError: unable to close due to unfinalized statements or unfinished backups
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Instead of testing the exit code only, also check the error output.
This reveals two bugs. The corresponding tests are marked as known
breakages.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
This is used by the MySQL database backend.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Package bases are created by git-update automatically when the
repository receives a ref update for the first time.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Create new package bases just before saving package metadata. This
protects from stray package bases left behind when new packages are
rejected, e.g. when the user tries to push a package that is available
from the official repositories already.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Test the restore mode of git-serve and git-update.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add tests for common scenarios that should be detected/handled by the
update hook.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add tests for common scenarios that should be detected/handled by the
git-serve script.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Test the authentication script with an invalid key type and with a key
that does not exist in the database.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Explicitly remove all package sources, dependencies, relations, licenses
and groups before inserting new ones.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add basic tests for the Git interface. The test suite is based on
sharness.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
In addition to MySQL, add support for SQLite to the database abstraction
layer. Also, add a new configuration option to select the DBMS.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Avoid using UNIX_TIMESTAMP which is not part of the SQL standard.
Retrieve the current UNIX time in Python and substitute it into the SQL
queries instead.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Avoid using Cursor.rowcount to obtain the number of rows returned by a
SELECT statement as this is not guaranteed to be supported by every
database engine.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Introduce a new environment variable that can be used to specify the
path to an aurweb configuration file. If the environment variable is
unset, the default search path is used.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add a new module that automatically locates the configuration file and
provides methods to obtain the values of configuration options.
Use the new module instead of ConfigParser everywhere.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add a new class that connects to the database specified in the
configuration file and provides an interface to execute SQL queries.
Prepared statements with qmark ("?") placeholders are supported.
Replace all direct database accesses with calls to the new abstraction
layer.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Support setting the maximum blob size in the configuration file.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Instead of looking up the account type of the current user again, use
the AUR_PRIVILEGED environment variable to check whether the user is
allowed to perform non-fast-forward ref updates.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Since 02dd9c5 (git-serve.py: Automatically create repositories,
2015-01-06), one can create new package bases by running `git push`. It
is no longer necessary to run setup-repo manually.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Show a warning when a Trusted User or a developer creates a package that
is blacklisted or already provided by an official package.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Read all environment variables at the beginning of the script and
immediately pre-process their values.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Instead of automatically adding packages from the official binary
repositories to the package blacklist, use the official provider list to
prevent users from uploading duplicates.
This does not only result in reduced disk usage but also has a nice
visible side effect. The error messages printed by the update hook now
look like
error: package already provided by [community]: powerline-fonts
instead of
error: package is blacklisted: powerline-fonts
which was confusing to most end users.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Instead of `config <pkgbase> keywords <keyword1> <keyword2>...`, the new
syntax is `set-keywords <pkgbase> <keyword1> <keyword2>...`.
The `config` keyword was rather general and it was not obvious that it
could be used to change package base settings. Instead of replacing it
with an even more verbose expression, remove that unnecessary level of
indirection. Since we do not (and probably never will) support keywords
anywhere else, the chance of name conflicts is small.
Suggested-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Introduce a new notification option to receive notifications when a new
commit is pushed to a package repository.
Implements FS#30109.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
As a preparatory step to adding support for package notifications on
events other than comments, rename the database table accordingly.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
python-srcinfo is a more transparent and simpler library for parsing
SRCINFO files.
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Fix several style issues and remove unneeded imports/assignments.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Fixes a regression introduced in 8c87b1d (git-serve: Add support for
setting keywords, 2015-10-22).
Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
This allows for setting keywords using the SSH interface. The syntax is
`config <pkgbase> keywords <keyword1> <keyword2>...`.
Implements FS#45627.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Since 612300b (Show a warning if .SRCINFO is unchanged, 2015-09-29), the
git-update script displays a warning when a ref update does not affect
the content of the package base meta data. We also invoke git-update to
rebuild the package base details in the aurweb database when a package
base is restored via the SSH interface. In that case, fake information
is passed to the update hook: Both the old and the new object IDs refer
to the current HEAD. Check for such "Everything up-to-date" updates and
not display the ".SRCINFO unchanged" in these cases.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Warn users when a remote ref update does not change the content of
.SRCINFO such that users are reminded of updating package meta data.
Implements FS#46130.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Fixes a regression introduced in 4112e57 (Add a restore command to the
SSH interface, 2015-08-14).
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Implement a new command that can be used to restore deleted package
bases without having to push a new commit.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|
|
Add some comments to explain the major steps performed in the update
hook.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
|