Commit graph

992 commits

Author SHA1 Message Date
elij
3d3fed6910 wrap long SQL commands to improve formatting and readability
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 11:57:31 +02:00
elij
e08731d24c replace print statements with logging module in gendummydata
use the logging module instead of writing directly to stderr
this makes the code cleaner as it removes the numerous tests for the value
of DBUG, yet allows devs to control the level of output verbosity.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 11:57:31 +02:00
elij
2e444a79d5 remove mysql dependency from gendummydata
- remove need to use mysql for escaping the sql -- removing single quote
  should be enough
- instead of using sql to fetch categories from a live database, simply
  consider categories an integer range, specified to the size of that in the
  aur-schema.

Lukas: Add "CATEGORIES_COUNT" initialization. Fix random number range
used in genCategory() (AUTO_INCREMENT columns are 1-based by default,
not 0-based).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 11:56:32 +02:00
Dan McGee
eaffdc27f8 Add base transifex config
This simplifies instructions for translators and allows them to have an
out of the box working configuration.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-11 09:53:51 +02:00
Dan McGee
c996368024 Use HTTPS for transifex URLs
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-11 09:53:51 +02:00
Lukas Fleischer
a85f140ace Add ".mo" and ".po~" files to ".gitignore".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:49 +02:00
Lukas Fleischer
8bca269b81 Update "TRANSLATING" with gettext and Transifex instructions.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:48 +02:00
Lukas Fleischer
3a5693166c Remove comment on translation helpers from "web/lib/translator.inc".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:48 +02:00
Lukas Fleischer
525a079503 Supress rm(1) warnings showing up when running make clean.
Use `rm -f` instead of just `rm` here to supress those annoying warnings
about failed removal if either ".po~" backup files or compiled ".mo"
files are missing.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:48 +02:00
Lukas Fleischer
3d8c298adb Add "--check" to msgfmt(1) invocation in Makefile.
We can add this as we finally have proper portable objects now.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:47 +02:00
Lukas Fleischer
7364625510 Update portable object files using make update-po.
This ensures we have proper native portable objects instead of those
created by sed(1)'ing the former translation files.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:46 +02:00
Lukas Fleischer
fe98a3e3cb Add "%.po-update" and "update-po" targets to Makefile.
Those can be used as a shortcut to msgmerge(1) to update one
("$locale.po-update") or all ("update-po") portable object files with
new strings from the message catalog ("aur.pot").

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:46 +02:00
Lukas Fleischer
7979864be3 Add initial headers to portable object files.
Those are just dummy headers created by ripping them off from "aur.pot"
and changing the "Content-Type" charset to UTF-8.

Needed to make msgmerge(1) operate on our converted ".po" files -
otherwise it would fail to detect the files' encodings and do nothing
but throw a pile of "invalid multibyte sequence" errors.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:45 +02:00
Lukas Fleischer
f93340b2ca Create initial ".pot" file using make update-pot.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:45 +02:00
Lukas Fleischer
e24f82f476 Add "update-pot" target to Makefile.
Can be used to rebuild the message catalog from our source tree.
"po/POTFILES" contains a list of source files to be scanned for
translation strings.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:45 +02:00
Lukas Fleischer
b10c7fb86b Add note on gettext migration to "UPGRADING".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 16:27:39 +02:00
Lukas Fleischer
b2a04c1238 Add locale directories to ".gitignore".
Ensure we never `git add` any of those by accident.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:50 +02:00
Lukas Fleischer
0662f42884 Remove "web/lang/".
Those legacy ".po" files and translation helpers are no longer needed as
we moved to gettext compatible portable objects.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:50 +02:00
Lukas Fleischer
22a718ea89 Replace translation engine with php-gettext.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:50 +02:00
Lukas Fleischer
779ecc8c3a Add php-gettext libraries to "web/lib/".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:49 +02:00
Lukas Fleischer
d9889c9dde Add dummy "web/locale/" directory.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:49 +02:00
Lukas Fleischer
501c0875a0 Add Makefile to compile ".po" files.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:49 +02:00
Lukas Fleischer
5c5b80e0ed Remove duplicate message definitions from new portable object files.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:48 +02:00
Lukas Fleischer
758b7bf054 Convert translation files to gettext compatible portable objects.
Put new gettext compatible files into "po/" while keeping old
translations in "web/lang/".

Conversion was done using following hacky shell script:

----
for f in *.po; do
  # Remove "<?php" shebang and "global" statements.
  sed -i '1d; /^global/d' "$f"
  # Convert former translation strings into real PO statements.
  sed -i 's/^$_t\[\(.*\)\] = \(.*\);.*/msgid \1\nmsgstr \2/' "$f"
  # Ensure there always is an empty line after each msgstr.
  sed -i '/^msgstr/!b; n; /^$/!i\
' "$f"
done
----

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:48 +02:00
Lukas Fleischer
f507f360a0 Remove newline in "web/lang/sr.po".
Do this in preparation for converting exisiting translation files into
gettext compatible ones. Newlines will he hard to match by a conversion
script.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:40:47 +02:00
Lukas Fleischer
668826226a Release 1.8.2.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-10 15:38:28 +02:00
Cédric Girard
77149ad011 Fix French translation.
* Translation of "notify" has been changed to the literal translation
  "notifier" which seems more appropriate (cf. recent thread on
  AUR-general)

* Uniformization of the translation of "flag"

