(List (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) (= scope= flags=0 words=[] bindings=[('BUGSDUMP', {[LIT_CHARS /srv/udd.debian.org/mirrors/clone-bugs/udd-bugs.sql.xz]})]) (Com {[LIT_CHARS unset]} {[LIT_CHARS LANG]} ) (Com {[LIT_CHARS unset]} {[LIT_CHARS LC_ALL]} ) (Com {[LIT_CHARS psql]} {[LIT_CHARS --quiet]} {[LIT_CHARS udd]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), (HereDocRedirectNode here_end='EOT' do_expansion=True body_word={[DQ [LIT_CHARS "BEGIN;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_blockedby;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_fixed_in;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_found_in;\n"][LIT_CHARS "DROP VIEW IF EXISTS bapase ;\n"][LIT_CHARS "DROP VIEW IF EXISTS bugs_count ;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_merged_with;\n"][LIT_CHARS "DROP VIEW IF EXISTS bugs_rt_affects_stable;\n"][LIT_CHARS "DROP VIEW IF EXISTS bugs_rt_affects_testing;\n"][LIT_CHARS "DROP VIEW IF EXISTS bugs_rt_affects_testing_and_unstable;\n"][LIT_CHARS "DROP VIEW IF EXISTS bugs_rt_affects_unstable;\n"][LIT_CHARS "DROP VIEW IF EXISTS bugs_rt_affects_oldstable;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_packages;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_blocks;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_tags;\n"][LIT_CHARS "DROP VIEW IF EXISTS all_bugs ;\n"][LIT_CHARS "DROP VIEW IF EXISTS sponsorship_requests; \n"][LIT_CHARS "DROP VIEW IF EXISTS wnpp; \n"][LIT_CHARS "DROP TABLE IF EXISTS bugs;\n"][LIT_CHARS "DROP TABLE IF EXISTS bugs_usertags;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs_blockedby;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs_blocks;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs_fixed_in;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs_found_in;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs_merged_with;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs_packages;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs_tags;\n"][LIT_CHARS "DROP TABLE IF EXISTS archived_bugs;\n"][LIT_CHARS "COMMIT ;\n"]]} 0), > ) (Pipeline (Com {[LIT_CHARS xzcat]} {[VarSub BUGSDUMP]} ) (Com {[LIT_CHARS psql]} {[LIT_CHARS --quiet]} {[LIT_CHARS udd]} ) ) (Com {[LIT_CHARS psql]} {[LIT_CHARS --quiet]} {[LIT_CHARS udd]} < (HereDocRedirectNode here_end='EOT' do_expansion=True body_word={[DQ [LIT_CHARS "CREATE VIEW all_bugs AS\n"][LIT_CHARS " SELECT id, package, source, arrival, status, severity,\n"][LIT_CHARS " submitter, submitter_name, submitter_email,\n"][LIT_CHARS " owner, owner_name, owner_email,\n"][LIT_CHARS " done, done_name, done_email, done_date,\n"][LIT_CHARS " title, last_modified, forwarded,\n"][LIT_CHARS " affects_oldstable, affects_stable, affects_testing, affects_unstable, affects_experimental\n"][LIT_CHARS " FROM bugs\n"][LIT_CHARS " UNION ALL\n"][LIT_CHARS " SELECT id, package, source, arrival, status, severity,\n"][LIT_CHARS " submitter, submitter_name, submitter_email,\n"][LIT_CHARS " owner, owner_name, owner_email,\n"][LIT_CHARS " done, done_name, done_email, done_date,\n"][LIT_CHARS " title, last_modified, forwarded,\n"][LIT_CHARS " affects_oldstable, affects_stable, affects_testing, affects_unstable, affects_experimental\n"][LIT_CHARS " FROM archived_bugs;\n"][LIT_CHARS "\n"][LIT_CHARS "GRANT SELECT ON all_bugs TO PUBLIC;\n"][LIT_CHARS "\n"][LIT_CHARS "create view bugs_count as\n"][LIT_CHARS "select coalesce(b1.source, b2.source) as source, coalesce(rc_bugs, 0) as rc_bugs, coalesce(all_bugs, 0) as all_bugs from\n"][LIT_CHARS "((select source, count(*) as rc_bugs\n"][LIT_CHARS "from bugs\n"][LIT_CHARS "where severity >= 'serious'\n"][LIT_CHARS "and status='pending'\n"][LIT_CHARS "and id not in (select id from bugs_merged_with where id > merged_with)\n"][LIT_CHARS "group by source) b1\n"][LIT_CHARS "FULL JOIN (select source, count(*) as all_bugs\n"][LIT_CHARS "from bugs\n"][LIT_CHARS "where status='pending'\n"][LIT_CHARS "and id not in (select id from bugs_merged_with where id > merged_with)\n"][LIT_CHARS "group by source) b2 ON (b1.source = b2.source));\n"][LIT_CHARS " \n"][LIT_CHARS "grant select on bugs_count to public;\n"][LIT_CHARS "\n"][LIT_CHARS "create view bapase as\n"][LIT_CHARS "select s.source, s.version, type, bug, description,\n"][LIT_CHARS "orphaned_time, (current_date - orphaned_time::date) as orphaned_age,\n"][LIT_CHARS "in_testing, (current_date - in_testing) as testing_age, testing_version,\n"][LIT_CHARS "in_unstable, (current_date - in_unstable) as unstable_age, unstable_version,\n"][LIT_CHARS "sync, (current_date - sync) as sync_age, sync_version,\n"][LIT_CHARS "first_seen, (current_date - first_seen) as first_seen_age,\n"][LIT_CHARS "uh.date as upload_date, (current_date - uh.date::date) as upload_age,\n"][LIT_CHARS "nmu, coalesce(nmus, 0) as nmus, coalesce(rc_bugs,0) as rc_bugs, coalesce(all_bugs,0) as all_bugs,\n"][LIT_CHARS "coalesce(insts,0) as insts, coalesce(vote,0) as vote, s.maintainer, bugs.last_modified,\n"][LIT_CHARS "(current_date - bugs.last_modified::date) as last_modified_age\n"][LIT_CHARS "from sources_uniq s\n"][LIT_CHARS "left join orphaned_packages op on s.source = op.source\n"][LIT_CHARS "left join migrations tm on s.source = tm.source\n"][LIT_CHARS "left join upload_history uh on s.source = uh.source and s.version = uh.version\n"][LIT_CHARS "left join upload_history_nmus uhn on s.source = uhn.source\n"][LIT_CHARS "left join bugs_count b on s.source = b.source\n"][LIT_CHARS "left join popcon_src ps on s.source = ps.source\n"][LIT_CHARS "left join bugs on op.bug = bugs.id\n"][LIT_CHARS "where s.distribution='debian' and s.release='sid';\n"][LIT_CHARS "GRANT SELECT ON bapase TO PUBLIC;\n"][LIT_CHARS "\n"][LIT_CHARS "CREATE VIEW sponsorship_requests AS\n"][LIT_CHARS "SELECT id,\n"][LIT_CHARS "SUBSTRING(title from '^RFS: ([^/]*)/') as source,\n"][LIT_CHARS "SUBSTRING(title from '/([^ ]*)( |"][LIT_OTHER "$"][LIT_CHARS ")') as version,\n"][LIT_CHARS "title\n"][LIT_CHARS "FROM bugs WHERE package='sponsorship-requests' AND status='pending';\n"][LIT_CHARS "\n"][LIT_CHARS "GRANT SELECT ON sponsorship_requests TO PUBLIC;\n"][LIT_CHARS "\n"][LIT_CHARS "CREATE VIEW wnpp AS\n"][LIT_CHARS "SELECT id, SUBSTRING(title from '^([A-Z]{1,3}): .*') as type, SUBSTRING(title from '^[A-Z]{1,3}: ([^ ]+ )(?: -- .*)') as source, title FROM bugs WHERE package='wnpp' AND status!='done';\n"][LIT_CHARS "\n"][LIT_CHARS "GRANT SELECT ON wnpp TO PUBLIC;\n"][LIT_CHARS "\n"]]} 0), > ) (= scope= flags=0 words=[] bindings=[('LOGFILE', {[LIT_CHARS clone_bugs_] [ComSub (Com {[LIT_CHARS date]} {[DQ [LIT_CHARS "+%Y%m%d"]]})] [LIT_CHARS .log]})]) (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[VarSub LOGFILE]} ) (FunctionDef count_bug_table [] (Com {[LIT_CHARS echo]} {[DQ [VarSub 1][LIT_CHARS ":"]]} {[ComSub (Com {[LIT_CHARS psql]} {[LIT_CHARS udd]} {[LIT_CHARS -t]} {[LIT_CHARS -c]} {[DQ [LIT_CHARS "SELECT COUNT(*) FROM "][VarSub 1]]})]} < (FilenameRedirectNode filename={[VarSub LOGFILE]} >"> 1), > ) ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_blockedby]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_fixed_in]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_found_in]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_merged_with]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_packages]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_blocks]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_tags]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS bugs_usertags]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs_blockedby]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs_blocks]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs_fixed_in]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs_found_in]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs_merged_with]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs_packages]} ) (Com {[LIT_CHARS count_bug_table]} {[LIT_CHARS archived_bugs_tags]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "MAX(id):"]]} {[ComSub (Com {[LIT_CHARS psql]} {[LIT_CHARS udd]} {[LIT_CHARS -t]} {[LIT_CHARS -c]} {[DQ [LIT_CHARS "SELECT max(id) from bugs;"]]})]} < (FilenameRedirectNode filename={[VarSub LOGFILE]} >"> 1), > ) )