Package dak :: Module check_archive
[hide private]
[frames] | no frames]

Module check_archive

source code

Various different sanity checks


Contact: Debian FTP Master <ftpmaster@debian.org>

Copyright: (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org>

License: GNU General Public License version 2 or later

Functions [hide private]
 
usage(exit_code=0) source code
 
process_dir(unused, dirname, filenames)
Process a directory and output every files name which is not listed already in the filenames or global excluded dictionaries.
source code
 
check_files()
Prepare the dictionary of existing filenames, then walk through the archive pool/ directory to compare it.
source code
 
check_dscs()
Parse every .dsc file in the archive and check for it's validity.
source code
 
check_override()
Check for missing overrides in stable and unstable.
source code
 
check_source_in_one_dir()
Ensure that the source files for any given package is all in one directory so that 'apt-get source' works...
source code
 
check_checksums()
Validate all files
source code
 
Ent(Kind, Name, Link, Mode, UID, GID, Size, MTime, Major, Minor) source code
 
check_timestamps()
Check all files for timestamps in the future; common from hardware (e.g.
source code
 
check_files_in_dsc()
Ensure each .dsc lists appropriate files in its Files field (according to the format announced in its Format field).
source code
 
validate_sources(suite, component)
Ensure files mentioned in Sources exist
source code
 
validate_packages(suite, component, architecture)
Ensure files mentioned in Packages exist
source code
 
check_indices_files_exist()
Ensure files mentioned in Packages & Sources exist
source code
 
check_files_not_symlinks()
Check files in the database aren't symlinks
source code
 
chk_bd_process_dir(dirname, filenames) source code
 
check_build_depends()
Validate build-dependencies of .dsc files in the archive
source code
 
add_missing_source_checksums()
Add missing source checksums to source_metadata
source code
 
main() source code
Variables [hide private]
  db_files = {}
Cache of filenames as known by the database
  waste = 0.0
How many bytes are "wasted" by files not referenced in database
  excluded = {}
List of files which are excluded from files check
  current_file = None
  future_files = {}
  current_time = time.time()
now()
  _add_missing_source_checksums_query = R...

Imports: errno, os, stat, sys, time, apt_pkg, apt_inst, utils, Config, InvalidDscError


Function Details [hide private]

process_dir(unused, dirname, filenames)

source code 

Process a directory and output every files name which is not listed already in the filenames or global excluded dictionaries.

Parameters:
  • dirname (string) - the directory to look at
  • filenames (dict) - Known filenames to ignore

check_timestamps()

source code 

Check all files for timestamps in the future; common from hardware (e.g. alpha) which have far-future dates as their default dates.


Variables Details [hide private]

_add_missing_source_checksums_query

Value:
R"""
INSERT INTO source_metadata
  (src_id, key_id, value)
SELECT
  s.id,
  :checksum_key,
  E'\n' ||
    (SELECT STRING_AGG(' ' || tmp.checksum || ' ' || tmp.size || ' ' |\
...