* Addition of "TU" besides the translation of Trusted User as user may
  not understand that Trusted User and "Utilisateur de confiance" are
  the same thing

* Some capitalization correction (in French you don't put capital
  letters in the middle of a sentence as you do eg for title in
  English).

* "unsupported" translation has been replaced by "unsupported" (with
  quotes) as it makes no sense to translate it

* "Safe" translation has been replaced by "sûr" has it seems more
  appropriate than "sain" (sane)

Lukas: Added translator to "AUTHORS".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-07 00:36:49 +02:00
Lukas Fleischer
5df16bf3c0 Merge branch 'wip' 2011-04-06 21:50:58 +02:00
Wieland Hoffmann
feff71ddfe Update the german translation
Lukas: Added missing translations strings. Added translator to
"AUTHORS".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-06 21:42:59 +02:00
Lukas Fleischer
a5213daaec Make "Exact name" search option translatable.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-06 19:29:35 +02:00
Lukas Fleischer
1c55e6b40c Add option to search for exact name matches only (fixes FS#23556).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-06 19:21:19 +02:00
Lukas Fleischer
8cd2aef50d Initialize "$name" in pkgname_from_id().
Ensures "$name" is always initialized, even if the package doesn't
exist. Fixes PHP warnings appearing when retrieving package details of a
package with an invalid ID.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-05 11:38:43 +02:00
Lukas Fleischer
8b4b2d207e Remove File_Find PEAR module from code base.
We removed the code depending on this a long time ago - drop it and add
some note to "UPGRADING".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-05 11:31:12 +02:00
Lukas Fleischer
d142ca4053 Fix PHP warning when browsing a non-existent package.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-04 23:31:19 +02:00
Dan McGee
2005a2889c Add more stats to the front page table
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:33 +02:00
Dan McGee
79ce38d271 Add indentation to stats table
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:32 +02:00
Dan McGee
7c91c59245 Remove Dummy Package concept
Instead, we just store dependencies directly in the PackageDepends
table. Since we don't use this info anywhere besides the package details
page, there is little value in precalculating what is in the AUR vs.
what is not.

An upgrade path is provided via several SQL statements in the UPGRADING
document. There should be no user-visible change from this, but the DB
schema gets a bit more sane and we no longer have loads of junk packages
in our tables that are never shown to the end user. This should also
help the MySQL query planner in several cases as we no longer have to be
careful to exclude dummy packages on every query.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:32 +02:00
Dan McGee
1f252eba64 Always set ModifiedTS including new packages
Set it equal to the SubmittedTS field, which will be our indication the
package is new when we show the logo on the front page of the AUR.

This results in the ability to remove the use of the unindexable
GREATEST() function from the AUR code everywhere we had to use it before
to handle the 0 timestamp case.

Note that there is no race condition here in calling UNIX_TIMESTAMP()
twice- it always returns the time at the beginning of statment
execution:

    mysql> select unix_timestamp(), sleep(2), unix_timestamp();
    +------------------+----------+------------------+
    | unix_timestamp() | sleep(2) | unix_timestamp() |
    +------------------+----------+------------------+
    |       1300851746 |        0 |       1300851746 |
    +------------------+----------+------------------+
    1 row in set (2.00 sec)

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:31 +02:00
Dan McGee
1128489bd0 Submission process code refactor
We had a ton of duplicate code shared between the insert and update
cases. Do a refactor so we can pull this stuff out below the if/else
block and only need it there once, saving some headaches.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:31 +02:00
Lukas Fleischer
a427bd72a7 Be more restrictive with source tarball contents.
Reject tarballs containing more than one directory or files outside a
directory.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 20:49:21 +02:00
Lukas Fleischer
0a625ae8ff Fix XSS vulnerability in "web/template/header.php".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 17:07:27 +02:00
Lukas Fleischer
746c2b72b5 Fix PHP notice when submitting an empty file.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 16:16:27 +02:00
Lukas Fleischer
e4130fcca6 Fix strict standards warnings in "web/html/pkgsubmit.php".
end() expects a reference but we pass a function return value here.
Using list() is a bit hacky as well as it expects a 0-based array
whereas unpack() returns a 1-based array - thus we use "list(, $foo)".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 12:28:17 +02:00
Lukas Fleischer
47faf88f14 Check if submitted files are in GZIP format.
This is quite hacky but this way we can ensure users get comprehensible
error messages when trying to upload ".tar.xz" or ".tar.bz2" files.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 11:55:32 +02:00
Lukas Fleischer
2eb45e7d9e Fix XSS vulnerabilities in "web/html/voters.php".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 11:10:16 +02:00
Lukas Fleischer
55eb55a75f Fix PHP undefined notice in "web/html/packages.php".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 11:06:20 +02:00
Lukas Fleischer
3aa2240b7d Fix XSS vulnerabilities in package comment templates.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 10:49:51 +02:00
Lukas Fleischer
11366b8a1a gendummydata.py: Do not touch output file until we need it.
Ensures there's no leftover (empty) file if something during
initialization fails.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 10:27:23 +02:00
Dan McGee
b6a34d013b Bump up default per-page value to 50
25 is woefully small for the number of packages many searches can
return, and with 28000+ packages in AUR, it makes sense to show a lot
more per page by default.

The new choices of (50, 100, 250) happen to match those from the main
site.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-24 15:32:08 +01:00
Dan McGee
044393c44b Fix main site package search URL
I've been wanting to kill this one for a long time.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-15 15:46:10 +01:00