Questions on portmaster

Manish Jain invalid.pointer at gmail.com
Thu Jul 2 05:06:46 UTC 2009


b. f. wrote:
> Manish Jain wrote:
>> ...Does each child start 'make fetch' in the background ?
> 
> make checksum, yes.
> 
>> Further, how can portmaster be tuned to automatically ignore ports which
>> are actually marked as IGNORE in the port directory ? This is not
>> covered in the manpage.
> 
> It respects IGNORE (it checks for it in the port Makefile, and also
> hands off to bsd.port.mk, which respects it).   If you mean +IGNOREME,
> the others have answered your question.
> 
>> While doing portmaster -a, I have only managed to stop portmaster from
>> building exactly one port specified with the -x option. Can I get to
>> stop multiple ports from being built ? Is there regular expression
>> support for the -x option ?
> 
> Not in the sense that you mean, at least that I'm aware of.  This one
> of the things that needs improvement.  It is a bit awkward, because it
> uses the shell's built-in POSIX getopts to parse options, and then
> calls itself recursively.  One way you could fix it would be to apply
> a patch like:
> 
> --- portmaster.orig     2009-07-01 12:36:14.000000000 -0400
> +++ portmaster  2009-07-01 18:55:59.000000000 -0400
> @@ -9,7 +9,7 @@
>  if [ -z "$PARENT_PID" ]; then
>         PARENT_PID=$$
>         : ${TMPDIR:=/tmp}
> -       UPGRADE_TOOL=portmaster
> +       UPGRADE_TOOL=$0
> 
>         # /usr/local is needed in the path for make
>         PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
> @@ -788,7 +788,11 @@
>         u)      UNATTENDED=uopt; ARGS="-u $ARGS" ;;
>         v)      PM_VERBOSE=vopt; ARGS="-v $ARGS" ;;
>         w)      SAVE_SHARED=wopt; ARGS="-w $ARGS" ;;
> -       x)      EXCL=$OPTARG ;;
> +       x)      if [ -z "${OPTARG%%-*}" ]; then
> +                       fail 'The -x option requires an argument'
> +               else
> +                       EXCL="-x $OPTARG $EXCL"
> +               fi ;;
>         *)      echo '' ; echo "===>>> Try ${0##*/} --help"; exit 1 ;;
>         esac
>  done
> @@ -810,10 +814,7 @@
>  [ -n "$FETCH_ONLY" -a -n "$NO_RECURSIVE_CONFIG" ] &&
>         fail "The -F and -G options are mutually exclusive"
>  if [ -n "$EXCL" ]; then
> -       case "$EXCL" in
> -       -*)     fail 'The -x option requires an argument' ;;
> -       *)      ARGS="-x $EXCL $ARGS" ;;
> -       esac
> +       ARGS="$EXCL $ARGS"
>  fi
> 
>  #=============== Begin functions for getopts features and main ===============
> @@ -1461,14 +1462,17 @@
>  check_exclude () {
>         [ -n "$EXCL" ] || return 0
> 
> -       case "$1" in
> -       *${EXCL}*)
> -       if [ -n "$PM_VERBOSE" ]; then
> -               echo "===>>> Skipping $1"
> -               echo "       because it matches the pattern: *${EXCL}*"
> -       fi
> -       return 1 ;;
> -       esac
> +       for pkgglob in `echo "$EXCL" | sed -e 's#-x##g'`
> +       do
> +               case "$1" in
> +               *${pkgglob}*)
> +               if [ -n "$PM_VERBOSE" ]; then
> +                       echo "===>>> Skipping $1"
> +                       echo "       because it matches the pattern:
> *${pkgglob}*"
> +               fi
> +               return 1 ;;
> +               esac ;
> +       done
>         return 0
>  }
> 
> 
> (Mind the whitespace because of my MUA.)  Then you could just use
> repeated -x flags, each with one and only one package glob that you
> wanted to exclude.  I changed the definition of UPGRADE_TOOL so that
> you could put this script in your path under another name, say
> "jainpmaster", and then call it independently of the original
> portmaster.  As usual, I make no claim that this is the best, only, or
> most elegant way to do this.
> 
> Regards,
>                 b.
> 

Hello BF/Roland,

Thanks for the clarifications.

Regarding the download speeds I was getting with portmaster fetches (0.7 
kBps to 4.0 kBps), I immediately booted into Windows/Cygwin and did a 
wget from the same site portmaster was using. The speed I got from wget 
was ~ 35 kBps. This happened not just once but multiple times. Each time 
I did this, I had to interrupt portmaster. Finally I managed to get to 
install the wget port on FreeBSD itself. When I ran wget from FreeBSD, 
it reported comparable transfer rates (~ 35 kBps) from the same sites as 
portmaster was using.

>> It respects IGNORE (it checks for it in the port Makefile, and also
>> hands off to bsd.port.mk, which respects it).  

I got a curl port from portsnap marked IGNORE. portmaster did not ignore 
it anywhere near gracefully enough and finally killed off all child 
processes and itself.

The IGNOREME way is fine for me for avoiding multiple ports I know 
beforehand I do not want to build. But if a portsnap update creates an 
IGNORE port, portmaster should be skipping it entirely rather than 
having to kill all child processes and itself. In my experience, this 
did not happen. Or maybe my system was badly broken already by that time.

Anyway, my system became so unpredictable that I had to reinstall 
FreeBSD. For the moment, I am avoiding portmaster till I can try it out 
on a dummy PC first.

BTW, I also tried portmanager and it segfaulted at the stage of 
generating a report.


Thanks for all the help.

Manish Jain
invalid.pointer at gmail.com


More information about the freebsd-questions mailing list