[Collab-qa-commits] r1672 - in udd: sql udd
Lucas Nussbaum
lucas at alioth.debian.org
Thu Jan 21 02:47:37 UTC 2010
Author: lucas
Date: 2010-01-21 02:47:36 +0000 (Thu, 21 Jan 2010)
New Revision: 1672
Modified:
udd/sql/setup.sql
udd/udd/packages_gatherer.py
udd/udd/sources_gatherer.py
Log:
add derivatives table, import sidux
Modified: udd/sql/setup.sql
===================================================================
--- udd/sql/setup.sql 2010-01-21 02:46:57 UTC (rev 1671)
+++ udd/sql/setup.sql 2010-01-21 02:47:36 UTC (rev 1672)
@@ -130,7 +130,60 @@
CREATE INDEX ubuntu_packages_source_idx on ubuntu_packages(source);
CREATE INDEX ubuntu_packages_distrelcomp_idx on ubuntu_packages(distribution, release, component);
+-- Other derivatives sources and packages
+CREATE TABLE derivatives_sources
+ (source text, version debversion, maintainer text,
+ maintainer_name text, maintainer_email text, format text, files text,
+ uploaders text, bin text, architecture text, standards_version text,
+ homepage text, build_depends text, build_depends_indep text,
+ build_conflicts text, build_conflicts_indep text, priority text, section
+ text, distribution text, release text, component text, vcs_type text,
+ vcs_url text, vcs_browser text,
+ python_version text, checksums_sha1 text, checksums_sha256 text,
+ original_maintainer text, dm_upload_allowed boolean,
+ PRIMARY KEY (source, version, distribution, release, component));
+CREATE INDEX derivatives_sources_distrelcomp_idx on derivatives_sources(distribution, release, component);
+
+-- no primary key possible: duplicate rows are possible because duplicate entries
+-- in Uploaders: are allowed. yes.
+CREATE TABLE derivatives_uploaders (source text, version debversion, distribution text,
+ release text, component text, uploader text, name text, email text);
+
+GRANT SELECT ON derivatives_uploaders TO PUBLIC;
+
+CREATE INDEX derivatives_uploaders_distrelcompsrcver_idx on derivatives_uploaders(distribution, release, component, source, version);
+
+CREATE TABLE derivatives_packages_summary ( package text, version debversion, source text,
+source_version debversion, maintainer text, maintainer_name text, maintainer_email text, distribution text, release text,
+component text,
+PRIMARY KEY (package, version, distribution, release, component));
+
+CREATE INDEX derivatives_packages_summary_distrelcompsrcver_idx on derivatives_packages_summary(distribution, release, component, source, source_version);
+
+CREATE TABLE derivatives_packages_distrelcomparch (distribution text, release text,
+component text, architecture text);
+
+CREATE TABLE derivatives_packages
+ (package text, version debversion, architecture text, maintainer text, maintainer_name text, maintainer_email text, description
+ text, long_description text, source text, source_version debversion, essential text, depends text,
+ recommends text, suggests text, enhances text, pre_depends text, breaks text,
+ installed_size int, homepage text, size int,
+ build_essential text, origin text, sha1 text, replaces text, section text,
+ md5sum text, bugs text, priority text, tag text, task text, python_version text,
+ provides text, conflicts text, sha256 text, original_maintainer text,
+ distribution text, release text, component text,
+ PRIMARY KEY (package, version, architecture, distribution, release, component),
+ FOREIGN KEY (package, version, distribution, release, component) REFERENCES derivatives_packages_summary DEFERRABLE);
+
+GRANT SELECT ON derivatives_sources TO PUBLIC;
+GRANT SELECT ON derivatives_packages TO PUBLIC;
+GRANT SELECT ON derivatives_packages_summary TO PUBLIC;
+GRANT SELECT ON derivatives_packages_distrelcomparch TO PUBLIC;
+
+CREATE INDEX derivatives_packages_source_idx on derivatives_packages(source);
+CREATE INDEX derivatives_packages_distrelcomp_idx on derivatives_packages(distribution, release, component);
+
-- Bugs (archived and unarchived)
CREATE TYPE bugs_severity AS ENUM ('fixed', 'wishlist', 'minor', 'normal', 'important', 'serious', 'grave', 'critical');
@@ -284,6 +337,8 @@
CREATE TABLE popcon_src (
source text, insts int, vote int, olde int, recent int, nofiles int,
PRIMARY KEY (source));
+-- nicer name.
+CREATE VIEW sources_popcon as select * from popcon_src;
CREATE TABLE popcon_src_average (
source text, insts int, vote int, olde int, recent int, nofiles int,
@@ -292,6 +347,7 @@
GRANT SELECT ON popcon TO PUBLIC;
GRANT SELECT ON popcon_src_average TO PUBLIC;
GRANT SELECT ON popcon_src TO PUBLIC;
+GRANT SELECT ON sources_popcon TO PUBLIC;
CREATE TABLE ubuntu_popcon (
package text, insts int, vote int, olde int, recent int, nofiles int,
@@ -300,6 +356,7 @@
CREATE TABLE ubuntu_popcon_src (
source text, insts int, vote int, olde int, recent int, nofiles int,
PRIMARY KEY (source));
+CREATE VIEW ubuntu_sources_popcon AS SELECT * from ubuntu_popcon_src;
CREATE TABLE ubuntu_popcon_src_average (
source text, insts int, vote int, olde int, recent int, nofiles int,
@@ -308,6 +365,7 @@
GRANT SELECT ON ubuntu_popcon TO PUBLIC;
GRANT SELECT ON ubuntu_popcon_src_average TO PUBLIC;
GRANT SELECT ON ubuntu_popcon_src TO PUBLIC;
+GRANT SELECT ON ubuntu_sources_popcon TO PUBLIC;
-- Lintian
CREATE TYPE lintian_tagtype AS ENUM('experimental', 'overriden', 'pedantic', 'information', 'warning', 'error');
Modified: udd/udd/packages_gatherer.py
===================================================================
--- udd/udd/packages_gatherer.py 2010-01-21 02:46:57 UTC (rev 1671)
+++ udd/udd/packages_gatherer.py 2010-01-21 02:47:36 UTC (rev 1672)
@@ -93,11 +93,11 @@
for control in debian_bundle.deb822.Packages.iter_paragraphs(sequence):
# Check whether packages with architectue 'all' have already been
# imported
- if control['Architecture'] == 'all':
- t = control['Package'] + control['Version']
- if t in self.imported_all_pkgs:
- continue
- self.imported_all_pkgs[t] = 1
+ t = control['Package'] + '_' + control['Version'] + '_' + control['Architecture']
+ if t in self.imported_all_pkgs:
+ print "Already imported:" + t
+ continue
+ self.imported_all_pkgs[t] = 1
d = self.build_dict(control)
@@ -126,9 +126,8 @@
d['Source'] = split[0]
d['Source_Version'] = split[1].strip("()")
- pkgs.append(d)
-
d['maintainer_name'], d['maintainer_email'] = email.Utils.parseaddr(d['Maintainer'])
+ pkgs.append(d)
try:
cur.executemany(query, pkgs)
except psycopg2.ProgrammingError:
Modified: udd/udd/sources_gatherer.py
===================================================================
--- udd/udd/sources_gatherer.py 2010-01-21 02:46:57 UTC (rev 1671)
+++ udd/udd/sources_gatherer.py 2010-01-21 02:47:36 UTC (rev 1672)
@@ -19,8 +19,8 @@
class sources_gatherer(gatherer):
"This class imports the data from Sources.gz files into the database"
- mandatory = {'Format': 0, 'Maintainer': 0, 'Package': 0, 'Version': 0, 'Files': 0}
- non_mandatory = {'Uploaders': 0, 'Binary': 0, 'Architecture': 0,
+ mandatory = {'Maintainer': 0, 'Package': 0, 'Version': 0, 'Files': 0}
+ non_mandatory = {'Format':0, 'Uploaders': 0, 'Binary': 0, 'Architecture': 0,
'Standards-Version': 0, 'Homepage': 0, 'Build-Depends': 0,
'Build-Depends-Indep': 0, 'Build-Conflicts': 0, 'Build-Conflicts-Indep': 0,
'Priority': 0, 'Section': 0, 'Python-Version': 0, 'Checksums-Sha1':0,
More information about the Collab-qa-commits
mailing list