Commit graph

566 commits

Author SHA1 Message Date
Lukas Fleischer
ea25f982dc Avoid overflow in updates table
Fixes FS#40206.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-22 16:01:16 +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
ba30743398 Check permissions when uploading source packages
All files contained in the source tarball must have permissions of 644
or 755. All directories must have permissions of 755.

Implements FS#27754.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06 21:24:56 +02:00
Lukas Fleischer
ac09e669c7 pkgsubmit.php: Style fixes
Move some elseif statements to the same line as the closing brace.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06 21:16:31 +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
dda19c8e01 pkgsubmit.php: Redirect to package base details
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 14:50:57 +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
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
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
e582cfe182 Collapse long dependency lists
Collapse package dependency lists with more than 20 entries and add a
link to show the full list.

The JavaScript code for this originates from the archweb project. Note
that the full list is shown when JavaScript is disabled or unavailable.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-18 23:57:46 +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
206678dfb7 pkgbase.php: Append query string when redirecting
Add the query string when redirecting to the package details page. This
fixes the target of the "All comments" link of non-split packages.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 17:45:21 +02:00
Lukas Fleischer
6ed9da2c3e Do not show package base page of non-split packages
When trying to access the package base page of non-split packages,
redirect to the package details page since the package base page doesn't
contain any additional information in that case.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 16:32:20 +02:00
Lukas Fleischer
ace64c96d3 Add full package list to the removal form
In addition to naming the package base that is going to be removed or
merged, list every single package that is affected.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 16:23:26 +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
16090496a4 Only parse PKGBUILD when required
Instead of always parsing the PKGBUILD, only invoke the parser when
there is no meta data (.AURINFO) available. This speeds up the general
case (packages including meta data).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +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
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
1be6761acd passreset.php: Make error messages translatable
This fixes a regression introduced in commit 48b7407 (passreset.php:
Refactor HTML, 2014-01-08).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-10 22:20:47 +01:00
Lukas Fleischer
9864988517 Highlight the AUR link in the navigation bar
Fixes FS#38498.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-10 20:26:11 +01:00
Lukas Fleischer
165bcba54e Style fixes: Capitalization of "true" and "false"
Use "true" instead of "TRUE" and "false" instead of "FALSE" or "False".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 16:32:31 +01:00
canyonknight
42c9957e41 account_details.php: Add link to edit a user's account
This improves the ability to edit a user's account directly through
UI features rather than manually appending 'edit' to the URL or
searching for the account and selecting edit.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-03 21:16:36 +01:00
canyonknight
1e9d539acf Further optimize voters.php to only need the package name
* Extends changes in 81d4cc13dc
* Modify getvotes() to use the package name rather than package ID
* Rename getvotes() to votes_for_pkgname() for clarity with new changes
* Modify routing framework and links to now use package names for voters.php

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-22 18:27:42 +01:00
canyonknight
81d4cc13dc voters.php: Remove extra call to pkgname_from_id()
No need to store package ID and call pkgname_from_id() twice when
the end goal is the package name.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-20 15:41:19 +01:00
Lukas Fleischer
ecbb664b3d pkgsubmit.php: Improve visibility of errors
Make use of the "errorlist" class instead of "pkgoutput" which is no
longer defined in the CSS.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-17 11:36:01 +01:00
Lukas Fleischer
b7ea144dfb Add a warning for packages without .AURINFO
Display a deprecation warning when a package without meta data is
submitted. The user can still decide to ignore that warning by
resubmitting the package but doing so is not recommended.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-17 11:35:04 +01:00
Lukas Fleischer
ddbe1d1b1e Promote the use of mkaurball
mkaurball automatically adds .AURINFO meta data when building, so tell
people to use that instead of `makepkg --source`.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-17 11:35:04 +01:00
Lukas Fleischer
bfea8b29ad Detect split packages from .AURINFO
There is an extension to the .AURINFO format that supports split
packages. Since there is no support for split packages in the AUR so
far, add a check to identify these cases.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-17 11:35:04 +01:00
Lukas Fleischer
d428da4780 Strip whitespace from .AURINFO lines
Indentation can be useful if one wants to structure an .AURINFO file.
Remove leading and trailing whitespace from each line before parsing.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-17 11:35:04 +01:00
Lukas Fleischer
b0c55ae5c6 Rename "depend" field to "depends" in .AURINFO
This field has been renamed in a revision of the .AURINFO format.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-17 11:35:04 +01:00
Lukas Fleischer
f2e26ebbf8 Fix split package error handling
Do not remove parentheses from the pkgname to make sure the split
package detection works properly.

Also, fix a regression introduced in 4bb6e88 (pkgsubmit.php: Simplify
package name validation, 2013-03-05) that resulted in the split package
error message never showing up.

Fixes FS#37496.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-11 13:36:10 +01:00
Balló György
d8ea2d4a02 Forbid developers to vote
According to Trusted User Bylaws, TUs (and only TUs) must take part in
votes. Developers who want to take part in votes should set their account
type to 'Trusted User'.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-11 12:08:51 +01:00
Lukas Fleischer
cc490ce8d6 passreset.php: Error out if e-mail is empty
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-11 12:08:24 +01:00
Lukas Fleischer
48b74071f0 passreset.php: Refactor HTML
* Use the "errorlist" class for errors.
* Refactor some code.
* Properly display error messages when requesting a key.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-11 12:08:24 +01:00
Joris Steyn
72e4d54178 Typeahead workaround for having to press enter twice
Currently, one has to press enter twice in order to submit the package
search form with typeahead completion. Add a workaround to fix this.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-11 12:04:33 +01:00
Joris Steyn
0d68494de7 Go to package when selecting a typeahead suggestion
Directly jump to the package details when selecting an entry from the
drop-down list.

Implements FS#34471.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-02 00:48:20 +01:00
canyonknight
dbf1d474f7 Convert adopt/disown package action link to form
* Changes adopting/disowning packages to use GET instead of POST
* Uses CSS to make form submit button look like a link
* Complements commit 3bc951e3d8

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-08 13:53:47 +02:00
Lukas Fleischer
77f1b264ca Sync CSS with archweb
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-03 13:14:39 +02:00
Lukas Fleischer
3130a887e8 Move "Add Proposal" link to "Current Votes"
The page this links to allows for adding an item to the list of current
votes. Move the link accordingly.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-03 12:53:58 +02:00
Lukas Fleischer
c1c7f9b350 Move package comment check to packages.php
Checking whether to add a comment is something that really does not
belong to a function named display_package_details().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 11:35:26 +02:00
Lukas Fleischer
bf019a5b6c Use POST-Redirect-GET for most package actions
Avoid showing a POST data resubmission dialog and simply redirect to the
package page if a package action completed successfully.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 11:25:14 +02:00
Lukas Fleischer
23867a211c Add boolean return values to several pkg_*() functions
Change the return values of following functions to return both
error/success and an error/success message:

* pkg_flag()
* pkg_unflag()
* pkg_adopt()
* pkg_vote()
* pkg_delete()
* pkg_notify()
* pkg_delete_comment()
* pkg_change_category()

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 11:19:45 +02:00
Lukas Fleischer
7c8e86010d Pick sane default registration language
Instead of defaulting to Català (which is the first entry in the list of
supported languages), choose whatever language the unregistered user is
browsing the AUR in.

Fixes FS#34825.

Suggested-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 02:42:19 +02:00