Bug 166593 - [MAINTAINER] ports-mgmt/porttools: CVS expansion of $FreeBSD:$ trashes sed pattern in util_diff
Summary: [MAINTAINER] ports-mgmt/porttools: CVS expansion of $FreeBSD:$ trashes sed pa...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dennis Herrmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 22:50 UTC by Johannes 5
Modified: 2012-04-28 09:00 UTC (History)
0 users

See Also:


Attachments
porttools-0.99_6.patch (1.69 KB, patch)
2012-04-02 22:50 UTC, Johannes 5
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes 5 2012-04-02 22:50:00 UTC
- Avoid literal appearances of "$FreeBSD:...$" in patch-util_diff.in.
- While we are here:
  - Make the affected sed pattern more flexible with regard to the
    repository path from which the port was checked out.
  - When handling -d <dir>, if the port's directory does not exist,
    fix the path used in the first check for an alternative path.
- Bump PORTREVISION.

@committer: the patch below of files/patch-util_diff.in might fail,
because of differing implementations of the expansion of
"$FreeBSD:...$FreeBSD:...$". The patch below ist against the current
version of the port as obtained with cvs, which expands both instances
of "$FreeBSD:...$" in the sed pattern (which used to set
PORTBASENAME_HEADER in util_diff). In a ports tree obtained by csup,
only the first "$FreeBSD:...$" is expanded, but not the second one
(possibly because they overlap at the "$"). So if this hunk of the
patch fails for you, please manually replace line 93 of
files/patch-util_diff.in with its new version:

+		PORTBASENAME_HEADER=`sed -n -E -e '1,/^($|[^#].*$)|\\$FreeBSD\:/s%^#.*\\$FreeBSD\:[[:space:]]*([^/]+/)*([^/]+)/Makefile.*\\$%\2%p' Makefile`

Sorry for any inconvenience - but ports dealing with ports seem to
have an increased fun factor:-)

Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: CVSauto)
Comment 1 Johannes 5 2012-04-03 14:15:55 UTC
Oops, I didn't include the How-To-Repeat section in my first mail. So
here's an easy way to see the broken sed pattern "at work", which is
caused by CVS expansion of "$FreeBSD:...$" in the checked out version of
ports-mgmt/porttools/files/patch-util_diff.in:

>How-To-Repeat:
% cd /usr/ports/ports-mgmt/porttools
% grep FreeBSD Makefile
# $FreeBSD: ports/ports-mgmt/porttools/Makefile,v 1.31 2012/04/01 20:06:07 amdmi3 Exp $
% port | head -1
FreeBSD Port Tools 0.99_5
% port submit -P | head -4
Default diff mode is /usr/ports
sed: 1: "1,/^($|[^#].*$)|\$FreeB ...": extra characters at the end of p command
Warning: current directory name differs from Makefile header:
	porttools != 
===> Generating patch
%
Comment 2 Dennis Herrmann freebsd_committer freebsd_triage 2012-04-25 19:01:45 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dhn

I'll take it.
Comment 3 Dennis Herrmann freebsd_committer freebsd_triage 2012-04-28 08:58:27 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 4 dfilter service freebsd_committer freebsd_triage 2012-04-28 08:58:27 UTC
dhn         2012-04-28 07:58:13 UTC

  FreeBSD ports repository

  Modified files:
    ports-mgmt/porttools Makefile 
    ports-mgmt/porttools/files patch-util_diff.in 
  Log:
  - Avoid literal appearances of "$FreeBSD:...$" in patch-util_diff.in.
  - While we are here:
  - Make the affected sed pattern more flexible with regard to the
    repository path from which the port was checked out.
  - When handling -d <dir>, if the port's directory does not exist,
    fix the path used in the first check for an alternative path.
  - Bump PORTREVISION.
  
  PR:             ports/166593
  Submitted by:   Johannes Joemann <joemann@beefree.free.de> (maintainer)
  
  Revision  Changes    Path
  1.32      +1 -1      ports/ports-mgmt/porttools/Makefile
  1.6       +2 -2      ports/ports-mgmt/porttools/files/patch-util_diff.in
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"