Bug 184178

Summary: Ports infrastructure leaves directory for INFO=dir/file
Product: Ports & Packages Reporter: gerald
Component: Individual Port(s)Assignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description gerald 2013-11-22 21:40:00 UTC
	After staging the ports infrastructure leaves info/dir when
	INFO=dir/file has been specified in a ports Makefile.

Fix: 

Bapt proposed http://people.freebsd.org/~bapt/info-dir.diff

	Alas this results in the following upon `make deinstall`:

  /scratch2/tmp/gerald/prefix/gcc47/info/gcc47/dir: could not read (No such file or directory) and could not create (No such file or directory)
  /scratch2/tmp/gerald/prefix/gcc47/info/gcc47/dir: could not read (No such file or directory) and could not create (No such file or directory)
  :
How-To-Repeat: 	Install lang/gcc, deinstall, and watch info/gcc46 remain.
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2013-11-22 22:01:28 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to portmgr.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-11-22 22:03:14 UTC
Author: gerald
Date: Fri Nov 22 22:03:06 2013
New Revision: 334619
URL: http://svnweb.freebsd.org/changeset/ports/334619

Log:
  Work around ports infrastructure breakage introduced with staging and
  remove info/gcc46 ourselves.
  
  Reported by:	QAT, amdmi3, mandree, bf, dbn
  PR:		184178

Modified:
  head/lang/gcc46/pkg-plist

Modified: head/lang/gcc46/pkg-plist
==============================================================================
--- head/lang/gcc46/pkg-plist	Fri Nov 22 21:48:10 2013	(r334618)
+++ head/lang/gcc46/pkg-plist	Fri Nov 22 22:03:06 2013	(r334619)
@@ -78,4 +78,5 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%share/java/libgcj-tools-%%GCC_VERSION%%.jar
 @exec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
 @unexec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
+@dirrmtry info/gcc%%SUFFIX%%
 @comment Insert PLIST.lib here
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-11-23 00:24:08 UTC
Author: gerald
Date: Sat Nov 23 00:24:00 2013
New Revision: 334627
URL: http://svnweb.freebsd.org/changeset/ports/334627

Log:
  Work around ports infrastructure breakage introduced with staging and
  remove info/gcc46 ourselves.
  
  Reported by:	QAT, amdmi3, mandree, bf, dbn
  PR:		184178

Modified:
  head/lang/gcc/pkg-plist

Modified: head/lang/gcc/pkg-plist
==============================================================================
--- head/lang/gcc/pkg-plist	Sat Nov 23 00:15:03 2013	(r334626)
+++ head/lang/gcc/pkg-plist	Sat Nov 23 00:24:00 2013	(r334627)
@@ -78,4 +78,5 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%share/java/libgcj-tools-%%GCC_VERSION%%.jar
 @exec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
 @unexec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
+@dirrmtry info/gcc%%SUFFIX%%
 @comment Insert PLIST.lib here
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-11-23 09:48:50 UTC
Author: bapt
Date: Sat Nov 23 09:48:42 2013
New Revision: 334652
URL: http://svnweb.freebsd.org/changeset/ports/334652

Log:
  Fix handling of info files with pkgng, when dealing with .info-X files and also what INFO_SUBDIR.
  The .info-X handling was wrong since the beginning of pkgng, the INFO_SUBDIR regression was introduced with stage
  
  PR:		ports/184178
  Reported by:	gerald
  Tested by:	gerald

Modified:
  head/Keywords/info.yaml
  head/Mk/bsd.port.mk
  head/Mk/bsd.stage.mk

Modified: head/Keywords/info.yaml
==============================================================================
--- head/Keywords/info.yaml	Sat Nov 23 09:25:06 2013	(r334651)
+++ head/Keywords/info.yaml	Sat Nov 23 09:48:42 2013	(r334652)
@@ -5,10 +5,10 @@
 actions: [file]
 post-install: |
   file=%D/%@
