checkupdate: Add a new -e option that reports 'everything'.
When the -e option is enabled, report file revision information for 'everything', including files that don't need a translation update.
This commit is contained in:
parent
c6689b0c3f
commit
7477abce2e
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=32282
2 changed files with 16 additions and 3 deletions
|
@ -32,7 +32,7 @@
|
|||
.Nd "check a translation of the FreeBSD doc/ tree for source updates"
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl anpqv
|
||||
.Op Fl aenpqv
|
||||
.Op Fl R Ar workspace
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
|
@ -54,6 +54,10 @@ The options are as follows:
|
|||
.Bl -tag -width ".Fl f Ar flist"
|
||||
.It Fl a
|
||||
Enable all file checks for each input file.
|
||||
.It Fl e
|
||||
Report everything.
|
||||
File revision information is displayed for all the files of our input
|
||||
list, and not just the files that actually need to be updated.
|
||||
.It Fl n
|
||||
Disable all file checks.
|
||||
.It Fl p
|
||||
|
|
|
@ -71,6 +71,7 @@ checks = None # No checks are done by default.
|
|||
patchmode = False # Snow patches that need translation.
|
||||
root = "." # The default workspace directory.
|
||||
verbose = None # Run in `quiet' mode by default.
|
||||
everything = False # Report everything, i.e. all input files.
|
||||
|
||||
# -------------------- useful functions --------------------------------
|
||||
|
||||
|
@ -296,6 +297,11 @@ def checkinfo(info):
|
|||
debug(2, "No translated file in info: %s" % str(info))
|
||||
return None
|
||||
|
||||
# Report all files, if `everything' is enabled.
|
||||
if everything:
|
||||
reportfile(fname, frev, srcfile, srcexists, srcid, srcrev)
|
||||
return True
|
||||
|
||||
# If a file has an fname and only one of srcfile but no srcid or
|
||||
# srcrev, then we report it because it seems 'odd' to have only a
|
||||
# `%SOURCE%' tag.
|
||||
|
@ -353,7 +359,7 @@ def processfile(fname):
|
|||
|
||||
def usage():
|
||||
"""Print a usage message, and exit."""
|
||||
print "usage: %s [-anpqv] [-R workspace]" % progname
|
||||
print "usage: %s [-aenpqv] [-R workspace]" % progname
|
||||
exit(1)
|
||||
|
||||
# -------------------- main script body --------------------------------
|
||||
|
@ -361,7 +367,7 @@ def usage():
|
|||
if __name__ == "__main__":
|
||||
debug(3, "Parsing script options")
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], 'anpqR:v')
|
||||
opts, args = getopt.getopt(sys.argv[1:], 'aenpqR:v')
|
||||
except getopt.GetoptError, err:
|
||||
usage()
|
||||
|
||||
|
@ -371,6 +377,9 @@ if __name__ == "__main__":
|
|||
if o == '-a':
|
||||
debug(3, "Enabling all file checks")
|
||||
checks = allchecks # All file checks enabled.
|
||||
elif o == '-e':
|
||||
debug(3, "Reporting file revision info for everything")
|
||||
everything = True
|
||||
elif o == '-n':
|
||||
debug(3, "Disabling all file checks")
|
||||
checks = None # No file checks enabled.
|
||||
|
|
Loading…
Reference in a new issue