# Script to automate some parts of checking NEW packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: fernanda,v 1.2 2001-06-22 22:53:14 troup Exp $
+# $Id: fernanda,v 1.3 2001-09-27 01:22:51 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
################################################################################
+def usage (exit_code=0):
+ print """Usage: fernanda [PACKAGE]...
+Check NEW package(s).
+
+ -h, --help show this help and exit
+
+PACKAGE can be a .changes, .dsc, .deb or .udeb filename."""
+
+ sys.exit(exit_code)
+
+################################################################################
+
def do_command (command, filename):
o = os.popen("%s %s" % (command, filename));
print o.read();
print "---- control file for %s ----" % (filename);
do_command ("dpkg -I", deb_filename);
-
+
if is_a_udeb:
print "---- skipping lintian check for µdeb ----";
print ;
def check_changes (changes_filename):
changes = utils.parse_changes (changes_filename, 0);
-
+
print "---- .changes file for %s ----" % (changes_filename);
file = utils.open_file (changes_filename, 'r');
for line in file.readlines():
print line[:-1]
print ;
file.close();
-
+
files = utils.build_file_list(changes, "");
-
+
for file in files.keys():
if file[-4:] == ".deb" or file[-5:] == ".udeb":
check_deb(file);
global Cnf, projectB, db_files, waste, excluded;
apt_pkg.init();
-
+
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
- Arguments = [('D',"debug","Jennifer::Options::Debug", "IntVal"),
- ('h',"help","Jennifer::Options::Help"),
- ('v',"version","Jennifer::Options::Version")];
+ Arguments = [('h',"help","Fernanda::Options::Help")];
+ for i in [ "help" ]:
+ Cnf["Fernanda::Options::%s" % (i)] = "";
args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
+ Options = Cnf.SubTree("Fernanda::Options")
+
+ if Options["Help"]:
+ usage();
+
stdout_fd = sys.stdout;
-
+
for file in args:
try:
# Pipe output for each argument through less