Bug 193923 - security/vuxml: |make validate| fails if ${.OBJDIR} already exists
Summary: security/vuxml: |make validate| fails if ${.OBJDIR} already exists
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ports Security Team
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2014-09-25 13:31 UTC by Jan Beich
Modified: 2015-05-22 07:05 UTC (History)
1 user (show)

See Also:
jbeich: maintainer-feedback? (ports-secteam)


Attachments
incomplete fix (969 bytes, patch)
2014-09-25 13:31 UTC, Jan Beich
no flags Details | Diff
workaround (510 bytes, patch)
2014-09-25 13:32 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2014-09-25 13:31:40 UTC
Created attachment 147669 [details]
incomplete fix

According to make(1) manpage

     Since make will chdir(2) to ‘.OBJDIR’ before executing any targets, each
     child process starts with that as its current working directory.

and absolute paths are more commonplace in ports without an explicit |cd|.

$ export MAKEOBJDIRPREFIX=$HOME/.cache
$ export WRKDIRPREFIX=$HOME/.cache

$ make -V .OBJDIR
/home/foo/.cache/p/security/vuxml

$ mkdir /home/foo/.cache/p/security/vuxml

$ make validate
/bin/sh /p/security/vuxml/files/tidy.sh "/p/security/vuxml/files/tidy.xsl" "/p/security/vuxml/vuln.xml" > "/p/security/vuxml/vuln.xml.tidy"
>>> Validating...
/usr/local/bin/xmllint --valid --noout /p/security/vuxml/vuln.xml
>>> Successful.
Checking if tidy differs...
... seems okay
Checking for space/tab...
... seems okay
/usr/local/bin/python2.7 /p/security/vuxml/files/extra-validation.py
Traceback (most recent call last):
  File "/p/security/vuxml/files/extra-validation.py", line 8, in <module>
    tree = ET.parse('vuln.xml')
  File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
    tree.parse(source, parser)
  File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
    source = open(source, "rb")
IOError: [Errno 2] No such file or directory: 'vuln.xml'
*** Error code 1

Stop.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-09-25 13:31:40 UTC
Auto-assigned to maintainer ports-secteam@FreeBSD.org
Comment 2 Jan Beich freebsd_committer freebsd_triage 2014-09-25 13:32:29 UTC
Created attachment 147670 [details]
workaround
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-05-22 07:04:40 UTC
A commit references this bug:

Author: delphij
Date: Fri May 22 07:04:29 UTC 2015
New revision: 386985
URL: https://svnweb.freebsd.org/changeset/ports/386985

Log:
  Pass full path to the vuln.xml file to extra-validation.py.  Without this,
  if .OBJDIR differs from .CURDIR, the validation would fail.

  PR:		193923
  Reported by:	jbeich

Changes:
  head/security/vuxml/Makefile
  head/security/vuxml/files/extra-validation.py
Comment 4 Xin LI freebsd_committer freebsd_triage 2015-05-22 07:05:28 UTC
Fixed differently, thanks for your submission!