-  install-info --quiet %D/%@ ${file%/*}/dir
+  install-info --quiet %D/%@ %D/info/dir
 post-deinstall: |
   file=%D/%@
-  install-info --quiet --delete %D/%@ ${file%/*}/dir
+  install-info --quiet --delete %D/%@ %D/info/dir
   if [ $(info -d ${file%/*}  --output - 2>/dev/null | grep -c '^*') -eq 1 ]; then
     rm -f ${file%/*}/dir
   fi

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Sat Nov 23 09:25:06 2013	(r334651)
+++ head/Mk/bsd.port.mk	Sat Nov 23 09:48:42 2013	(r334652)
@@ -6001,7 +6001,9 @@ add-plist-info:
 # Process GNU INFO files at package install/deinstall time
 .if defined(INFO)
 .for i in ${INFO}
+.if defined(NO_STAGE)
 	install-info --quiet ${PREFIX}/${INFO_PATH}/$i.info ${PREFIX}/${INFO_PATH}/dir
+.endif
 .if !defined(WITH_PKGNG)
 	@${ECHO_CMD} "@unexec install-info --quiet --delete %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
 		>> ${TMPPLIST}
@@ -6011,11 +6013,16 @@ add-plist-info:
 	@${ECHO_CMD} "@exec install-info --quiet %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
 		>> ${TMPPLIST}
 .else
-	@${LS} ${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${PREFIX}/:@info\ :g >> ${TMPPLIST}
+	@${ECHO_CMD} "@info ${INFO_PATH}/$i.info" >> ${TMPPLIST}
+	@${LS} ${PREFIX}/${INFO_PATH}/$i.info-* 2>/dev/null | ${SED} -e s:${PREFIX}/:@info\ :g >> ${TMPPLIST}
 .endif
 .endfor
 .if defined(INFO_SUBDIR)
+.if !defined(WITH_PKGNG)
 	@${ECHO_CMD} "@unexec ${RMDIR} %D/${INFO_PATH}/${INFO_SUBDIR} 2> /dev/null || true" >> ${TMPPLIST}
+.else
+	@${ECHO_CMD} "@dirrmtry ${INFO_PATH}/${INFO_SUBDIR}" >> ${TMPPLIST}
+.endif
 .endif
 .if (${PREFIX} != "/usr")
 	@${ECHO_CMD} "@unexec if [ -f %D/${INFO_PATH}/dir ]; then if sed -e '1,/Menu:/d' %D/${INFO_PATH}/dir | grep -q '^[*] '; then true; else rm %D/${INFO_PATH}/dir; fi; fi" >> ${TMPPLIST}

Modified: head/Mk/bsd.stage.mk
==============================================================================
--- head/Mk/bsd.stage.mk	Sat Nov 23 09:25:06 2013	(r334651)
+++ head/Mk/bsd.stage.mk	Sat Nov 23 09:48:42 2013	(r334652)
@@ -68,24 +68,6 @@ compress-man:
 	done
 .endif
 
-.if !target(add-plist-info)
-add-plist-info:
-.for i in ${INFO}
-.if !defined(WITH_PKGNG)
-	@${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
-	@${ECHO_CMD} "@unexec install-info --quiet --delete %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
-		>> ${TMPPLIST}
-	@${ECHO_CMD} "@unexec [ \`info -d %D/${INFO_PATH}  --output - 2>/dev/null | grep -c '^*'\` -eq 1 ] && rm -f %D/${INFO_PATH}/dir || :"\
-		>> ${TMPPLIST}
-	@${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}${PREFIX}/::g >> ${TMPPLIST}
-	@${ECHO_CMD} "@exec install-info --quiet %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
-		>> ${TMPPLIST}
-.else
-	@${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}${PREFIX}/:@info\ :g >> ${TMPPLIST}
-.endif
-.endfor
-.endif
-
 .if !target(makeplist)
 makeplist: stage
 	@${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh makeplist
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Baptiste Daroussin freebsd_committer freebsd_triage 2013-11-23 09:50:54 UTC
State Changed
From-To: open->closed

Fixed. Thanks!
Comment 6 dfilter service freebsd_committer freebsd_triage 2013-12-07 10:02:02 UTC
Author: gerald
Date: Sat Dec  7 10:01:55 2013
New Revision: 335819
URL: http://svnweb.freebsd.org/changeset/ports/335819

Log:
  Revert revision 334619 from 2013-11-22 that worked around a problem with
  the staging infrastructure and had us remove info/gcc46 ourselves. [1]
  
  This has now been addressed in the general infrastructure and actually
  causes warnings in some cases. [2]
  
  PR:		184178 [1]
  Reported by:	amdmi3 [2]

Modified:
  head/lang/gcc46/pkg-plist

Modified: head/lang/gcc46/pkg-plist
==============================================================================
--- head/lang/gcc46/pkg-plist	Sat Dec  7 09:11:54 2013	(r335818)
+++ head/lang/gcc46/pkg-plist	Sat Dec  7 10:01:55 2013	(r335819)
@@ -78,5 +78,4 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%share/java/libgcj-tools-%%GCC_VERSION%%.jar
 @exec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
 @unexec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
-@dirrmtry info/gcc%%SUFFIX%%
 @comment Insert PLIST.lib here
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 dfilter service freebsd_committer freebsd_triage 2013-12-07 10:05:56 UTC
Author: gerald
Date: Sat Dec  7 10:05:49 2013
New Revision: 335820
URL: http://svnweb.freebsd.org/changeset/ports/335820

Log:
  Revert revision 334627 from 2013-11-23 that worked around a problem with
  the staging infrastructure and had us remove info/gcc46 ourselves. [1]
  
  This has now been addressed in the general infrastructure and actually
  causes warnings in some cases. [2]
  
  PR:		184178 [1]
  Reported by:	amdmi3 [2]

Modified:
  head/lang/gcc/pkg-plist

Modified: head/lang/gcc/pkg-plist
==============================================================================
--- head/lang/gcc/pkg-plist	Sat Dec  7 10:01:55 2013	(r335819)
+++ head/lang/gcc/pkg-plist	Sat Dec  7 10:05:49 2013	(r335820)
@@ -78,5 +78,4 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%share/java/libgcj-tools-%%GCC_VERSION%%.jar
 @exec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
 @unexec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
-@dirrmtry info/gcc%%SUFFIX%%
 @comment Insert PLIST.lib here
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"