Re: Automatically generate symlinks for virtual categories.
Newest version's Makefile is attached. -- Eitan Adler Security is increased by designing for the way humans actually behave. -Jakob Nielsen # New ports collection makefile for: symlink # Date created:Fri Jun 05 2009 # Whom:Eitan Adler eitanadlerl...@gmail.com # # $FreeBSD$ # PORTNAME= symlink PORTVERSION=4 CATEGORIES= ports-mgmt MASTER_SITES= http://isis.poly.edu/~eitan/files/ DISTNAME= auto-symlink-virtual-${PORTVERSION}.sh EXTRACT_SUFX= MAINTAINER= eitanadlerl...@gmail.com COMMENT=Automatically generate symlinks for virtual categories NO_BUILD= yes EXTRACT_ONLY= # nada PLIST_FILES=bin/${PORTNAME} do-install: ${INSTALL_SCRIPT} ${DISTDIR}/${DISTNAME} ${PREFIX}/bin/${PORTNAME} .include bsd.port.mk ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Automatically generate symlinks for virtual categories.
If anyone could improve the script please let me know. How about adding options? This patch [1] adds an option to specify alternative port root, an option to perform a dry run, and some usage printing. [1] http://tx97.net/pub/patches/auto-symlink-virtual.sh-r0-r1.diff ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Automatically generate symlinks for virtual categories.
And here [1] is a new version that does the same thing, but uses INDEX file instead of traversing the ports tree. It's quite faster this way (assuming your INDEX is up to date, maybe it's better to allow both algorithms?). Disclaimer: I did not test it properly. The thing that looks strange to me is that the original script appends main category to the name of port when symlinking. I copied that behavior for safety, but are there really naming conflicts in the ports tree? [1] http://tx97.net/pub/files/auto-symlink-virtual.sh ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Automatically generate symlinks for virtual categories.
On Fri, 5 Jun 2009 15:56:01 +0300 Vitaly Magerya vmage...@gmail.com wrote: And here [1] is a new version that does the same thing, but uses INDEX file instead of traversing the ports tree. It's quite faster this way (assuming your INDEX is up to date, maybe it's better to allow both algorithms?). Disclaimer: I did not test it properly. The thing that looks strange to me is that the original script appends main category to the name of port when symlinking. I copied that behavior for safety, but are there really naming conflicts in the ports tree? Would this patches work with various base or pors pkg* tools? -- IOnut - Un^d^dregistered ;) FreeBSD user Intellectual Property is nowhere near as valuable as Intellect FreeBSD committer - ite...@freebsd.org, PGP Key ID 057E9F8B493A297B signature.asc Description: PGP signature
Re: Automatically generate symlinks for virtual categories.
Vitaly Magerya wrote: And here [1] is a new version that does the same thing, but uses INDEX file instead of traversing the ports tree. It's quite faster this way (assuming your INDEX is up to date, maybe it's better to allow both algorithms?). I'll added your script to mine as a option. Disclaimer: I did not test it properly. The thing that looks strange to me is that the original script appends main category to the name of port when symlinking. I copied that behavior for safety, but are there really naming conflicts in the ports tree? Yes. A lot of programs have category/name and language/name for localized versions. [1] http://tx97.net/pub/files/auto-symlink-virtual.sh Current version: http://isis.poly.edu/~eitan/files/auto-symlink-virtual-2.sh I'll be making a port of this soon ;) -- Eitan Adler Security is increased by designing for the way humans actually behave. -Jakob Nielsen ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Automatically generate symlinks for virtual categories.
I'll added your script to mine as a option. Yeah, I've done that too in the mean time, take a look: [1]. In that version both traverse algorithms share common linking code, it seems more maintainable this way. (I've added -w and -i to catch up with you, but the code overall is quite different, sorry about that). There's a question about the test for main category dir: if you use -w to specify a directory different than that of -p, a simlink $whereto/category/portname-category will be created. Maybe $whereto/category/portname would be the right thing in this case? [1] http://tx97.net/pub/files/auto-symlink-virtual.sh ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Automatically generate symlinks for virtual categories.
Attached is the Makefile from the port. In order to save space I'm not attaching pkg-descr, or distinfo. -- Eitan Adler Security is increased by designing for the way humans actually behave. -Jakob Nielsen # New ports collection makefile for: symlink # Date created:Fri Jun 05 2009 # Whom:Eitan Adler eitanadlerl...@gmail.com # # $FreeBSD$ # PORTNAME= symlink PORTVERSION=3 CATEGORIES= ports-mgmt MASTER_SITES= http://isis.poly.edu/~eitan/files/ DISTNAME= auto-symlink-virtual-${PORTVERSION}.sh EXTRACT_SUFX= MAINTAINER= eitanadlerl...@gmail.com COMMENT=Automatically generate symlinks for virtual categories NO_BUILD= yes NO_EXTRACT= yes EXTRACT_CMD=true PLIST_FILES=bin/${PORTNAME} do-install: ${INSTALL_SCRIPT} ${DISTDIR}/${DISTNAME} ${PREFIX}/bin/${PORTNAME} .include bsd.port.mk ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Automatically generate symlinks for virtual categories.
On Fri, 05 Jun 2009 18:12:19 -0400 Eitan Adler eitanadlerl...@gmail.com wrote: # New ports collection makefile for: symlink # Date created:Fri Jun 05 2009 # Whom:Eitan Adler eitanadlerl...@gmail.com # # $FreeBSD$ # PORTNAME= symlink PORTVERSION= 3 CATEGORIES= ports-mgmt MASTER_SITES= http://isis.poly.edu/~eitan/files/ DISTNAME= auto-symlink-virtual-${PORTVERSION}.sh EXTRACT_SUFX= MAINTAINER= eitanadlerl...@gmail.com COMMENT= Automatically generate symlinks for virtual categories NO_BUILD= yes - NO_EXTRACT= yes # NO_EXTRACT is not allowed anymore # since we need to at least create ${WRKDIR}. + EXTRACT_ONLY= # nada But either you have the script in ${FILESDIR} or you have to crate WRKDIR. EXTRACT_CMD= true PLIST_FILES= bin/${PORTNAME} do-install: ${INSTALL_SCRIPT} ${DISTDIR}/${DISTNAME} ${PREFIX}/bin/${PORTNAME} .include bsd.port.mk Did you test what happens with all this idea when a port has a .include ${CURDIR}.. ? -- IOnut - Un^d^dregistered ;) FreeBSD user Intellectual Property is nowhere near as valuable as Intellect FreeBSD committer - ite...@freebsd.org, PGP Key ID 057E9F8B493A297B signature.asc Description: PGP signature
Re: Automatically generate symlinks for virtual categories.
Some random comments: - you really want to add usage [1] (-d is intentionally not documented) - when destdir does not exist the script should make one [2] - you really want to handle whitespace in paths [3] - there's no easy way to use an INDEX that is not under portsdir; I think that in -i you should specify a path, not a filename [4] (The patches should be applied in the listed order). [1] http://tx97.net/pub/patches/auto-symlink-virtual-usage.diff [2] http://tx97.net/pub/patches/auto-symlink-virtual-destdir.diff [3] http://tx97.net/pub/patches/auto-symlink-virtual-whitespace.diff [4] http://tx97.net/pub/patches/auto-symlink-virtual-index.diff ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org