From e1bf49e03c91d0e102531d07199903c2f7a6d523 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 12 Apr 2011 12:31:03 +0200 Subject: 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 --- support/schema/gendummydata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/schema/gendummydata.py b/support/schema/gendummydata.py index 642acd0..a7679b5 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 -- cgit v1.2.3-70-g09d2