From 00cd53938d341dbc20c5e5c3cddeb593e42e0e21 Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 18 Jan 2024 10:11:55 +0000 Subject: [PATCH] revbump: improve an error message Suggested by gdt --- pkgtools/revbump/files/revbump.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgtools/revbump/files/revbump.py b/pkgtools/revbump/files/revbump.py index aa140b0730c8..682d232c4be9 100755 --- a/pkgtools/revbump/files/revbump.py +++ b/pkgtools/revbump/files/revbump.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# $NetBSD: revbump.py,v 1.6 2023/12/29 21:23:40 adam Exp $ +# $NetBSD: revbump.py,v 1.7 2024/01/18 10:11:55 wiz Exp $ # # Copyright (c) 2023 The NetBSD Foundation, Inc. # All rights reserved. @@ -207,6 +207,9 @@ def relative_path(full_path): if args.package == 'lang/go': searchlist = ['lang/go/version.mk'] else: + if not pathlib.Path(args.pkgsrcdir + '/' + args.package.rstrip('/')).exists(): + print(f'directory {args.package} does not exist or is not a pkgsrc directory') + sys.exit(1) initial_bl3 = args.package.rstrip('/') + '/buildlink3.mk' if not pathlib.Path(args.pkgsrcdir + '/' + initial_bl3).exists(): print(f'package {args.package} provides no buildlink3.mk file')