forked from Mirror/pmbootstrap
pmbootstrap log: Add a -n/--lines parameter (like tail has)
...also increase the default line count to 30, so it's easier to spot an error if you didn't have the log open when it happened. This parameter also works for 'pmbootstrap log_distccd', for consistency.
This commit is contained in:
parent
9515782f8d
commit
50195a6af2
2 changed files with 10 additions and 5 deletions
|
@ -73,13 +73,17 @@ def arguments():
|
||||||
# Actions
|
# Actions
|
||||||
sub = parser.add_subparsers(title="action", dest="action")
|
sub = parser.add_subparsers(title="action", dest="action")
|
||||||
sub.add_parser("init", help="initialize config file")
|
sub.add_parser("init", help="initialize config file")
|
||||||
sub.add_parser("log", help="follow the pmbootstrap logfile")
|
|
||||||
sub.add_parser("log_distccd", help="follow the distccd logfile")
|
|
||||||
sub.add_parser("shutdown", help="umount, unregister binfmt")
|
sub.add_parser("shutdown", help="umount, unregister binfmt")
|
||||||
sub.add_parser("index", help="re-index all repositories with custom built"
|
sub.add_parser("index", help="re-index all repositories with custom built"
|
||||||
" packages (do this after manually removing package files)")
|
" packages (do this after manually removing package files)")
|
||||||
arguments_flasher(sub)
|
arguments_flasher(sub)
|
||||||
|
|
||||||
|
# Action: log
|
||||||
|
log = sub.add_parser("log", help="follow the pmbootstrap logfile")
|
||||||
|
log_distccd = sub.add_parser("log_distccd", help="follow the distccd logfile")
|
||||||
|
for action in [log, log_distccd]:
|
||||||
|
action.add_argument("-n", "--lines", default="30", help="count of initial output lines")
|
||||||
|
|
||||||
# Action: zap
|
# Action: zap
|
||||||
zap = sub.add_parser("zap", help="safely delete chroot"
|
zap = sub.add_parser("zap", help="safely delete chroot"
|
||||||
"folders")
|
"folders")
|
||||||
|
|
|
@ -78,10 +78,11 @@ def main():
|
||||||
elif args.action == "stats":
|
elif args.action == "stats":
|
||||||
pmb.build.ccache_stats(args, args.arch)
|
pmb.build.ccache_stats(args, args.arch)
|
||||||
elif args.action == "log":
|
elif args.action == "log":
|
||||||
pmb.helpers.run.user(args, ["tail", "-f", args.log], log=False)
|
pmb.helpers.run.user(args, ["tail", "-f", args.log,
|
||||||
|
"-n", args.lines], log=False)
|
||||||
elif args.action == "log_distccd":
|
elif args.action == "log_distccd":
|
||||||
pmb.chroot.user(args, ["tail", "-f", "/home/user/distccd.log"],
|
pmb.chroot.user(args, ["tail", "-f", "/home/user/distccd.log",
|
||||||
log=False)
|
"-n", args.lines], log=False)
|
||||||
elif args.action == "zap":
|
elif args.action == "zap":
|
||||||
pmb.chroot.zap(args)
|
pmb.chroot.zap(args)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue