Skip to content

Commit f6ec2c6

Browse files
committed
findupd/update-pkgs.py: add whitelist
1 parent a415a0c commit f6ec2c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

findupd/update-pkgs.py

+7
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,17 @@ def classify(newest_pkgs, quite=None):
202202
'-q', '--quite', action='store_true', help='Ignore WARNING')
203203
parser.add_argument(
204204
'-e', '--exclude', action='store_true', help='exclude pkgs from blacklist.txt')
205+
parser.add_argument(
206+
'-i', '--include', action='store_true', help='include pkgs from whitelist.txt')
205207

206208
args = parser.parse_args()
207209

208210
print("Found outdated pkgs...")
209211

210212
blacklist = None
213+
whitelist = None
214+
if args.include:
215+
whitelist = load_json('whitelist.txt')
211216
if args.exclude:
212217
blacklist = load_json('blacklist.txt')
213218

@@ -239,6 +244,8 @@ def classify(newest_pkgs, quite=None):
239244
for pkg in newest_pkgs:
240245
if blacklist and pkg[0] in blacklist:
241246
continue
247+
if whitelist and pkg[0] not in whitelist:
248+
continue
242249
pkg_path = find_spec(pkg[0])
243250
if pkg_path is None:
244251
if not args.quite:

0 commit comments

Comments
 (0)