Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jul 2009 15:41:47 GMT
From:      Hannes <freebsd@soulrebel.in-berlin.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/136325: "portsnap fetch" not useable by other programss
Message-ID:  <200907041541.n64Fflm6069975@www.freebsd.org>
Resent-Message-ID: <200907041550.n64Fo4NR062410@freefall.freebsd.org>

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

>Number:         136325
>Category:       misc
>Synopsis:       "portsnap fetch" not useable by other programss
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 04 15:50:04 UTC 2009
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907041541.n64Fflm6069975>