mirror of
https://abf.rosa.ru/djam/urpm-tools.git
synced 2025-02-23 17:32:46 +00:00
Merge commit '1a7cc57cf0ba974d06dd1487fa7b8bc0d1ce6a2d'
This commit is contained in:
commit
adb71ede03
7 changed files with 1078 additions and 1030 deletions
|
@ -1,13 +1,14 @@
|
|||
.\" urpm-repodiff
|
||||
.TH "urpm-repodiff" "1" "21 December 2011" "Vladimir Testov" "Mandriva Package Management"
|
||||
.TH "urpm-repodiff" "1" "21 September 2012" "Vladimir Testov" "ROSA Package Management"
|
||||
.SH "NAME"
|
||||
urpm-repodiff - diff for urpmi repositories
|
||||
.SH "SYNOPSIS"
|
||||
\fBurpm-repodiff\fP [options] --old old_repo_baseurl [old_repo_baseurl ...] --new new_repo_baseurl [new_repo_baseurl ...]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBurpm-repodiff\fP is a program which will list differences between two sets of
|
||||
repositories.
|
||||
\fBurpm-repodiff\fP is a program that lists differences between two sets of
|
||||
repositories. You can use more than one --old(--new) option. Every group of repositories will be joined
|
||||
(max package version will be selected in each group)
|
||||
.PP
|
||||
.SH "GENERAL OPTIONS"
|
||||
.IP "\fB\-\-old, -o\fP"
|
||||
|
@ -18,6 +19,14 @@ repositories.
|
|||
Quiet mode: hide service messages.
|
||||
.IP "\fB\-\-no-release, -r\fP"
|
||||
Ignore release during package compare.
|
||||
.IP "\fB\-\-output, -o OUTPUT_FILE\fP"
|
||||
Change standart output to OUTPUT_FILE.
|
||||
.IP "\fB\-\-show-summary\fP"
|
||||
Show summary - total new packages, total removed packages, total updated packages, total downgraded packages.
|
||||
Output depends on selected filters.
|
||||
.IP "\fB\-\-ignore, -i IGNORELIST\fP"
|
||||
Read list of ignored package names from file IGNORELIST. For ignoring all packages that starts with some PATTERN, add
|
||||
PATTERN* to IGNORELIST.
|
||||
.PP
|
||||
.SH "USUAL OUTPUT OPTIONS"
|
||||
.IP "\fB\-\-size, -s\fP"
|
||||
|
@ -30,11 +39,11 @@ Show changelog difference.
|
|||
.SH "HTML OUTPUT OPTION"
|
||||
.IP "\fB\-\-html\fP"
|
||||
Output difference in format of html page. In case of using this option \fB--size, -s\fP, \fB--simple\fP and \fB--changelog\fP options are ignored.
|
||||
If \fB--output, -o\fP option is not present, page will be output to file 'repodiff.html' in the current directory.
|
||||
.PP
|
||||
.SH "OUTPUT OPTION"
|
||||
.IP "\fB\-\-output, -o OUTPUT_FILE\fP"
|
||||
Change standart output to OUTPUT_FILE.
|
||||
If \fB\-\-output, -o\fP option is not present, page will be output to file 'repodiff.html' in the current directory.
|
||||
.IP "\fB\-\-reponames REPONAME [REPONAME ...]\fP"
|
||||
Repository names for output.
|
||||
.IP "\fB\-\-title, -t TITLE\fP"
|
||||
Set title as TITLE. "Difference between repositories." by default.
|
||||
.SH "FILTER OPTION"
|
||||
.IP "\fB\-\-show-new, -N\fP"
|
||||
Show new packages.
|
||||
|
|
|
@ -20,6 +20,8 @@ show help message and exit
|
|||
print the older packages
|
||||
.IP "\fB\-\-new, -n\fP"
|
||||
print the newest packages (this is the default behavior)
|
||||
.IP "\fB\-\-obsolete, -b\fP"
|
||||
report obsolete packages; packages that obsolete themselves are not taken into account
|
||||
.IP "\fB\-\-remove-old, -r\fP"
|
||||
remove older packages
|
||||
.IP "\fB\-\-space, -s\fP"
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -93,9 +93,9 @@ def ParseCommandLine():
|
|||
help=_("Ignore release during package compare."))
|
||||
group.add_argument("--show-summary", action="store_true",
|
||||
help=_("Output summary."))
|
||||
group.add_argument("--output", "-out", action="store", nargs=1, default='',
|
||||
group.add_argument("--output", "-out", action="store", default=default_output,
|
||||
metavar="OUTPUT_FILE", help=_("Change standart output to \"OUTPUT_FILE\"."))
|
||||
group.add_argument("--ignore", "-i", action="store", nargs=1, default='',
|
||||
group.add_argument("--ignore", "-i", action="store", default='',
|
||||
metavar="IGNORELIST", help=_("File with list of ignored packages"))
|
||||
group = parser.add_argument_group(_('text mode parameters'),
|
||||
description=_("Parameters used only in text mode. (--html not present)"))
|
||||
|
@ -113,6 +113,9 @@ def ParseCommandLine():
|
|||
--size, --simple and --changelog options are ignored.") % htmlname)
|
||||
group.add_argument("--reponames", action="store", nargs='+', default='',
|
||||
metavar="REPONAME", help=_("Repository names for output."))
|
||||
group.add_argument("--title", "-t", action="store",
|
||||
default="Difference between repositories.",
|
||||
help=_("Set title."))
|
||||
group = parser.add_argument_group(_('Filters'),
|
||||
description=_("Filters for output. If none selected then every type will\
|
||||
be shown"))
|
||||
|
@ -237,6 +240,7 @@ def CheckParam(arg):
|
|||
exit_proc(arg)
|
||||
else:
|
||||
arg.repnames = ''
|
||||
arg.title = ''
|
||||
|
||||
def GetFile(urlpath, filename, localdir, arg):
|
||||
"""Donwload archive.
|
||||
|
@ -1261,7 +1265,9 @@ function sort_diff(col, type) {
|
|||
"""
|
||||
return javacontent
|
||||
|
||||
def HTML_OutputHead(file_output):
|
||||
def HTML_OutputHead(arg):
|
||||
file_output = arg.output
|
||||
title = arg.title
|
||||
"""Output beginning of the document.
|
||||
|
||||
Outputs static text.
|
||||
|
@ -1270,7 +1276,7 @@ def HTML_OutputHead(file_output):
|
|||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n' +\
|
||||
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n' +
|
||||
'<head>\n' +\
|
||||
'<title>Differences between repositories</title>\n' +\
|
||||
'<title>' + title + '</title>\n' +\
|
||||
'<meta name="keywords" content="Mandriva,Rosa,RPM,repository,difference,changes"/>\n' +\
|
||||
'<meta name="description" content="List of changes between repositories"/>\n' +\
|
||||
'<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>\n' +\
|
||||
|
@ -1358,9 +1364,10 @@ def HTML_OutputBody(dict_packages, list_dict_old, list_dict_new, arg):
|
|||
ifreleaseignore = arg.no_release
|
||||
reponames = arg.reponames
|
||||
show_summary = arg.show_summary
|
||||
title = arg.title
|
||||
show_mask = [arg.show_new, arg.show_removed, arg.show_updated, arg.show_downgraded]
|
||||
|
||||
file_output.write('<h1>Difference between repositories.</h1>\n' +\
|
||||
file_output.write('<h1>' + title + '</h1>\n' +\
|
||||
'<p class="bold">The use of color coding in tables:</p>\n' +\
|
||||
'<table>\n' +\
|
||||
'<tbody><tr><td class="new">New</td>\n' +\
|
||||
|
@ -1496,7 +1503,7 @@ def HTML_Output(dict_packages, list_dict_old, list_dict_new, arg):
|
|||
|
||||
if ifnotquiet:
|
||||
print _("Creating HTML file.")
|
||||
HTML_OutputHead(file_output)
|
||||
HTML_OutputHead(arg)
|
||||
HTML_OutputBody(dict_packages, list_dict_old, list_dict_new, arg)
|
||||
HTML_OutputTail(file_output)
|
||||
|
||||
|
@ -1507,13 +1514,8 @@ def main(args):
|
|||
head_new = arg.temp_dir + new_dir
|
||||
arg.temp_old = []
|
||||
arg.temp_new = []
|
||||
if (arg.output):
|
||||
tmp_output = arg.output[0]
|
||||
else:
|
||||
tmp_output = default_output
|
||||
if (arg.ignore):
|
||||
arg.ignore = arg.ignore[0]
|
||||
arg.output = None;
|
||||
tmp_output = arg.output
|
||||
arg.output = None
|
||||
for i in range(len(arg.old)):
|
||||
arg.temp_old.append([])
|
||||
for j in range(len(arg.old[i])):
|
||||
|
@ -1525,6 +1527,7 @@ def main(args):
|
|||
arg.new[i][j] = CheckArgs(arg.new[i][j], arg)
|
||||
arg.temp_new[i].append(head_new + str(i) + '-' + str(j) + '/')
|
||||
arg.output = tmp_output
|
||||
arg.summary = ''
|
||||
CheckOutput(arg)
|
||||
CheckParam(arg)
|
||||
|
||||
|
|
|
@ -95,6 +95,8 @@ def parseargs(args):
|
|||
help=_('print the older packages'))
|
||||
group.add_argument("-n", "--new", default=False, action="store_true",
|
||||
help=_('print the newest packages (this is the default behavior)'))
|
||||
group.add_argument("-b", "--obsolete", default=False, action="store_true",
|
||||
help=_('report obsolete packages'))
|
||||
parser.add_argument("-r", "--remove-old", default=False, action="store_true",
|
||||
help=_('remove older packages'))
|
||||
parser.add_argument("-s", "--space", default=False, action="store_true",
|
||||
|
@ -124,6 +126,7 @@ def main(args):
|
|||
rpmList = getFileList(mydir, '.rpm', rpmList)
|
||||
verfile = {}
|
||||
pkgdict = {} # hold all of them - put them in (n,a) = [(e,v,r),(e1,v1,r1)]
|
||||
obsolete = {}
|
||||
|
||||
keepnum = int(options.keep)*(-1) # the number of items to keep
|
||||
|
||||
|
@ -145,6 +148,15 @@ def main(args):
|
|||
errorprint(msg)
|
||||
continue
|
||||
|
||||
if options.obsolete:
|
||||
obsolete_by_pkg = hdr[rpm.RPMTAG_OBSOLETENAME]
|
||||
for obs in obsolete_by_pkg:
|
||||
# Do not count packages obsoleted by themselves - let's leave this for rpmlint
|
||||
if hdr['name'] != obs:
|
||||
if obs not in obsolete:
|
||||
obsolete[obs] = []
|
||||
obsolete[obs].append(hdr['name'])
|
||||
|
||||
pkgtuple = miscutils.pkgDistTupleFromHeader(hdr)
|
||||
(n,a,e,v,r,d) = pkgtuple
|
||||
del hdr
|
||||
|
@ -173,8 +185,20 @@ def main(args):
|
|||
# a flag indicating that old packages were found
|
||||
old_found = 0
|
||||
|
||||
if options.obsolete:
|
||||
for (n,a) in pkgdict.keys():
|
||||
evrlist = pkgdict[(n,a)]
|
||||
if n in obsolete:
|
||||
for pkg in evrlist:
|
||||
(e,v,r,d) = pkg
|
||||
print str(verfile[(n,a,e,v,r,d)]).replace("['","").replace("']","")
|
||||
if options.verbose:
|
||||
print >> sys.stderr, str(verfile[(n,a,e,v,r,d)]).replace("['","").replace("']","") + " is obsoleted by:"
|
||||
for replacement in obsolete[n]:
|
||||
print >> sys.stderr, " " + replacement
|
||||
|
||||
#if new
|
||||
if not options.old:
|
||||
if options.new:
|
||||
for (n,a) in pkgdict.keys():
|
||||
evrlist = pkgdict[(n,a)]
|
||||
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue