# Author: Jeff Cai
#
# This script is for tranverting svr4 package names to ips packages name
# in one spec file.
# Input:
# 1. spec file xxx.spec
# 2. mapping file
# Output:
# 1. new spec file xxx.spec.new
#
import sys
import re
import string
import os
print "Usage: transform.py [spec-file-name]"
# Read mapping file
dict = {}
try:
except:
print "Error: Can not open name mapping file svr4-ips-namemapping"
print "Reading the mapping file svr4-ips-namemapping..."
try:
except:
print "Error: can not open the file " + specfile
try:
except:
else:
print "not found mapping for %s" % svr4_name
else:
print
print "Finished"
print "Transverted %d lines" % lnCnt
print "%d lines mapping not found" % nlnCnt