diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-01-24 18:08:29 +0100 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-01-24 18:08:29 +0100 |
commit | 556de318aeeef6019bb7628389beee1358de93f8 (patch) | |
tree | 434794760f8df1c575b8771c80f0175477ffd5f6 /support/schema | |
parent | 0bb2a7b5147f9eeec5df5f02f59f03b6e85a8ed2 (diff) | |
download | aurweb-556de318aeeef6019bb7628389beee1358de93f8.tar.xz |
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>
Diffstat (limited to 'support/schema')
-rw-r--r-- | support/schema/aur-schema.sql | 1 | ||||
-rwxr-xr-x | support/schema/gendummydata.py | 22 |
2 files changed, 8 insertions, 15 deletions
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 93ec9a0..cd24f38 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -115,7 +115,6 @@ CREATE TABLE Packages ( URL CHAR(255) NOT NULL DEFAULT "http://www.archlinux.org", DummyPkg TINYINT UNSIGNED NOT NULL DEFAULT 0, -- 1=>dummy FSPath CHAR(255) NOT NULL DEFAULT '', - URLPath CHAR(255) NOT NULL DEFAULT '', License CHAR(40) NOT NULL DEFAULT '', LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1, NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, diff --git a/support/schema/gendummydata.py b/support/schema/gendummydata.py index dabd451..2260555 100755 --- a/support/schema/gendummydata.py +++ b/support/schema/gendummydata.py @@ -267,36 +267,30 @@ for p in seen_pkgs.keys(): if location_id == 1: # Unsupported - just a PKGBUILD and maybe other stuff others = random.randrange(0,3) - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], "PKGBUILD", "/home/aur/incoming/%s/PKGBUILD" % p, + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], "/home/aur/incoming/%s/PKGBUILD" % p, random.randrange(0,999)) out.write(s) if others == 0: - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], "%s.patch" % p, - "/home/aur/incoming/%s/%s.patch" % (p,p), + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], "/home/aur/incoming/%s/%s.patch" % (p,p), random.randrange(0,999)) out.write(s) elif others == 1: - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], "%s.patch" % p, - "/home/aur/incoming/%s/%s.patch" % (p,p), + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], "/home/aur/incoming/%s/%s.patch" % (p,p), random.randrange(0,999)) out.write(s) - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], "arch.patch", - "/home/aur/incoming/%s/arch.patch" % p, + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], "/home/aur/incoming/%s/arch.patch" % p, random.randrange(0,999)) out.write(s) elif others == 2: - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], "%s.patch" % p, - "/home/aur/incoming/%s/%s.patch" % (p,p), + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], "/home/aur/incoming/%s/%s.patch" % (p,p), random.randrange(0,999)) out.write(s) - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], "arch.patch", - "/home/aur/incoming/%s/arch.patch" % p, + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], "/home/aur/incoming/%s/arch.patch" % p, random.randrange(0,999)) out.write(s) - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], "%s.install" % p, - "/home/aur/incoming/%s/%s.install" % (p,p), + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], "/home/aur/incoming/%s/%s.install" % (p,p), random.randrange(0,999)) out.write(s) @@ -325,7 +319,7 @@ for p in seen_pkgs.keys(): path = loc + "/" + p if not files.has_key(path): files[path] = 1 - s = "INSERT INTO PackageContents (PackageID, URLPath, FSPath, FileSize) VALUES (%d, '%s', '%s', %d);\n" % (seen_pkgs[p], os.path.basename(path), path, + s = "INSERT INTO PackageContents (PackageID, FSPath, FileSize) VALUES (%d, '%s', %d);\n" % (seen_pkgs[p], path, random.randrange(0,99999999)) out.write(s) if DBUG: print "." |