port cddir

Emmanuel Hainry ehainry at free.fr
Wed Jun 20 05:53:05 PDT 2007


For things like that, I have told my shell (zsh) to create pseudo paths:

hash -d dp=/opt/local/var/db/dports
hash -d ports=/opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports/

Then "ls ~dp/distfiles" shows me if I have already fetched what I intend
to build during the week end, and cd ~ports/*/rubber takes me where
rubber's portfile lies -- and far faster than cd $(port dir rubber).
For personal ports that are not in the common repository, the path don't
give me headaches...

Emmanuel

Citando Ryan Schmidt :
>  I find myself wanting to cd into a port's directory quite often. I used to 
>  do:
> 
>  $ cd `port dir foo`
> 
>  but got tired of typing the backticks, and also I was used to typing "port 
>  <action> foo", as in "port edit foo" which to me is a shortcut for "edit 
>  `port file foo`". Now I've added a script to my ~/.bash_profile so that I 
>  can now do:
> 
>  $ port cddir foo
> 
>  which is more intuitive to me. I can also do:
> 
>  $ port cddir
> 
>  to go to the root of the dports tree. This is the script:
> 
> 
>  port() {
>  	case "$1" in
>  		cddir)
>  			if [ -z "$2" ]; then
>  				cd `port echo all | head -n 1 | xargs port dir`/../..
>  			else
>  				cd `port dir $2`
>  			fi
>  			;;
>  		*)
>  			/opt/local/bin/port "$@"
>  			;;
>  	esac
>  }
> 
> 
>  Do others find this useful? I think it might be worthwhile to build "port 
>  cddir" into the port command properly.
> 
>  _______________________________________________
>  macports-users mailing list
>  macports-users at lists.macosforge.org
>  http://lists.macosforge.org/mailman/listinfo/macports-users



More information about the macports-users mailing list