From nobody@FreeBSD.org  Sat Jul  4 15:41:47 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7A051065670
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  4 Jul 2009 15:41:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id C5A0B8FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  4 Jul 2009 15:41:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n64Ffll8069976
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 4 Jul 2009 15:41:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n64Fflm6069975;
	Sat, 4 Jul 2009 15:41:47 GMT
	(envelope-from nobody)
Message-Id: <200907041541.n64Fflm6069975@www.freebsd.org>
Date: Sat, 4 Jul 2009 15:41:47 GMT
From: Hannes <freebsd@soulrebel.in-berlin.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: "portsnap fetch" not useable by other programss
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         136325
>Category:       bin
>Synopsis:       portsnap(8): "portsnap fetch" not useable by other programss
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 04 15:50:04 UTC 2009
>Closed-Date:    Thu May 10 00:17:39 UTC 2012
>Last-Modified:  Thu May 10 00:17:39 UTC 2012
>Originator:     Hannes
>Release:        FreeBSD-7.2-Prerelease
>Organization:
>Environment:
FreeBSD fbsdlap.freedom.lan 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE #3: Wed Jul  1 13:08:07 CEST 2009     root@fbsdlap.freedom.lan:/usr/obj/usr/src/sys/BLOBFREE  i386

>Description:
portsnap checks if it is called by another process or from a terminal. If it is called by another Process it won't do "portsnap fetch" reminding the user that portsnap is called non-interactively for which the "portsnap cron" command is recommended.

However cron is only one example of an non-interactive use. In my case I want KPorts to able to update the ports (I write KPorts). Calling "portsnap cron" and waiting up to five minutes is kind of ridiculous in this scenario.

Can someone please look into this, as I will be forced to ship a modified version of portsnap otherwise, something I really would rather not.

Thanks for your help!

Regards,
Hannes


>How-To-Repeat:

>Fix:
1) Good solution: Really check, whether the calling process is the cron-daemon and not complain otherwise

2) Workaround: Only warn and don't exit on non-interactive call:


--- /usr/sbin/portsnap  2009-04-15 22:01:12.000000000 +0200
+++ /tmp/portsnap_workaround    2009-07-04 17:31:45.000000000 +0200
@@ -1002,7 +1002,7 @@
                echo -n "`basename $0` fetch should not "
                echo "be run non-interactively."
                echo "Run `basename $0` cron instead."
-               exit 1
+#              exit 1
        fi
        fetch_check_params
        fetch_run || exit 1


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cperciva 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jul 4 19:30:31 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136325 
Responsible-Changed-From-To: cperciva->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue May 8 00:15:34 UTC 2012 
Responsible-Changed-Why:  
I submitted an identical patch and then found this PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136325 
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Thu May 10 00:17:37 UTC 2012 
State-Changed-Why:  
maintainer considers it a feature 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136325 
>Unformatted:
