From owner-freebsd-ports@FreeBSD.ORG Fri Dec 16 03:13:20 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 025CD106566C; Fri, 16 Dec 2011 03:13:20 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9CB648FC13; Fri, 16 Dec 2011 03:13:19 +0000 (UTC) Received: by iakl21 with SMTP id l21so6807375iak.13 for ; Thu, 15 Dec 2011 19:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nmnXf/sswKPxMfAmRAHN0CJe+WTnKdFa+VIQTqQ/YVA=; b=ony/lJXvMKxJBTnHm5hlIYFw0vzF4iIr7/kbZdf35UPHhHmvfRoou9Am9DK+qKK3QZ M2J1qxHyt2mzpMnxqs7n7+rZlHLShgv/iIVrsPfeHYG2q3bCRSo5h7Md7D9VlG5pxdSo izkV7I/n+MEtX75pMFojUxdQGQtJY24L8FSws= MIME-Version: 1.0 Received: by 10.50.87.167 with SMTP id az7mr5913561igb.64.1324005199165; Thu, 15 Dec 2011 19:13:19 -0800 (PST) Received: by 10.42.166.201 with HTTP; Thu, 15 Dec 2011 19:13:19 -0800 (PST) In-Reply-To: <20111215210600.GA61709@azathoth.lan> References: <20111215210600.GA61709@azathoth.lan> Date: Thu, 15 Dec 2011 22:13:19 -0500 Message-ID: From: Mehmet Erol Sanliturk To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Ports List Subject: Re: Global and User package database X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2011 03:13:20 -0000 On Thu, Dec 15, 2011 at 4:06 PM, Baptiste Daroussin wrote: > On Thu, Dec 15, 2011 at 02:10:57PM -0500, Mehmet Erol Sanliturk wrote: > > Dear All , > > > > > > In the new PkgNG : > > > > https://github.com/pkgng/pkgng/blob/master/pkg/add.c > > > > > > the following statement is written : > > > > if (geteuid() != 0) { > > warnx("adding packages can only be done as root"); > > return (EX_NOPERM); > > } > > > > > > Instead of the above statement , is it possible to use a statement > > as follows ( which it may be defined as a function to be called from all > > the related > > functions / programs ) : > > > > > > > > if (geteuid() == 0) { > > > > package_db_path = ... global path name ... , etc. ; > > > > > > PKGDB_PLACE = PKGDB_DEFAULT ... etc. > > > > > > } else > > { > > > > > > package_db_path = ... local path name , ie. > > in $HOME about user path name ... , etc. ; > > > > PKGDB_PLACE = PKGDB_USER ... etc. > > > > } > > > > if (pkgdb_open(&db, PKGDB_PLACE) != EPKG_OK) { > > return (EX_IOERR); > > } > > > > > > ( Replace PKGDB_PLACE by a suitable name ... ) > > > > > > In that way , it will be possible to install packages into user home > > directory , > > instead of global package directory . > > > > For security concerns , user-installed packages will not be usable > globally > > , or > > convenient only for the user . > > > > > > > > Thank you very much . > > > > Mehmet Erol Sanliturk > > This is an interesting idea, but it deserves more thinking about it, > because it > could have more impacts. > > Could you please fill an issue on the github so that we won't forget the > idea > and will be able to discuss it. > > I don't think we will propose that feature for 1.0 but maybe it could be > discussed for 2.0 :) > > regards, > Bapt > The issue has been created . During program writing , design and implementation at the beginning is much more easier than modifications performed after a completed design and implementation . Thank you very much . Mehmet Erol Sanliturk