misc/136325: "portsnap fetch" not useable by other programss

Hannes freebsd at soulrebel.in-berlin.de
Sat Jul 4 15:50:05 UTC 2009


>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 at 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:


More information about the freebsd-bugs mailing list