From c114ae3f89f41a05b3b695be7984b8300bd3c68b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 12 Aug 2011 04:21:53 -0700 Subject: [PATCH] repoman: warn when --if-modified finds nothing --- bin/repoman | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/repoman b/bin/repoman index e806b3125..91704ca82 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1060,6 +1060,11 @@ except FileNotFound: # disable for non-gentoo repoman users who may not have herds. herd_base = None +modified_pkgs = 0 +if options.if_modified == "y" and not vcs: + logging.info("Not in a version controlled repository; disabling --if-modified.") + options.if_modified = "n" + for x in scanlist: #ebuilds and digests added to cvs respectively. logging.info("checking package %s" % x) @@ -1073,12 +1078,13 @@ for x in scanlist: checkdir_relative = os.path.join(catdir, checkdir_relative) checkdir_relative = os.path.join(".", checkdir_relative) - if vcs and options.if_modified == "y": + if options.if_modified == "y": checkdir_modified = False checkdir_pattern = checkdir_relative.rstrip(os.sep) + os.sep for f in chain(mychanged, mynew): if f.startswith(checkdir_pattern): checkdir_modified = True + modified_pkgs += 1 break if not checkdir_modified: continue @@ -2000,6 +2006,9 @@ for x in scanlist: "%s/metadata.xml: unused local USE-description: '%s'" % \ (x, myflag)) +if options.if_modified == "y" and modified_pkgs < 1: + logging.warn("--if-modified is enabled, but no modified packages were found!") + if options.mode == "manifest": sys.exit(dofail) -- 2.26.2