Date: Fri, 3 Jun 2011 11:36:07 +0100 From: Chris Rees <utisoft@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/157560: [PATCH] Fix port: databases/pgcluster should use USERS Message-ID: <BLU0-SMTP16651B55544E45E6B49A636A97F0@phx.gbl> Resent-Message-ID: <201106031040.p53Ae7Ux041592@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 157560 >Category: ports >Synopsis: [PATCH] Fix port: databases/pgcluster should use USERS >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: Fri Jun 03 10:40:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Chris Rees >Release: FreeBSD 8.2-RELEASE-p1 i386 >Organization: bayofrum >Environment: System: FreeBSD zeus.bayofrum.net 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Sat Apr 30 15:09:06 BST 2011 root@zeus.bayofrum.net:/usr/obj/usr/src/sys/ZEUS i386 >Description: This port uses pkg-install to create new users instead of using USERS= and GROUPS=. >How-To-Repeat: >Fix: - Use USERS and GROUPS Submitted by: Chris Rees (utisoft@gmail.com) Please note that pkg-install has been removed; backupwarning was commented out anyway. --- databases-pgcluster.patch begins here --- Index: Makefile =================================================================== RCS file: /exports/cvsroot-freebsd/ports/databases/pgcluster/Makefile,v retrieving revision 1.23 diff -u -r1.23 Makefile --- Makefile 4 Dec 2010 07:30:49 -0000 1.23 +++ Makefile 2 Jun 2011 13:07:18 -0000 @@ -28,6 +28,8 @@ USE_AUTOTOOLS= autoconf MAKE_FLAGS= # empty MAKEFILE= # empty +USERS= pgsql +GROUPS= ${USERS} CONFLICTS= postgresql-* USE_RC_SUBR= pgcluster USE_LDCONFIG= yes @@ -92,10 +94,6 @@ ${MAKE} WRKSRC=${WRKSRC}/src/pgcluster/pglb AUTOCONF=${AUTOCONF} do-build .endif -pre-install: - @${SETENV} PKG_PREFIX=${PREFIX} \ - ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL - post-install: .if !defined(WITHOUT_PGCLUSTER_REPLICATION) ${MAKE} WRKSRC=${WRKSRC}/src/pgcluster/pgrp do-install Index: pkg-install =================================================================== RCS file: pkg-install diff -N pkg-install --- pkg-install 26 Jan 2004 09:02:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,65 +0,0 @@ -#! /bin/sh - -# Original: FreeBSD: ports/databases/postgresql7/pkg-install,v 1.8 2003/12/04 12:00:48 seanc Exp - -PATH=/bin:/usr/sbin - -DB_DIR=${PKG_PREFIX}/pgsql - -backupwarning() { - echo " - =========== BACKUP YOUR DATA! ============= - As always, backup your data before - upgrading. If the upgrade leads to a higher - minor revision (e.g. 7.3.x -> 7.4), a dump - and restore of all databases is - required. This is *NOT* done by the port! - - Press ctrl-C *now* if you need to pg_dump. - =========================================== -" - sleep 5 -} - -case $2 in -PRE-INSTALL) -# backupwarning - USER=pgsql - GROUP=${USER} - UID=70 - GID=${UID} - - if pw group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if pw groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d ${DB_DIR} -c "PostgreSQL Daemon" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - - if ! [ -x ~pgsql ] ; then - mkdir -p ${DB_DIR} - chown pgsql:pgsql ${DB_DIR} - fi - ;; - -BACKUPWARNING) -# backupwarning - ;; -esac --- databases-pgcluster.patch ends here --- -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BLU0-SMTP16651B55544E45E6B49A636A97F0>