mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 17:31:52 -05:00
Fail sanely on OUTPUT rules when --nolog is passed
Check for existence of the logfile first, and output an error if not found Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
565d2eeed5
commit
f8b113ed97
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import os
|
||||
from util import *
|
||||
from stat import *
|
||||
|
||||
@ -52,7 +52,11 @@ class pmrule:
|
||||
if retcode != int(key):
|
||||
success = 0
|
||||
elif case == "OUTPUT":
|
||||
if not grep(os.path.join(root, LOGFILE), key):
|
||||
logfile = os.path.join(root, LOGFILE)
|
||||
if not os.access(logfile, os.F_OK):
|
||||
print "LOGFILE not found, cannot validate 'OUTPUT' rule"
|
||||
success = 0
|
||||
elif not grep(os.path.join(root, LOGFILE), key):
|
||||
success = 0
|
||||
else:
|
||||
print "PACMAN rule '%s' not found" % case
|
||||
|
Loading…
x
Reference in New Issue
Block a user