mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -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
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import os
|
||||||
from util import *
|
from util import *
|
||||||
from stat import *
|
from stat import *
|
||||||
|
|
||||||
@ -52,7 +52,11 @@ class pmrule:
|
|||||||
if retcode != int(key):
|
if retcode != int(key):
|
||||||
success = 0
|
success = 0
|
||||||
elif case == "OUTPUT":
|
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
|
success = 0
|
||||||
else:
|
else:
|
||||||
print "PACMAN rule '%s' not found" % case
|
print "PACMAN rule '%s' not found" % case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user