diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-04-12 12:31:03 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-04-12 13:03:17 +0200 |
commit | e1bf49e03c91d0e102531d07199903c2f7a6d523 (patch) | |
tree | 946e7ef3e4cc7d698d88559884f21387bf11e612 /support/schema/gendummydata.py | |
parent | bd78b14cb5490cdb950cfc27925b0f3000a95745 (diff) | |
download | aur-e1bf49e03c91d0e102531d07199903c2f7a6d523.tar.gz aur-e1bf49e03c91d0e102531d07199903c2f7a6d523.tar.xz |
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
7c91c592458b7532806ef75fe09146f82f085f3b.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'support/schema/gendummydata.py')
-rwxr-xr-x | support/schema/gendummydata.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/support/schema/gendummydata.py b/support/schema/gendummydata.py index 642acd09..a7679b57 100755 --- a/support/schema/gendummydata.py +++ b/support/schema/gendummydata.py @@ -252,9 +252,9 @@ for p in seen_pkgs.keys(): this_deps = {} i = 0 while i != num_deps: - dep = random.randrange(1, len(seen_pkgs) + 1) + dep = random.choice([k for k in seen_pkgs]) if not this_deps.has_key(dep): - s = "INSERT INTO PackageDepends VALUES (%d, %d, NULL);\n" + s = "INSERT INTO PackageDepends VALUES (%d, '%s', NULL);\n" s = s % (seen_pkgs[p], dep) out.write(s) i += 1 |