*Synopsis*: Cadmium .NOT file processing problem with CWD relative file paths
CR 6798660 changed on Feb 2 2009 by <User 1-28L01W> === Field ============ === New Value ============= === Old Value ============= See Also 6800164 ====================== =========================== =========================== *Change Request ID*: 6798660 *Synopsis*: Cadmium .NOT file processing problem with CWD relative file paths Product: solaris Category: consolidation Subcategory: os-net-tools Type: Defect Subtype: Status: 3-Accepted Substatus: Priority: 4-Low Introduced In Release: Introduced In Build: Responsible Engineer: Keywords: === *Description* ============================================================ I've been working on adding a new linker mapfile check (mapfilechk) to cadmium, patterned on cddlchk, as detailed in the CR: 6785284 Mapfile versioning rules need to be more visible to gatelings In a nutshell, there will be a standard comment in all of the OSnet link-editor mapfiles, and the mapfilechk command will be used to keep them intact. I already have it working, largely by copying cddlchk, and modifying it to suit. However, I've hit a problem with cdm.py. mapfilechk examines any file with a name that matches '*mapfile*', and ignores all others. However, there are a small number of files in OSnet that match this pattern that are not actually mapfiles. For instance, mapfilechk itself. I need to have an exceptions list for these files. I am using the .NOT file mechanism supported in cdm.py via the not_check() function. Using cddlchk as an example: def cdm_cddlchk(ui, repo, *args, **opts): ... filelist = opts.get('filelist') or _buildfilelist(repo, args) ... exclude = not_check(repo, 'cddlchk') for f, e in filelist.iteritems(): if e and e.is_removed(): continue elif (e or opts.get('honour_nots')) and exclude(f): ui.status('Skipping %s...\n' % f) continue ... The problem I'm encountering is that the list of files returned by _buildfilelist() is relative to the working directory, while the list of file path exceptions needs to be relative to the workspace root. Consequently, exclude() only matches if my working directory is set to the workspace root. Having the list of files generated by _buildfilelist() be relative to the workspace is convenient for the tools, since they can simply open the desired files from those paths. However, for the purposes of excluding files, they need to be taken relative to the workspace root instead. *** (#1 of 1): 2009-01-28 16:52:29 GMT+00:00 <User 1-28L01W> === *Public Comments* ======================================================== One solution would be to enhance cdm.py:_buildfilelist() to always set the value, regardless of whether a file was in the active list. It would then need a separate means of tracking whether or not we were using the active list vs specific file(s), and the exclude() checks should be updated to be on the value, rather than the key, from the filelist dictionary. *** (#1 of 1): 2009-01-28 18:52:55 GMT+00:00 <User 1-5Q-8204> === *Workaround* ============================================================= === *Additional Details* ===================================================== Targeted Release: Commit To Fix In Build: Fixed In Build: Integrated In Build: Verified In Build: See Also: 6785284, 6800164 Duplicate of: Hooks: Hook1: Hook2: Hook3: Hook4: Hook5: Hook6: Program Management: Root Cause: Fix Affects Documentation: No Fix Affects Localization: No === *History* ================================================================ Date Submitted: 2009-01-28 16:52:29 GMT+00:00 Submitted By: <User 1-28L01W> Status Changed Date Updated Updated By 3-Accepted 2009-01-28 18:52:55 GMT+00:00 <User 1-5Q-8204> === *Service Request* ======================================================== Impact: Limited Functionality: Primary Severity: 3 Product Name: solaris Product Release: solaris_nevada Product Build: Operating System: solaris_nevada Hardware: generic Submitted Date: 2009-01-28 16:52:29 GMT+00:00 === *Multiple Release (MR) Cluster* - 0 ======================================