Commit graph

33 commits

Author SHA1 Message Date
canyonknight
d7dad5e6c7 gendummydata.py: Open all files with UTF-8 encoding
Users with certain locales are unable to generate dummy data.
Enforce UTF-8 encoding.

Fixes FS#32986

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-12-22 17:01:14 +01:00
canyonknight
cc1a0776c5 gendummydata.py: Remove need for fortune subprocess
Fortune calls slows down the generation of dummy data dramatically
for large datasets. Read from a specified fortune file directly
to avoid the need for the subprocess.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-12-22 17:01:03 +01:00
canyonknight
0e923bd11e gendummydata.py: Remove extra letter from dummy pkgrel
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-15 20:03:33 +01:00
canyonknight
e7f6deeb33 gendummydata.py: Add ability to generate dummy trusted user proposals
* Introduce ability to specify number of open and closed dummy trusted user
proposals
* First step for eventually adding dummy votes for proposals

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:25:43 +02:00
canyonknight
a4ed3a3b3b gendummydata.py: Change variable to string to eliminate redundant code
There is no reason the MaintainerUID can't be treated as a string within this
script. By changing to a string an "if" statement can be eliminated.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:25:41 +02:00
canyonknight
cf2b82239d gendummydata.py: Remove unused variables
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:25:39 +02:00
canyonknight
e1a802d900 gendummydata.py: Add check for command generating dummy comments
* Exit with an error if fortune command isn't found
* No reason to enforce the "-l" option from the fortune command

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:25:38 +02:00
Lukas Fleischer
31cda618ca Make "gendummydata.py" Python 3 compliant.
* Transform into valid Python 3.x code using 2to3.

* Change shebang from "/usr/bin/python2" to "/usr/bin/python3".

* Invoke with "python3" instead of "python2" in "reloadtestdb.sh".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-13 12:14:37 +02:00
Lukas Fleischer
e1bf49e03c Fix dependency generation in "gendummydata.py".
Package dependencies are no longer stored as references to the
"Packages" table but kept directly in "PackageDepends", so the dummy
data generation script should be fixed to create package names instead
of references, also. Regression introduced in commit
7c91c59245.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 13:03:17 +02:00
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
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
abd41bbb51 Allow DB connection values to come from the environment
Stop hardcoding everything everywhere for those of us that don't use the
localhost/aur/aur/AUR setup. Also allow for the dummy data to be created
in the reload script if it does not exist. Finally, remove two
assumptions that the AUR database already exists.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:14 +01:00
Dan McGee
b9690972d0 Use a single transaction to write dummy data
This is immensely faster when using InnoDB since we don't need to sync
after each and every INSERT statement.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:13 +01:00
Lukas Fleischer
bc238965cb Fix some minor bugs in "support/schema/gendummydata.py".
The dummy data generation script used to create wrong package IDs for
both "PackageVotes" and "PackageDepends" tables which led to errors when
reloading the test data (constraints failed). This is fixed by no longer
creating entries with zero ("0") package IDs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:30 +01:00
Lukas Fleischer
1e3fa38de5 Define "Packages.SubmitterUID" and "Packages.MaintainerUID" as "NULL".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:19 +01:00
Lukas Fleischer
34ac351e82 Drop "PackageContents" table and references.
We don't even touch source tarballs anymore - except for extracting the
PKGBUILD, so this is no longer needed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 15:16:29 +01:00
Dan McGee
7f5af61c88 Drop PackageLocations table and references
We don't need this anymore since all packages managed here are
well...managed here. Rip out all of the places we were using this field,
many of which depended on the magic value '2' anyway.

On the display side of things, we had a column that was always showing
'unsupported' that is now gone, and you can no longer sort by this column.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 12:41:08 +01:00
Lukas Fleischer
737268e0c2 Use "python2" shebang for "newpackage-notify" and "gendummydata.py".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-24 18:12:05 +01:00
Lukas Fleischer
556de318ae Build URLs from package names (fixes FS#15308, FS#19327).
Drop the "URLPath" field from the "Packages" table, build URLs from
package names instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-24 18:08:29 +01:00
Callan Barrett
04dae8d94f Remove references to AURMaintainerUID
This (should) get rid of anything to do with the unused column AURMaintainerUID
in the scripts and schema files

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-27 02:34:35 -05:00
Loui Chang
e64307d8d2 Generate valid dummy data entries
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:04:17 -05:00
eric
e3587ddf94 started working on pkgedit for comments 2005-03-06 21:44:56 +00:00
eric
aae43d9ad6 started working on package comments 2005-03-05 20:39:36 +00:00
eric
9641fdc735 fixed dummy-data, schema, gendummydata to use md5 passwords 2005-01-24 21:03:44 +00:00
eric
cbe2050420 started on the package submit script 2004-07-12 22:12:42 +00:00
eric
993fcb7811 still working on pkgsearch.php::do_Details 2004-07-01 22:20:09 +00:00
eric
761ddc3ddc yet another schema change 2004-06-29 21:22:31 +00:00
eric
4b80bc34ff re-working pkgsearch, NumVotes add to Packages table 2004-06-28 19:37:02 +00:00
eric
efcca46f26 working on action box for packages 2004-06-28 10:39:12 +00:00
eric
e7f806e43c improved dummy data, sorting works on package listing, still need Less/More buttons and package operations (details, manage, out-of-date) 2004-06-25 12:14:58 +00:00
eric
342d5dfce0 added dummy data for testing 2004-06-23 15:49:09 +00:00