Stephen Montgomery-Smith wrote:
Here is my next attempt to make a faster pkg_version. This script is not going to be 100% reliable, but it should work most of the time. It works by first checking the time difference between /var/db/pkg/*/+CONTENTS and /usr/ports/*/*/Makefile, and only invokes pkg_version if the former is older.

Someone emailed me that it didn't work on their system. Try this one instead. I also corrected a few other potential issues (like if you run my script as root and then press control C, you might mess up your database).




#!/usr/bin/make -f

PKG_DBDIR?=/var/db/pkg
PORTSDIR?=/usr/ports

PKG_LIST!= \
        for p in ${PKG_DBDIR}/*/+CONTENTS; do \
                sed -n "s|@comment ORIGIN|$$p|p" $$p; \
        done

all:    ${PKG_LIST:C/:.*//}

.for target in ${PKG_LIST}
${target:C/:.*//}::     ${PORTSDIR}/${target:C/.*://}/Makefile
        @pkg_version -L'=' -v -s ${target:C|${PKG_DBDIR}/(.*)/\+CONTENTS:.*|\1|}
.endfor
_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"
  • Faster pkg_version Stephen Montgomery-Smith
    • Re: Faster pkg_version Stephen Montgomery-Smith

Reply via email to