Commit graph

613 commits

Author SHA1 Message Date
Lukas Fleischer
d7f0b25e51 acctfuncs.inc.php: Fix typo
Replace a misplaced semicolon with the concatenation operator. This
makes the AUR insert proper Reply-to and From headers again when sending
password reset emails on registration.

Fixes a regression introduced in 94a4f59 (Set Content-type header when
sending UTF-8 mails, 2014-02-10).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-22 21:08:47 +02:00
Lukas Fleischer
42461cc78e Release 3.0.0-rc4
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-22 20:42:05 +02:00
Lukas Fleischer
839bff3761 Use aur.archlinux.org in sender email addresses
Consistently use the following headers in notification emails:

    Reply-to: noreply@aur.archlinux.org
    From: notify@aur.achlinux.org

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-22 15:43:41 +02:00
Lukas Fleischer
02e7df7631 Be friendly to newly registered users
Use "Welcome to the Arch User Repository" instead of "AUR Password
Reset" as subject for the initial password reset email.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-22 15:43:41 +02:00
Lukas Fleischer
d062634ce2 Release v3.0.0-rc3
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-20 22:02:04 +02:00
Thomas Weißschuh
8658bf22aa Add threading headers to notification mail
It is only basic, but works in this way for other platforms.
It works because MUAs are able to reconstruct threads originating from mails
they don't know about (unknown Message-ID).

This has some drawbacks:
* MUAs might show the missing start of the thread. As a normal user of a
  package never got *all* notifications of a package anyways it only reflects
  the reality
* Missing notifications go unnoticed. This is no regression so it should be
  fine

Those could be fixed by including all previous comments in 'References:',
which would require to have predictable 'Message-ID:' for notification mails.
This would require more code and more database accesses at runtime.

Could also be used for out of date notifications.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-20 21:58:36 +02:00
Lukas Fleischer
cf6470803e aurjson: Fix multiinfo when using package IDs
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-18 12:19:29 +02:00
Lukas Fleischer
bc93e68dc7 Set language using a POST request
Fixes FS#39027.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-13 14:19:55 +02:00
Lukas Fleischer
33bdc023d6 Release 3.0.0-rc2
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-07 11:12:39 +02:00
Lukas Fleischer
97df70daec pkgbuild-parser.inc.php: Remove stray "#"
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06 21:13:20 +02:00
Lukas Fleischer
a93363ac08 Add a packager field to packages
Store the last packager in addition to storing the submitter and the
maintainer of a package. This allows for checking who last updated a
package, even if the package has been disowned.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06 20:52:32 +02:00
Lukas Fleischer
782e9eb188 Fix parsing of array overrides
If a depends (makedepends, checkdepends, optdepends, conflicts,
provides, replaces, license, groups, source) line appears in a package
section, it replaces the corresponding array from the pkgbase section.
If there is a single "depends = " line in the package section, the
depends array of that package is considered empty.

This partly reverts the behavior introduced in commit 137a9ae (Fix
parsing of array overrides, 2014-05-03).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-03 18:08:57 +02:00
Lukas Fleischer
e161c4f94b Fix vote/notify link on the package details page
Call pkgbase_user_voted() and pkgbase_user_notify() using the package
base ID instead of using the package ID.

Fixes FS#40165.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-01 09:29:55 +02:00
Lukas Fleischer
05f88b28b8 Release 3.0.0-rc1
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-30 23:47:35 +02:00
Lukas Fleischer
c90faa44a1 Use RPC API version 1 by default
Most AUR helpers don't support the new format yet. Use version 1 of the
API by default. In order to use the new format, "v=2" can be appended to
the list of GET parameters.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-28 18:54:26 +02:00
Lukas Fleischer
3447dfcbff Support versioned RPC queries
This adds a backwards compatibility mode for the old RPC API. The old
format can be requested by explicitly adding "v=1" to the list of GET
parameters. Note that due to internal changes, the old format only
returns the first license that belongs to a package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-28 18:54:26 +02:00
Lukas Fleischer
11a565936e aurjson.class.php: Style fixes
* Fix braces, indentation and comment style.
* Remove some superfluous comments.
* Reword some comments.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-28 18:44:41 +02:00
Lukas Fleischer
e50f352643 Add a version tag to RPC replies
This is needed for clients to quickly differentiate between different
versions of the RPC API. The version number should be bumped whenever
there is a change that breaks backwards compatibility.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-28 00:10:42 +02:00
Lukas Fleischer
eb6cf1fad0 Add more fields to RPC info replies
This patch adds the following fields to info and multiinfo replies:

* Depends
* MakeDepends
* CheckDepends
* OptDepends
* Conflicts
* Provides
* Replaces
* Groups
* License

Each of these fields is an array.

Note that since collecting all these fields is CPU-intensive, they are
not included in replies to search queries.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-28 00:10:42 +02:00
Lukas Fleischer
b384f32fec Fix the RPC interface
* Fix the SQL query to conform to the new database layout.

* Remove the license field from replies. The license field is now stored
  in a separate table and no longer returned on search queries.

* Add a "PackageBase" field that contains the name of the package base
  of every package in the result.

* Fix the source tarball URL. The URL is now built based on the package
  base name instead of the package name.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-27 23:30:33 +02:00
Lukas Fleischer
9553790cfc Support multiple licenses per package
Split out package licenses into two separate tables in order to support
multiple licenses per package. The code on the package details page is
adjusted accordingly.

