an_manifest.py revision 3234
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
from __future__ import print_function
import datetime
import fileinput
import getopt
import md5
import os
import re
import sys
import time
from an_report import *
after = None
before = None
summary_file = None
manifest_by_date = {}
manifest_by_ip = {}
manifest_by_arch = {}
manifest_by_lang = {}
manifest_by_pkg = {}
manifest_by_ver_pkg = {}
def report_manifest_by_arch():
print("<pre>")
for i in manifest_by_arch.keys():
print(i, manifest_by_arch[i])
print("</pre>")
def report_manifest_by_pkg():
print("<pre>")
print(i, n)
print("</pre>")
def report_manifest_by_ver_pkg():
print("<pre>")
print(i, n)
print("</pre>")
def count_manifest(mg, d):
try:
except KeyError:
try:
except KeyError:
try:
except KeyError:
try:
except KeyError:
if agent == None:
return
try:
except KeyError:
if opt == "-a":
try:
except ValueError:
if opt == "-b":
if opt == "-s":
if opt == "-w":
lastdate = None
lastdatetime = None
m = comb_log_pat.search(l)
if not m:
continue
d = None
d = lastdatetime
else:
try:
lastdatetime = d
except ValueError:
# In the case the line can't be parsed for a date, it's
# probably corrupt.
continue
continue
count_manifest(mg, d)