Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Nov 2010 02:43:13 +0100
From:      Alexander Wittig <alexander@wittig.name>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/152562: [PATCH] www/phpbb3 pkg-plist deletes config.php file
Message-ID:  <E1PLQrh-0003M6-Dw@hotzenplotz.wittig.name>
Resent-Message-ID: <201011250150.oAP1oA8W032037@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152562
>Category:       ports
>Synopsis:       [PATCH] www/phpbb3 pkg-plist deletes config.php file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 25 01:50:10 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Wittig <alexander@wittig.name>
>Release:        FreeBSD 8.2-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD hotzenplotz.wittig.name 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Wed Nov 24 16:31:48 CET 2010 root@hotzenplotz.wittig.name:/usr/obj/usr/src/sys/ALEX amd64


	
>Description:
	pkg-plist lists the configuration fiel for the board explicitly. Thus, it is always deleted on updates, eventhough the makefile has provisions to check if there is a config fil(it only creates an empty file by "touch config.php" if there is none)

	Another question: is there a reason why all files are installed as executable? Not only the .php files are, even the txt and other files. Possibly a "find . -type f -exec chmod 644 {} \;" is in order there at the end of installation...
	
>How-To-Repeat:
	Install port, edit config.php, the run portmaster / portupgarde / make deinstall reinstall or whatever. After that, config.php is empty
	
>Fix:
	Attached patch changes pkg-plist to mimick the behaviour of teh Makefile: if there is a config.php and it is not empty, then do not delete it. At installation time, create an empty config.php if none is there.
	

--- patch-pkg-plist.diff begins here ---
--- /usr/ports/www/phpbb3/pkg-plist	2010-11-23 10:43:37.000000000 +0100
+++ pkg-plist	2010-11-25 02:27:09.000000000 +0100
@@ -128,7 +128,8 @@
 %%PHPBBDIR%%/cache/.htaccess
 %%PHPBBDIR%%/cache/index.htm
 %%PHPBBDIR%%/common.php
-%%PHPBBDIR%%/config.php
+@unexec if [ ! -s %%PHPBBDIR%%/config.php ]; then rm -f %%PHPBBDIR%%/config.php; fi
+@exec if [ ! -f %%PHPBBDIR%%/config.php ]; then touch %%PHPBBDIR%%/config.php; fi
 %%PHPBBDIR%%/cron.php
 %%PHPBBDIR%%/docs/AUTHORS
 %%PHPBBDIR%%/docs/CHANGELOG.html
--- patch-pkg-plist.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1PLQrh-0003M6-Dw>