UPGRADING contains instructions on how to convert existing licenses in
the database to the new layout.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 14:48:19 +02:00
Lukas Fleischer
38eb8d2a3a Display package groups on the details page
The groups field is hidden if a package doesn't belong to any group.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 14:21:55 +02:00
Lukas Fleischer
cc3244ea8a Store package groups in the database
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 14:07:20 +02:00
Lukas Fleischer
3720bdf6b2 Display package relations on the details page
This adds information from the following three fields to the package
details page:

* conflicts
* provides
* replaces

If either of these fields is empty, it is not displayed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 13:34:17 +02:00
Lukas Fleischer
92812050a0 Store conflicts, provides and replaces in the DB
Package conflicts, provides and replaces are now stored in the new
PackageRelations table. The gendummydata script generates test entries
for these relations.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 13:20:56 +02:00
Lukas Fleischer
34453d3295 Handle pkgbase array overrides gracefully
Instead of overwriting arrays, such as depends, from the pkgbase
section, new entries should be appended. Replace array_merge() with a
mixture of array_merge_recursive() and array_replace_recursive() that
merges array fields and replaces non-array fields.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-19 10:59:48 +02:00
Lukas Fleischer
895907579e Display dependency type of package dependencies
This adds a label to makedepends, checkdepends and optdepends on the
package details page. makedepends are labelled with "(make)",
checkdepends with "(check)" and optdepends are labeled with
"(optional)", followed by the optdepend description.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-17 21:10:58 +02:00
Lukas Fleischer
73936002f7 Store {make,check,opt}depends in the database
In addition to parsing and storing dependencies of packages, store
makedepends, checkdepends and optdepends. Every dependency (of any type)
is displayed on the package details page.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-17 21:09:16 +02:00
Lukas Fleischer
32b5d46643 Fix misuses of pkgbase_from_pkgid()
All pkgbase_*() functions should operate on package base IDs. Drop the
superfluous (and incorrect) parameter conversion from package IDs to
package base IDs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-06 18:42:00 +02:00
Lukas Fleischer
5b5a5f343e Fix pkgbase_user_voted()
pkgbase_user_voted() should expect a package base ID, not a package ID.
Change the SQL query accordingly.

This fixes the vote status on package base pages.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-06 18:41:23 +02:00
Lukas Fleischer
c004429023 Refactor pkgbase_categories()
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 19:58:00 +02:00
Lukas Fleischer
5415bc945a Refactor pkgbase_comments()
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 19:52:51 +02:00
Lukas Fleischer
122636cbb6 Refactor pkgbase_comments_count()
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 19:52:51 +02:00
Lukas Fleischer
724a737815 Fix searching by category
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 17:42:19 +02:00
Lukas Fleischer
1486f8067a pkgbasefuncs.inc.php: Fix leftover bits
Fix some places that incorrectly referred to packages instead of package
bases.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 16:10:53 +02:00
Lukas Fleischer
434b04e826 pkgfuncs.inc.php: Remove several unused functions
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 16:02:20 +02:00
Lukas Fleischer
ee1048b268 Split out package base functions
Move functions operating on package bases to a separate file.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 15:58:44 +02:00
Lukas Fleischer
676595f9bf Prefix package functions with pkg_/pkgbase_
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 15:55:31 +02:00
Lukas Fleischer
d16f7cf712 Use snake case for all package functions
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 15:54:21 +02:00
Lukas Fleischer
f461344211 Move package actions to package bases
Package actions now operate on package bases instead of packages. Move
all actions to the correct locations.

This also fixes some issues with comment notifications.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:54:06 +02:00
Lukas Fleischer
c1c77836a8 Allow for searching by package base name
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:51:28 +02:00
Lukas Fleischer
d7044eb1ec Factor out PKGBUILD parsing
This is legacy code. Move it to a separate source file in order to clean
up the submission code. The code will be removed altogether in an
upcoming release.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
8921e4deb9 Do not allow for overwriting arbitrary packages
A package should only be overwritten if it already belongs to the
package base that is trying to overwrite it.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
f7d13b5b36 Add package base detail pages
This adds package base details pages, similar to the package details
pages. Each package base details page contains general information
(package base name, category, submitter, maintainer, ...) and links to
all the corresponding packages. As on the package details pages,
comments and links to several package actions are also provided.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
fb81bfd8df Add full support for the new .AURINFO format
This adds full support for the new .AURINFO format used by mkaurball,
including support for split packages.

The old PKGBUILD parser is still available for compatibility reasons.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
b558572a2e Make the delete function remove package bases
Deleting a single package without deleting the whole package base makes
no sense. Comments and votes are already stored on a per-package basis,
making this a straightforward extension.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
45bd1b34f1 routing.inc.php: Add get_pkgbase_uri()
This will be used to create links to package base pages later. For now,
this just returns a link to the corresponding package page since a
package base currently only consists of a single package having the same
name as the base itself.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
d35cf67f7b Store comments on a per-package base basis
Move comments from the Packages table to PackageBases. Sharing comments
makes sense since they almost always refer to a source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
Lukas Fleischer
b7941073ac Add provisional support for package bases
This adds a PackageBases table to the database schema and moves the
following fields from the Packages table to PackageBases:

* CategoryID
* NumVotes
* OutOfDateTS
* SubmittedTS
* ModifiedTS
* SubmitterUID
* MaintainerUID

It also fixes all database accesses to comply with the new layout.

Having a separate PackageBases table is the first step to split package
support. By now, we create one PackageBases entry per package (where the
package base has the same name as the corresponding package). When
adding full support for split packages later, the package base name will
be derived from the pkgbase variable and a single package base will be
shared amongst all packages built from one source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
Lukas Fleischer
94a4f597ff Set Content-type header when sending UTF-8 mails
Fixes FS#38568.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-10 21:00:36 +01:00