Changeset 52218


Ignore:
Timestamp:
Jun 12, 2009, 8:57:53 AM (11 years ago)
Author:
enl@…
Message:

Merge from trunk

Location:
branches/gsoc09-logging/base
Files:
65 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc09-logging/base

  • branches/gsoc09-logging/base/aclocal.m4

    r50746 r52218  
    503503        if test "x$UNIVERSAL_SYSROOT" = "x"; then
    504504            if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
    505                 UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
     505                UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
    506506            else
    507                 UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
     507                UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
    508508            fi
    509509        fi
  • branches/gsoc09-logging/base/configure

    r51384 r52218  
    715715XAR
    716716PAX
     717MKBOM
     718LSBOM
    717719BZIP2
    718720GNUMAKE
     
    723725HDIUTIL
    724726MAKE
     727BSDMAKE
    725728ZIP
    726729UNZIP
     
    729732RSYNC
    730733RMDIR
     734PATCH
     735NICE
     736LIPO
    731737GZIP
     738HG
    732739GIT
    733740SVN
    734741CVS
     742FILE
     743DSCL
     744DITTO
     745DIFF
     746CPIO
    735747CP
     748CHOWN
    736749MTREE
    737750LN_S
     
    750763CFLAGS
    751764CC
     765DEVELOPER_DIR
    752766XCODE_SELECT
    753767DEFAULTS
     
    23492363  { $as_echo "$as_me:$LINENO: result: $DEVELOPER_DIR" >&5
    23502364$as_echo "$DEVELOPER_DIR" >&6; }
    2351 fi
     2365else
     2366  DEVELOPER_DIR=/Developer
     2367fi
     2368
    23522369
    23532370XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
     
    37493766
    37503767
     3768# Extract the first word of "chown", so it can be a program name with args.
     3769set dummy chown; ac_word=$2
     3770{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     3771$as_echo_n "checking for $ac_word... " >&6; }
     3772if test "${ac_cv_path_CHOWN+set}" = set; then
     3773  $as_echo_n "(cached) " >&6
     3774else
     3775  case $CHOWN in
     3776  [\\/]* | ?:[\\/]*)
     3777  ac_cv_path_CHOWN="$CHOWN" # Let the user override the test with a path.
     3778  ;;
     3779  *)
     3780  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     3781as_dummy="$PATH:/usr/sbin"
     3782for as_dir in $as_dummy
     3783do
     3784  IFS=$as_save_IFS
     3785  test -z "$as_dir" && as_dir=.
     3786  for ac_exec_ext in '' $ac_executable_extensions; do
     3787  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3788    ac_cv_path_CHOWN="$as_dir/$ac_word$ac_exec_ext"
     3789    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     3790    break 2
     3791  fi
     3792done
     3793done
     3794IFS=$as_save_IFS
     3795
     3796  ;;
     3797esac
     3798fi
     3799CHOWN=$ac_cv_path_CHOWN
     3800if test -n "$CHOWN"; then
     3801  { $as_echo "$as_me:$LINENO: result: $CHOWN" >&5
     3802$as_echo "$CHOWN" >&6; }
     3803else
     3804  { $as_echo "$as_me:$LINENO: result: no" >&5
     3805$as_echo "no" >&6; }
     3806fi
     3807
     3808
    37513809# Extract the first word of "cp", so it can be a program name with args.
    37523810set dummy cp; ac_word=$2
     
    37893847
    37903848
     3849# Extract the first word of "cpio", so it can be a program name with args.
     3850set dummy cpio; ac_word=$2
     3851{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     3852$as_echo_n "checking for $ac_word... " >&6; }
     3853if test "${ac_cv_path_CPIO+set}" = set; then
     3854  $as_echo_n "(cached) " >&6
     3855else
     3856  case $CPIO in
     3857  [\\/]* | ?:[\\/]*)
     3858  ac_cv_path_CPIO="$CPIO" # Let the user override the test with a path.
     3859  ;;
     3860  *)
     3861  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     3862for as_dir in $PATH
     3863do
     3864  IFS=$as_save_IFS
     3865  test -z "$as_dir" && as_dir=.
     3866  for ac_exec_ext in '' $ac_executable_extensions; do
     3867  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3868    ac_cv_path_CPIO="$as_dir/$ac_word$ac_exec_ext"
     3869    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     3870    break 2
     3871  fi
     3872done
     3873done
     3874IFS=$as_save_IFS
     3875
     3876  ;;
     3877esac
     3878fi
     3879CPIO=$ac_cv_path_CPIO
     3880if test -n "$CPIO"; then
     3881  { $as_echo "$as_me:$LINENO: result: $CPIO" >&5
     3882$as_echo "$CPIO" >&6; }
     3883else
     3884  { $as_echo "$as_me:$LINENO: result: no" >&5
     3885$as_echo "no" >&6; }
     3886fi
     3887
     3888
     3889# Extract the first word of "diff", so it can be a program name with args.
     3890set dummy diff; ac_word=$2
     3891{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     3892$as_echo_n "checking for $ac_word... " >&6; }
     3893if test "${ac_cv_path_DIFF+set}" = set; then
     3894  $as_echo_n "(cached) " >&6
     3895else
     3896  case $DIFF in
     3897  [\\/]* | ?:[\\/]*)
     3898  ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path.
     3899  ;;
     3900  *)
     3901  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     3902for as_dir in $PATH
     3903do
     3904  IFS=$as_save_IFS
     3905  test -z "$as_dir" && as_dir=.
     3906  for ac_exec_ext in '' $ac_executable_extensions; do
     3907  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3908    ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext"
     3909    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     3910    break 2
     3911  fi
     3912done
     3913done
     3914IFS=$as_save_IFS
     3915
     3916  ;;
     3917esac
     3918fi
     3919DIFF=$ac_cv_path_DIFF
     3920if test -n "$DIFF"; then
     3921  { $as_echo "$as_me:$LINENO: result: $DIFF" >&5
     3922$as_echo "$DIFF" >&6; }
     3923else
     3924  { $as_echo "$as_me:$LINENO: result: no" >&5
     3925$as_echo "no" >&6; }
     3926fi
     3927
     3928
     3929# Extract the first word of "ditto", so it can be a program name with args.
     3930set dummy ditto; ac_word=$2
     3931{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     3932$as_echo_n "checking for $ac_word... " >&6; }
     3933if test "${ac_cv_path_DITTO+set}" = set; then
     3934  $as_echo_n "(cached) " >&6
     3935else
     3936  case $DITTO in
     3937  [\\/]* | ?:[\\/]*)
     3938  ac_cv_path_DITTO="$DITTO" # Let the user override the test with a path.
     3939  ;;
     3940  *)
     3941  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     3942for as_dir in $PATH
     3943do
     3944  IFS=$as_save_IFS
     3945  test -z "$as_dir" && as_dir=.
     3946  for ac_exec_ext in '' $ac_executable_extensions; do
     3947  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3948    ac_cv_path_DITTO="$as_dir/$ac_word$ac_exec_ext"
     3949    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     3950    break 2
     3951  fi
     3952done
     3953done
     3954IFS=$as_save_IFS
     3955
     3956  ;;
     3957esac
     3958fi
     3959DITTO=$ac_cv_path_DITTO
     3960if test -n "$DITTO"; then
     3961  { $as_echo "$as_me:$LINENO: result: $DITTO" >&5
     3962$as_echo "$DITTO" >&6; }
     3963else
     3964  { $as_echo "$as_me:$LINENO: result: no" >&5
     3965$as_echo "no" >&6; }
     3966fi
     3967
     3968
     3969# Extract the first word of "dscl", so it can be a program name with args.
     3970set dummy dscl; ac_word=$2
     3971{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     3972$as_echo_n "checking for $ac_word... " >&6; }
     3973if test "${ac_cv_path_DSCL+set}" = set; then
     3974  $as_echo_n "(cached) " >&6
     3975else
     3976  case $DSCL in
     3977  [\\/]* | ?:[\\/]*)
     3978  ac_cv_path_DSCL="$DSCL" # Let the user override the test with a path.
     3979  ;;
     3980  *)
     3981  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     3982for as_dir in $PATH
     3983do
     3984  IFS=$as_save_IFS
     3985  test -z "$as_dir" && as_dir=.
     3986  for ac_exec_ext in '' $ac_executable_extensions; do
     3987  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3988    ac_cv_path_DSCL="$as_dir/$ac_word$ac_exec_ext"
     3989    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     3990    break 2
     3991  fi
     3992done
     3993done
     3994IFS=$as_save_IFS
     3995
     3996  ;;
     3997esac
     3998fi
     3999DSCL=$ac_cv_path_DSCL
     4000if test -n "$DSCL"; then
     4001  { $as_echo "$as_me:$LINENO: result: $DSCL" >&5
     4002$as_echo "$DSCL" >&6; }
     4003else
     4004  { $as_echo "$as_me:$LINENO: result: no" >&5
     4005$as_echo "no" >&6; }
     4006fi
     4007
     4008
     4009# Extract the first word of "file", so it can be a program name with args.
     4010set dummy file; ac_word=$2
     4011{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     4012$as_echo_n "checking for $ac_word... " >&6; }
     4013if test "${ac_cv_path_FILE+set}" = set; then
     4014  $as_echo_n "(cached) " >&6
     4015else
     4016  case $FILE in
     4017  [\\/]* | ?:[\\/]*)
     4018  ac_cv_path_FILE="$FILE" # Let the user override the test with a path.
     4019  ;;
     4020  *)
     4021  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4022for as_dir in $PATH
     4023do
     4024  IFS=$as_save_IFS
     4025  test -z "$as_dir" && as_dir=.
     4026  for ac_exec_ext in '' $ac_executable_extensions; do
     4027  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4028    ac_cv_path_FILE="$as_dir/$ac_word$ac_exec_ext"
     4029    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4030    break 2
     4031  fi
     4032done
     4033done
     4034IFS=$as_save_IFS
     4035
     4036  ;;
     4037esac
     4038fi
     4039FILE=$ac_cv_path_FILE
     4040if test -n "$FILE"; then
     4041  { $as_echo "$as_me:$LINENO: result: $FILE" >&5
     4042$as_echo "$FILE" >&6; }
     4043else
     4044  { $as_echo "$as_me:$LINENO: result: no" >&5
     4045$as_echo "no" >&6; }
     4046fi
     4047
     4048
    37914049# Extract the first word of "cvs", so it can be a program name with args.
    37924050set dummy cvs; ac_word=$2
     
    39094167
    39104168
     4169# Extract the first word of "hg", so it can be a program name with args.
     4170set dummy hg; ac_word=$2
     4171{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     4172$as_echo_n "checking for $ac_word... " >&6; }
     4173if test "${ac_cv_path_HG+set}" = set; then
     4174  $as_echo_n "(cached) " >&6
     4175else
     4176  case $HG in
     4177  [\\/]* | ?:[\\/]*)
     4178  ac_cv_path_HG="$HG" # Let the user override the test with a path.
     4179  ;;
     4180  *)
     4181  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4182for as_dir in $PATH
     4183do
     4184  IFS=$as_save_IFS
     4185  test -z "$as_dir" && as_dir=.
     4186  for ac_exec_ext in '' $ac_executable_extensions; do
     4187  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4188    ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext"
     4189    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4190    break 2
     4191  fi
     4192done
     4193done
     4194IFS=$as_save_IFS
     4195
     4196  ;;
     4197esac
     4198fi
     4199HG=$ac_cv_path_HG
     4200if test -n "$HG"; then
     4201  { $as_echo "$as_me:$LINENO: result: $HG" >&5
     4202$as_echo "$HG" >&6; }
     4203else
     4204  { $as_echo "$as_me:$LINENO: result: no" >&5
     4205$as_echo "no" >&6; }
     4206fi
     4207
     4208
    39114209# Extract the first word of "gzip", so it can be a program name with args.
    39124210set dummy gzip; ac_word=$2
     
    39494247
    39504248
     4249# Extract the first word of "lipo", so it can be a program name with args.
     4250set dummy lipo; ac_word=$2
     4251{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     4252$as_echo_n "checking for $ac_word... " >&6; }
     4253if test "${ac_cv_path_LIPO+set}" = set; then
     4254  $as_echo_n "(cached) " >&6
     4255else
     4256  case $LIPO in
     4257  [\\/]* | ?:[\\/]*)
     4258  ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path.
     4259  ;;
     4260  *)
     4261  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4262for as_dir in $PATH
     4263do
     4264  IFS=$as_save_IFS
     4265  test -z "$as_dir" && as_dir=.
     4266  for ac_exec_ext in '' $ac_executable_extensions; do
     4267  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4268    ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext"
     4269    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4270    break 2
     4271  fi
     4272done
     4273done
     4274IFS=$as_save_IFS
     4275
     4276  ;;
     4277esac
     4278fi
     4279LIPO=$ac_cv_path_LIPO
     4280if test -n "$LIPO"; then
     4281  { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
     4282$as_echo "$LIPO" >&6; }
     4283else
     4284  { $as_echo "$as_me:$LINENO: result: no" >&5
     4285$as_echo "no" >&6; }
     4286fi
     4287
     4288
     4289# Extract the first word of "nice", so it can be a program name with args.
     4290set dummy nice; ac_word=$2
     4291{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     4292$as_echo_n "checking for $ac_word... " >&6; }
     4293if test "${ac_cv_path_NICE+set}" = set; then
     4294  $as_echo_n "(cached) " >&6
     4295else
     4296  case $NICE in
     4297  [\\/]* | ?:[\\/]*)
     4298  ac_cv_path_NICE="$NICE" # Let the user override the test with a path.
     4299  ;;
     4300  *)
     4301  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4302for as_dir in $PATH
     4303do
     4304  IFS=$as_save_IFS
     4305  test -z "$as_dir" && as_dir=.
     4306  for ac_exec_ext in '' $ac_executable_extensions; do
     4307  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4308    ac_cv_path_NICE="$as_dir/$ac_word$ac_exec_ext"
     4309    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4310    break 2
     4311  fi
     4312done
     4313done
     4314IFS=$as_save_IFS
     4315
     4316  ;;
     4317esac
     4318fi
     4319NICE=$ac_cv_path_NICE
     4320if test -n "$NICE"; then
     4321  { $as_echo "$as_me:$LINENO: result: $NICE" >&5
     4322$as_echo "$NICE" >&6; }
     4323else
     4324  { $as_echo "$as_me:$LINENO: result: no" >&5
     4325$as_echo "no" >&6; }
     4326fi
     4327
     4328
     4329# Extract the first word of "patch", so it can be a program name with args.
     4330set dummy patch; ac_word=$2
     4331{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     4332$as_echo_n "checking for $ac_word... " >&6; }
     4333if test "${ac_cv_path_PATCH+set}" = set; then
     4334  $as_echo_n "(cached) " >&6
     4335else
     4336  case $PATCH in
     4337  [\\/]* | ?:[\\/]*)
     4338  ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path.
     4339  ;;
     4340  *)
     4341  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4342for as_dir in $PATH
     4343do
     4344  IFS=$as_save_IFS
     4345  test -z "$as_dir" && as_dir=.
     4346  for ac_exec_ext in '' $ac_executable_extensions; do
     4347  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4348    ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext"
     4349    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4350    break 2
     4351  fi
     4352done
     4353done
     4354IFS=$as_save_IFS
     4355
     4356  ;;
     4357esac
     4358fi
     4359PATCH=$ac_cv_path_PATCH
     4360if test -n "$PATCH"; then
     4361  { $as_echo "$as_me:$LINENO: result: $PATCH" >&5
     4362$as_echo "$PATCH" >&6; }
     4363else
     4364  { $as_echo "$as_me:$LINENO: result: no" >&5
     4365$as_echo "no" >&6; }
     4366fi
     4367
     4368
    39514369# Extract the first word of "rmdir", so it can be a program name with args.
    39524370set dummy rmdir; ac_word=$2
     
    41834601  { $as_echo "$as_me:$LINENO: result: $ZIP" >&5
    41844602$as_echo "$ZIP" >&6; }
     4603else
     4604  { $as_echo "$as_me:$LINENO: result: no" >&5
     4605$as_echo "no" >&6; }
     4606fi
     4607
     4608
     4609# Extract the first word of "bsdmake", so it can be a program name with args.
     4610set dummy bsdmake; ac_word=$2
     4611{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     4612$as_echo_n "checking for $ac_word... " >&6; }
     4613if test "${ac_cv_path_BSDMAKE+set}" = set; then
     4614  $as_echo_n "(cached) " >&6
     4615else
     4616  case $BSDMAKE in
     4617  [\\/]* | ?:[\\/]*)
     4618  ac_cv_path_BSDMAKE="$BSDMAKE" # Let the user override the test with a path.
     4619  ;;
     4620  *)
     4621  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4622for as_dir in $PATH
     4623do
     4624  IFS=$as_save_IFS
     4625  test -z "$as_dir" && as_dir=.
     4626  for ac_exec_ext in '' $ac_executable_extensions; do
     4627  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4628    ac_cv_path_BSDMAKE="$as_dir/$ac_word$ac_exec_ext"
     4629    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4630    break 2
     4631  fi
     4632done
     4633done
     4634IFS=$as_save_IFS
     4635
     4636  ;;
     4637esac
     4638fi
     4639BSDMAKE=$ac_cv_path_BSDMAKE
     4640if test -n "$BSDMAKE"; then
     4641  { $as_echo "$as_me:$LINENO: result: $BSDMAKE" >&5
     4642$as_echo "$BSDMAKE" >&6; }
    41854643else
    41864644  { $as_echo "$as_me:$LINENO: result: no" >&5
     
    45124970  { $as_echo "$as_me:$LINENO: result: $BZIP2" >&5
    45134971$as_echo "$BZIP2" >&6; }
     4972else
     4973  { $as_echo "$as_me:$LINENO: result: no" >&5
     4974$as_echo "no" >&6; }
     4975fi
     4976
     4977
     4978# Extract the first word of "lsbom", so it can be a program name with args.
     4979set dummy lsbom; ac_word=$2
     4980{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     4981$as_echo_n "checking for $ac_word... " >&6; }
     4982if test "${ac_cv_path_LSBOM+set}" = set; then
     4983  $as_echo_n "(cached) " >&6
     4984else
     4985  case $LSBOM in
     4986  [\\/]* | ?:[\\/]*)
     4987  ac_cv_path_LSBOM="$LSBOM" # Let the user override the test with a path.
     4988  ;;
     4989  *)
     4990  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4991for as_dir in $PATH
     4992do
     4993  IFS=$as_save_IFS
     4994  test -z "$as_dir" && as_dir=.
     4995  for ac_exec_ext in '' $ac_executable_extensions; do
     4996  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4997    ac_cv_path_LSBOM="$as_dir/$ac_word$ac_exec_ext"
     4998    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4999    break 2
     5000  fi
     5001done
     5002done
     5003IFS=$as_save_IFS
     5004
     5005  ;;
     5006esac
     5007fi
     5008LSBOM=$ac_cv_path_LSBOM
     5009if test -n "$LSBOM"; then
     5010  { $as_echo "$as_me:$LINENO: result: $LSBOM" >&5
     5011$as_echo "$LSBOM" >&6; }
     5012else
     5013  { $as_echo "$as_me:$LINENO: result: no" >&5
     5014$as_echo "no" >&6; }
     5015fi
     5016
     5017
     5018# Extract the first word of "mkbom", so it can be a program name with args.
     5019set dummy mkbom; ac_word=$2
     5020{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
     5021$as_echo_n "checking for $ac_word... " >&6; }
     5022if test "${ac_cv_path_MKBOM+set}" = set; then
     5023  $as_echo_n "(cached) " >&6
     5024else
     5025  case $MKBOM in
     5026  [\\/]* | ?:[\\/]*)
     5027  ac_cv_path_MKBOM="$MKBOM" # Let the user override the test with a path.
     5028  ;;
     5029  *)
     5030  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     5031for as_dir in $PATH
     5032do
     5033  IFS=$as_save_IFS
     5034  test -z "$as_dir" && as_dir=.
     5035  for ac_exec_ext in '' $ac_executable_extensions; do
     5036  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     5037    ac_cv_path_MKBOM="$as_dir/$ac_word$ac_exec_ext"
     5038    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     5039    break 2
     5040  fi
     5041done
     5042done
     5043IFS=$as_save_IFS
     5044
     5045  ;;
     5046esac
     5047fi
     5048MKBOM=$ac_cv_path_MKBOM
     5049if test -n "$MKBOM"; then
     5050  { $as_echo "$as_me:$LINENO: result: $MKBOM" >&5
     5051$as_echo "$MKBOM" >&6; }
    45145052else
    45155053  { $as_echo "$as_me:$LINENO: result: no" >&5
     
    75668104        if test "x$UNIVERSAL_SYSROOT" = "x"; then
    75678105            if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
    7568                 UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
     8106                UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
    75698107            else
    7570                 UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
     8108                UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
    75718109            fi
    75728110        fi
     
    1044710985# Check whether --with-trace-sdk was given.
    1044810986if test "${with_trace_sdk+set}" = set; then
    10449   withval=$with_trace_sdk; test -d /Developer/SDKs/$withval && cat >>confdefs.h <<_ACEOF
     10987  withval=$with_trace_sdk; test -d ${DEVELOPER_DIR}/SDKs/$withval && cat >>confdefs.h <<_ACEOF
    1045010988#define TRACE_SDK "${withval}"
    1045110989_ACEOF
  • branches/gsoc09-logging/base/configure.ac

    r51384 r52218  
    4949  DEVELOPER_DIR=`$XCODE_SELECT -print-path`
    5050  AC_MSG_RESULT([$DEVELOPER_DIR])
    51 fi
     51else
     52  DEVELOPER_DIR=/Developer
     53fi
     54AC_SUBST(DEVELOPER_DIR)
    5255
    5356XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
     
    8588AC_PROG_LN_S
    8689AC_PATH_PROG(MTREE, [mtree], [], [$PATH:/usr/sbin])
     90AC_PATH_PROG(CHOWN, [chown], [], [$PATH:/usr/sbin])
    8791AC_PATH_PROG(CP, [cp], [])
     92AC_PATH_PROG(CPIO, [cpio], [])
     93AC_PATH_PROG(DIFF, [diff], [])
     94AC_PATH_PROG(DITTO, [ditto], [])
     95AC_PATH_PROG(DSCL, [dscl], [])
     96AC_PATH_PROG(FILE, [file], [])
    8897AC_PATH_PROG(CVS, [cvs], [])
    8998AC_PATH_PROG(SVN, [svn], [])
    9099AC_PATH_PROG(GIT, [git], [])
     100AC_PATH_PROG(HG, [hg], [])
    91101AC_PATH_PROG(GZIP, [gzip], [])
     102AC_PATH_PROG(LIPO, [lipo], [])
     103AC_PATH_PROG(NICE, [nice], [])
     104AC_PATH_PROG(PATCH, [patch], [])
    92105AC_PATH_PROG(RMDIR, [rmdir], [])
    93106AC_PATH_PROG(RSYNC, [rsync], [])
     
    96109AC_PATH_PROG(UNZIP, [unzip])
    97110AC_PATH_PROG(ZIP, [zip])
     111AC_PATH_PROG(BSDMAKE, [bsdmake])
    98112AC_PATH_PROG(MAKE, [make])
    99113AC_PATH_PROG(HDIUTIL, [hdiutil], [])
     
    104118AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [], [$PATH:/usr/local/bin])
    105119AC_PATH_PROG(BZIP2, [bzip2], [])
     120AC_PATH_PROG(LSBOM, [lsbom], [])
     121AC_PATH_PROG(MKBOM, [mkbom], [])
    106122AC_PATH_PROG(PAX, [pax], [])
    107123AC_PATH_PROG(XAR, [xar], [])
     
    314330        AS_HELP_STRING([--with-trace-sdk=SDK],
    315331                [SDK for redirection in trace lib (for example MacOSX10.4u.sdk)]),
    316         [test -d /Developer/SDKs/$withval && AC_DEFINE_UNQUOTED([TRACE_SDK], "${withval}")], [])
     332        [test -d ${DEVELOPER_DIR}/SDKs/$withval && AC_DEFINE_UNQUOTED([TRACE_SDK], "${withval}")], [])
    317333
    318334# Allows building of shared libraries
  • branches/gsoc09-logging/base/doc/macports.conf.in

    r51384 r52218  
    2121# paths are given in the example; it need not be uncommented.  Customizing binpath is intended for advanced users only.
    2222#binpath                @prefix_expanded@/bin:@prefix_expanded@/sbin:/bin:/sbin:/usr/bin:/usr/sbin
     23
     24# Directory containing Xcode Tools
     25developer_dir       @DEVELOPER_DIR@
    2326
    2427# Directory containing Applications from ports.
  • branches/gsoc09-logging/base/doc/portgroup.7

    r41249 r52218  
    159159xcode.destroot.settings SKIP_INSTALL=NO
    160160.Ed
    161 .It Ic xcode.universal.settings
    162 Settings passed to the xcode build tool when the +universal variant is selected. These settings should be in the X=Y form.
    163 .br
    164 .Sy Type:
    165 .Em optional
    166 .br
    167 .Sy Default:
    168 .Bd -literal -offset indent -compact
    169 ARCHS="${universal_archs}" MACOSX_DEPLOYMENT_TARGET=${universal_target}
    170 .Ed
    171 .It Ic xcode.universal.sdk
    172 SDK to use when the +universal variant is selected. The argument may be an absolute path to an SDK, or the canonical name of an SDK.
    173 .br
    174 .Sy Type:
    175 .Em optional
    176 .br
    177 .Sy Default:
    178 .Bd -literal -offset indent -compact
    179 ${universal_sysroot}
    180 .Ed
    181161.El
    182162.Sh STANDARD PORTFILE VARIABLES AFFECTING XCODE PORTGROUP
     
    286266Sets GNUSTEP_LOCAL_LIBRARY according to the FilesystemLayout
    287267.br
     268.El
    288269.Pp
    289270.Sh GNUSTEP PORTGROUP SUGAR
  • branches/gsoc09-logging/base/portmgr/bots/port.rb

    r49066 r52218  
    147147        def portversion(m, params)
    148148                if !isPseudo(m, params[:portname])
    149                         doPort(m, "info", "--version", params[:portname])
     149                        doPort(m, "info", "--version --revision --line --pretty", params[:portname])
    150150                end
    151151        end
  • branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl

    r44181 r52218  
    290290        set variants ""
    291291    }
     292    if {[info exists portinfo(depends_fetch)]} {
     293        set depends_fetch $portinfo(depends_fetch)
     294    } else {
     295        set depends_fetch ""
     296    }
     297    if {[info exists portinfo(depends_extract)]} {
     298        set depends_extract $portinfo(depends_extract)
     299    } else {
     300        set depends_extract ""
     301    }
    292302    if {[info exists portinfo(depends_build)]} {
    293303        set depends_build $portinfo(depends_build)
     
    327337    }
    328338
     339    foreach fetch_dep $depends_fetch {
     340        set fetch_dep [sql_escape $fetch_dep]
     341        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$fetch_dep');"
     342    }
     343   
     344    foreach extract_dep $depends_extract {
     345        set extract_dep [sql_escape $extract_dep]
     346        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$extract_dep');"
     347    }
     348
    329349    foreach build_dep $depends_build {
    330350        set build_dep [sql_escape $build_dep]
  • branches/gsoc09-logging/base/portmgr/packaging/dpkgall.tcl

    r49059 r52218  
    876876                        eval "lappend depends $portinfo(depends_build)"
    877877                }
     878                if {$includeBuildDeps == "true" && [info exists portinfo(depends_fetch)]} {
     879                        eval "lappend depends $portinfo(depends_fetch)"
     880                }
     881                if {$includeBuildDeps == "true" && [info exists portinfo(depends_extract)]} {
     882                        eval "lappend depends $portinfo(depends_extract)"
     883                }
    878884                foreach depspec $depends {
    879885                        set dep [lindex [split $depspec :] end]
  • branches/gsoc09-logging/base/portmgr/packaging/packageall.tcl

    r49059 r52218  
    150150                        eval "lappend depends $portinfo(depends_build)"
    151151                }
     152                if {$includeBuildDeps != "" && [info exists portinfo(depends_fetch)]} {
     153                        eval "lappend depends $portinfo(depends_fetch)"
     154                }
     155                if {$includeBuildDeps != "" && [info exists portinfo(depends_extract)]} {
     156                        eval "lappend depends $portinfo(depends_extract)"
     157                }
     158               
    152159                foreach depspec $depends {
    153160                        set dep [lindex [split $depspec :] end]
  • branches/gsoc09-logging/base/portmgr/packaging/rpmall.tcl

    r49059 r52218  
    155155                        eval "lappend depends $portinfo(depends_build)"
    156156                }
     157                if {$includeBuildDeps != "" && [info exists portinfo(depends_fetch)]} {
     158                        eval "lappend depends $portinfo(depends_fetch)"
     159                }
     160                if {$includeBuildDeps != "" && [info exists portinfo(depends_extract)]} {
     161                        eval "lappend depends $portinfo(depends_extract)"
     162                }
    157163                foreach depspec $depends {
    158164                        set dep [lindex [split $depspec :] end]
  • branches/gsoc09-logging/base/src/Makefile.in

    r51384 r52218  
    1515        rm -f config.h
    1616        rm -f Makefile
     17        rm -f pkg_mkindex.sh
    1718
    1819test::
  • branches/gsoc09-logging/base/src/cregistry/Makefile

    r43366 r52218  
    2525test:
    2626
    27 install:: ${STLIB_NAME}
     27install:: all
  • branches/gsoc09-logging/base/src/macports1.0/Makefile

    r51384 r52218  
    1616        rm -f macports_autoconf.tcl macports_fastload.tcl ${SHLIB_NAME}
    1717
    18 install::
     18install:: all
    1919        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    2020
  • branches/gsoc09-logging/base/src/macports1.0/macports.tcl

    r51440 r52218  
    4646        rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
    4747        mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
    48         applications_dir frameworks_dir universal_target universal_sysroot universal_archs \
     48        applications_dir frameworks_dir developer_dir universal_target universal_sysroot universal_archs \
    4949        macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip"
    5050    variable user_options "submitter_name submitter_email submitter_key"
     
    5555        rsync_options rsync_dir startupitem_type place_worksymlink \
    5656        mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
    57         applications_dir frameworks_dir universal_target universal_sysroot universal_archs $user_options"
     57        applications_dir frameworks_dir developer_dir universal_target universal_sysroot universal_archs $user_options"
    5858
    5959    # deferred options are only computed when needed.
     
    251251
    252252# check for a binary in the path
    253 # returns an error code if it can not be found
     253# returns an error code if it cannot be found
    254254proc macports::binaryInPath {prog} {
    255255    global env
     
    659659        set macports::buildmakejobs 0
    660660    }
     661   
     662    # Default Xcode Tools path
     663    if {![info exists macports::developer_dir]} {
     664        set macports::developer_dir "/Developer"
     665    }
    661666
    662667    # Default mp universal options
    663668    if {![info exists macports::universal_target]} {
    664         if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
     669        if {[file exists ${macports::developer_dir}/SDKs/MacOSX10.5.sdk]} {
    665670            set macports::universal_target "10.5"
    666671        } else {
     
    669674    }
    670675    if {![info exists macports::universal_sysroot]} {
    671         if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
    672             set macports::universal_sysroot "/Developer/SDKs/MacOSX10.5.sdk"
     676        if {[file exists ${macports::developer_dir}/SDKs/MacOSX10.5.sdk]} {
     677            set macports::universal_sysroot "${macports::developer_dir}/SDKs/MacOSX10.5.sdk"
    673678        } else {
    674             set macports::universal_sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
     679            set macports::universal_sysroot "${macports::developer_dir}/SDKs/MacOSX10.4u.sdk"
    675680        }
    676681    }
     
    925930        return -code error "Port remote fetch failed: You do not have permission to write to $fetchdir"
    926931    }
    927     if {[catch {exec curl -L -s -S -o [file join $fetchdir $fetchfile] $url} result]} {
     932    if {[catch {curl fetch $url [file join $fetchdir $fetchfile]} result]} {
    928933        return -code error "Port remote fetch failed: $result"
    929934    }
    930935    cd $fetchdir
    931     if {[catch {exec tar -zxf $fetchfile} result]} {
     936    if {[catch {exec [findBinary tar $macports::autoconf::tar_path] -zxf $fetchfile} result]} {
    932937        return -code error "Port extract failed: $result"
    933938    }
     
    11111116    }
    11121117
    1113     ditem_key $mport provides [$workername eval return \$portname]
     1118    ditem_key $mport provides [$workername eval return \$name]
    11141119
    11151120    return $mport
     
    12851290    # Check for the presence of the port in the registry
    12861291    set workername [ditem_key $mport workername]
    1287     return [$workername eval registry_exists_for_name \${portname}]
     1292    return [$workername eval registry_exists_for_name \${name}]
    12881293}
    12891294
     
    12911296proc _mportactive {mport} {
    12921297    set workername [ditem_key $mport workername]
    1293     if {[catch {set reslist [$workername eval registry_active \${portname}]}]} {
     1298    if {[catch {set reslist [$workername eval registry_active \${name}]}]} {
     1299        return 0
     1300    } else {
     1301        return [expr [llength $reslist] > 0]
     1302    }
     1303}
     1304
     1305# Determine if the named port is active (only for image mode)
     1306proc _portnameactive {portname} {
     1307    if {[catch {set reslist [registry::active $portname]}]} {
    12941308        return 0
    12951309    } else {
     
    13041318# We actually start with the registry (faster?)
    13051319#
    1306 # mport     the port to test (to figure out if it's present)
     1320# mport     the port declaring the dep (context in which to evaluate $prefix etc)
    13071321# depspec   the dependency test specification (path, bin, lib, etc.)
    13081322proc _mportispresent {mport depspec} {
    1309     ui_debug "Searching for dependency: [ditem_key $mport provides]"
     1323    set portname [lindex [split $depspec :] end]
     1324    ui_debug "Searching for dependency: $portname"
    13101325    if {[string equal ${macports::registry.installtype} "image"]} {
    1311         set res [_mportactive $mport]
    1312     } else {
    1313         set res [_mportinstalled $mport]
     1326        set res [_portnameactive $portname]
     1327    } else {
     1328        set res [registry::entry_exists_for_name $portname]
    13141329    }
    13151330    if {$res != 0} {
    1316         ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
     1331        ui_debug "Found Dependency: receipt exists for $portname"
    13171332        return 1
    13181333    } else {
    13191334        # The receipt test failed, use one of the depspec regex mechanisms
    1320         ui_debug "Didn't find receipt, going to depspec regex for: [ditem_key $mport provides]"
     1335        ui_debug "Didn't find receipt, going to depspec regex for: $portname"
    13211336        set type [lindex [split $depspec :] 0]
    13221337        switch $type {
     
    13301345    }
    13311346}
     1347
     1348### _mportconflictsinstalled is private; may change without notice
     1349
     1350# Determine if the port, per the conflicts option, has any conflicts with
     1351# what is installed.
     1352#
     1353# mport   the port to check for conflicts
     1354# Returns a list of which installed ports conflict, or an empty list if none
     1355proc _mportconflictsinstalled {mport conflictinfo} {
     1356    set conflictlist {}
     1357    if {[llength $conflictinfo] > 0} {
     1358        ui_debug "Checking for conflicts against [_mportkey $mport name]"
     1359        foreach conflictport ${conflictinfo} {
     1360            if {[_mportispresent $mport port:${conflictport}]} {
     1361                lappend conflictlist $conflictport
     1362            }
     1363        }
     1364    } else {
     1365        ui_debug "[_mportkey $mport name] has no conflicts"
     1366    }
     1367
     1368    return $conflictlist
     1369}
     1370
    13321371
    13331372### _mportexec is private; may change without notice
     
    13701409    # XXX: need a more general way of comparing against targets
    13711410    set dlist {}
    1372     if {$target == "configure" || $target == "build"
     1411    if {   $target == "fetch" || $target == "checksum"
     1412        || $target == "extract" || $target == "patch"
     1413        || $target == "configure" || $target == "build"
    13731414        || $target == "test"
    13741415        || $target == "destroot" || $target == "install"
     
    16251666                    set indexfile [macports::getindex $source]
    16261667                    file mkdir [file dirname $indexfile]
    1627                     exec curl -L -s -S -o $indexfile $source/PortIndex
     1668                    curl $source/PortIndex $indexfile
    16281669                }
    16291670            }
     
    19471988# accDeps -> accumulator for recursive calls
    19481989# return 0 if everything was ok, an non zero integer otherwise.
    1949 proc mportdepends {mport {target ""} {recurseDeps 1} {skipSatisfied 1} {accDepsFlag 0}} {
     1990proc mportdepends {mport {target ""} {recurseDeps 1} {skipSatisfied 1}} {
    19501991
    19511992    array set portinfo [mportinfo $mport]
    19521993    set depends {}
    19531994    set deptypes {}
    1954     if {$accDepsFlag == 0} {
    1955         array set accDeps {}
    1956     } else {
    1957         upvar accDeps accDeps
    1958     }
    19591995
    19601996    # progress indicator
     
    19631999        flush stdout
    19642000    }
     2001   
     2002    if {[info exists portinfo(conflicts)] && ($target == "" || $target == "install")} {
     2003        set conflictports [_mportconflictsinstalled $mport $portinfo(conflicts)]
     2004        if {[llength ${conflictports}] != 0} {
     2005            if {[macports::global_option_isset ports_force]} {
     2006                ui_warn "Force option set; installing $portinfo(name) despite conflicts with: ${conflictports}"
     2007            } else {
     2008                return -code error "Can't install $portinfo(name) because conflicting ports are installed: ${conflictports}"
     2009            }
     2010        }
     2011    }
    19652012
    19662013    # Determine deptypes to look for based on target
    19672014    switch $target {
     2015        fetch       -
     2016        checksum    { set deptypes "depends_fetch" }
     2017        extract     -
     2018        patch       { set deptypes "depends_fetch depends_extract" }
    19682019        configure   -
    1969         build       { set deptypes "depends_lib depends_build" }
     2020        build       { set deptypes "depends_fetch depends_extract depends_lib depends_build" }
    19702021
    19712022        test        -
     
    19812032        srpm        -
    19822033        dpkg        -
    1983         ""          { set deptypes "depends_lib depends_build depends_run" }
     2034        ""          { set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run" }
    19842035    }
    19852036
     
    19932044
    19942045    set subPorts {}
     2046    set options [ditem_key $mport options]
     2047    set variations [ditem_key $mport variations]
    19952048
    19962049    foreach depspec $depends {
    1997         # grab the portname portion of the depspec
    1998         set dep_portname [lindex [split $depspec :] end]
    1999 
    2000         # Find the porturl
    2001         if {[catch {set res [mportlookup $dep_portname]} error]} {
    2002             global errorInfo
    2003             ui_debug "$errorInfo"
    2004             ui_error "Internal error: port lookup failed: $error"
    2005             return 1
    2006         }
    2007 
    2008         array unset portinfo
    2009         array set portinfo [lindex $res 1]
    2010         if {[info exists portinfo(porturl)]} {
    2011             set porturl $portinfo(porturl)
    2012         } else {
    2013             ui_error "Dependency '$dep_portname' not found."
    2014             return 1
    2015         }
    2016 
    2017         set options [ditem_key $mport options]
    2018         set variations [ditem_key $mport variations]
    2019 
    2020         # Figure out the subport.
    2021         set subport [mportopen $porturl $options $variations]
    2022 
    20232050        # Is that dependency satisfied or this port installed?
    20242051        # If we don't skip or if it is not, add it to the list.
    2025         if {!$skipSatisfied || ![_mportispresent $subport $depspec]} {
     2052        if {!$skipSatisfied || ![_mportispresent $mport $depspec]} {
     2053            # grab the portname portion of the depspec
     2054            set dep_portname [lindex [split $depspec :] end]
     2055
     2056            # Find the porturl
     2057            if {[catch {set res [mportlookup $dep_portname]} error]} {
     2058                global errorInfo
     2059                ui_debug "$errorInfo"
     2060                ui_error "Internal error: port lookup failed: $error"
     2061                return 1
     2062            }
     2063
     2064            array unset portinfo
     2065            array set portinfo [lindex $res 1]
     2066            if {![info exists portinfo(porturl)]} {
     2067                ui_error "Dependency '$dep_portname' not found."
     2068                return 1
     2069            }
     2070
     2071            # Figure out the subport. Check the open_mports list first, since
     2072            # we potentially leak mport references if we mportopen each time,
     2073            # because mportexec only closes each open mport once.
     2074            set subport [dlist_search $macports::open_mports porturl $portinfo(porturl)]
     2075            if {$subport == {}} {
     2076                # We haven't opened this one yet.
     2077                set subport [mportopen $portinfo(porturl) $options $variations]
     2078                if {$recurseDeps} {
     2079                    # Add to the list we need to recurse on.
     2080                    lappend subPorts $subport
     2081                }
     2082            }
     2083
    20262084            # Append the sub-port's provides to the port's requirements list.
    20272085            ditem_append_unique $mport requires "[ditem_key $subport provides]"
    2028 
    2029             if {$recurseDeps} {
    2030                 # Skip the port if it's already in the accumulated list.
    2031                 if {![info exists accDeps($dep_portname)]} {
    2032                     # Add it to the list
    2033                     set accDeps($dep_portname) 1
    2034 
    2035                     # We'll recursively iterate on it.
    2036                     lappend subPorts $subport
    2037                 }
    2038             }
    20392086        }
    20402087    }
     
    20442091        foreach subport $subPorts {
    20452092            # Sub ports should be installed (all dependencies must be satisfied).
    2046             set res [mportdepends $subport "" $recurseDeps $skipSatisfied 1]
     2093            set res [mportdepends $subport "" $recurseDeps $skipSatisfied]
    20472094            if {$res != 0} {
    20482095                return $res
     
    21172164            set group [file attributes ${prefix} -group]
    21182165            set perms [string range [file attributes ${prefix} -permissions] end-3 end]
    2119             set installing_user [exec /usr/bin/id -un]
    2120             if {![string equal $installing_user $owner]} {
    2121                 return -code error "User $installing_user does not own ${prefix} - try using sudo"
     2166            if {![string equal $tcl_platform(user) $owner]} {
     2167                return -code error "User $tcl_platform(user) does not own ${prefix} - try using sudo"
    21222168            }
    21232169            ui_debug "Permissions OK"
     
    21572203    set sources_owner [file attributes [file join $portdbpath sources/] -owner]
    21582204    ui_debug "Setting MacPorts sources ownership to $sources_owner"
    2159     if { [catch { exec chown -R $sources_owner [file join $portdbpath sources/] } result] } {
     2205    if { [catch { exec [findBinary chown $macports::autoconf::chown_path] -R $sources_owner [file join $portdbpath sources/] } result] } {
    21602206        return -code error "Couldn't change permissions of the MacPorts sources at $mp_source_path to $sources_owner: $result"
    21612207    }
     
    22212267        if {$result == "Registry error: $portname not registered as installed." } {
    22222268            ui_debug "$portname is *not* installed by MacPorts"
    2223             # open porthandle
    2224             set porturl $portinfo(porturl)
    2225             if {![info exists porturl]} {
    2226                 set porturl file://./
    2227             }
    2228             # Merge the global variations into the specified
    2229             foreach { variation value } $globalvarlist {
    2230                 if { ![info exists variations($variation)] } {
    2231                     set variations($variation) $value
     2269
     2270            # We need to pass _mportispresent a reference to the mport that is
     2271            # actually declaring the dependency on the one we're checking for.
     2272            # We got here via _upgrade_dependencies, so we grab it from 2 levels up.
     2273            upvar 2 workername parentworker
     2274            if {![_mportispresent $parentworker $dspec ] } {
     2275                # open porthandle
     2276                set porturl $portinfo(porturl)
     2277                if {![info exists porturl]} {
     2278                    set porturl file://./
    22322279                }
    2233             }
    2234 
    2235             if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
     2280                # Merge the global variations into the specified
     2281                foreach { variation value } $globalvarlist {
     2282                    if { ![info exists variations($variation)] } {
     2283                        set variations($variation) $value
     2284                    }
     2285                }
     2286
     2287                if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
    22362288                    global errorInfo
    22372289                    ui_debug "$errorInfo"
    22382290                    ui_error "Unable to open port: $result"
    22392291                    return 1
    2240             }
    2241             # While we're at it, update the portinfo
    2242             array unset portinfo
    2243             array set portinfo [mportinfo $workername]
    2244 
    2245             if {![_mportispresent $workername $dspec ] } {
     2292                }
     2293                # While we're at it, update the portinfo
     2294                array unset portinfo
     2295                array set portinfo [mportinfo $workername]
     2296               
    22462297                # upgrade its dependencies first
    22472298                _upgrade_dependencies portinfo depscache globalvarlist variationslist options
     
    22602311                }
    22612312                # we just installed it, so mark it done in the cache
    2262                 # and update ilist
    22632313                set depscache(port:${portname}) 1
     2314                mportclose $workername
    22642315            } else {
    22652316                # dependency is satisfied by something other than the named port
     
    22702321            # the rest of the proc doesn't matter for a port that is freshly
    22712322            # installed or not installed
    2272             mportclose $workername
    22732323            return 0
    22742324        } else {
     
    25842634
    25852635    # each dep type is upgraded
    2586     foreach dtype {depends_build depends_lib depends_run} {
     2636    foreach dtype {depends_fetch depends_extract depends_build depends_lib depends_run} {
    25872637        if {[info exists portinfo($dtype)]} {
    25882638            foreach i $portinfo($dtype) {
  • branches/gsoc09-logging/base/src/macports1.0/macports_autoconf.tcl.in

    r51135 r52218  
    3333
    3434namespace eval macports::autoconf {
     35    variable chown_path "@CHOWN@"
    3536    variable gzip_path "@GZIP@"
    3637    variable macports_conf_path "@MPCONFIGDIR_EXPANDED@"
  • branches/gsoc09-logging/base/src/macports1.0/macports_fastload.tcl.in

    r30972 r52218  
    7474catch {source [file join $dir pkgIndex.tcl]}
    7575
    76 foreach dir [glob -directory "@prefix_expanded@" -join share macports Tcl *] {
    77         catch {source [file join $dir pkgIndex.tcl]}
     76set sharetcldir [file join "@prefix_expanded@" share macports Tcl]
     77if {[file exists $sharetcldir]} {
     78        foreach dir [glob -directory $sharetcldir *] {
     79                catch {source [file join $dir pkgIndex.tcl]}
     80        }
    7881}
    7982
  • branches/gsoc09-logging/base/src/package1.0/Makefile

    r51384 r52218  
    1414        rm -f pkgIndex.tcl
    1515
    16 distclean::
     16distclean:: clean
    1717
    1818test::
    1919
    20 install::
     20install:: all
    2121        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    2222        $(SILENT)set -x; for file in ${SRCS}; do \
  • branches/gsoc09-logging/base/src/package1.0/portarchive.tcl

    r51384 r52218  
    6868        global variations package.destpath workpath
    6969        global ports_force ports_source_only ports_binary_only
    70         global portname portversion portrevision portvariants
     70        global name version revision portvariants
    7171        global archive.destpath archive.type archive.meta
    7272        global archive.file archive.path archive.fulldestpath
     
    101101                return 0
    102102        } elseif {[check_statefile target org.macports.unarchive $target_state_fd] && ([info exists ports_binary_only] && $ports_binary_only == "yes")} {
    103                 ui_debug "Skipping archive ($portname) since binary-only is set"
     103                ui_debug "Skipping archive ($name) since binary-only is set"
    104104                set skipped 1
    105105        } elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
    106                 ui_debug "Skipping archive ($portname) since source-only is set"
     106                ui_debug "Skipping archive ($name) since source-only is set"
    107107                set skipped 1
    108108        } else {
     
    111111                foreach archive.type [option portarchivetype] {
    112112                        if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
    113                                 set archive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${archive.type}"
     113                                set archive.file "${name}-${version}_${revision}${portvariants}.[option os.arch].${archive.type}"
    114114                                set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
    115115                                if {![file exists ${archive.path}]} {
     
    123123                if {!$any_missing} {
    124124                        # might be nice to allow forcing, but let's fix #16061 first
    125                         ui_debug "Skipping archive ($portname) since archive(s) already exist"
     125                        ui_debug "Skipping archive ($name) since archive(s) already exist"
    126126                        set skipped 1
    127127                }
     
    130130                }
    131131                if {[llength [option portarchivetype]] == $unsupported} {
    132                         ui_debug "Skipping archive ($portname) since specified archive types not supported"
     132                        ui_debug "Skipping archive ($name) since specified archive types not supported"
    133133                        set skipped 1
    134134                }
     
    144144proc portarchive::archive_start {args} {
    145145        global UI_PREFIX
    146         global portname portversion portrevision portvariants
     146        global name version revision portvariants
    147147
    148148        if {[llength [option portarchivetype]] > 1} {
    149                 ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [join [option portarchivetype] {, }] archives for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
     149                ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [join [option portarchivetype] {, }] archives for %s %s_%s%s"] $name $version $revision $portvariants]"
    150150        } else {
    151                 ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [option portarchivetype] archive for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
     151                ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [option portarchivetype] archive for %s %s_%s%s"] $name $version $revision $portvariants]"
    152152        }
    153153
     
    297297        global UI_PREFIX variations
    298298        global workpath destpath portpath ports_force
    299         global portname portepoch portversion portrevision portvariants
     299        global name epoch version revision portvariants
    300300        global archive.fulldestpath archive.type archive.file archive.path
    301301        global archive.meta archive.metaname archive.metapath
     
    314314        # Copy state file into destroot for archiving
    315315        # +STATE contains a copy of the MacPorts state information
    316     set statefile [file join $workpath .macports.${portname}.state]
     316    set statefile [file join $workpath .macports.${name}.state]
    317317        file copy -force $statefile [file join $destpath "+STATE"]
    318318
     
    349349        set control [list]
    350350        set fd [open [file join $destpath "+CONTENTS"] w]
    351         puts $fd "@name ${portname}-${portversion}_${portrevision}${portvariants}"
    352         puts $fd "@portname ${portname}"
    353         puts $fd "@portepoch ${portepoch}"
    354         puts $fd "@portversion ${portversion}"
    355         puts $fd "@portrevision ${portrevision}"
     351        puts $fd "@name ${name}-${version}_${revision}${portvariants}"
     352        puts $fd "@portname ${name}"
     353        puts $fd "@portepoch ${epoch}"
     354        puts $fd "@portversion ${version}"
     355        puts $fd "@portrevision ${revision}"
    356356        set vlist [lsort -ascii [array names variations]]
    357357        foreach v $vlist {
     
    360360                }
    361361        }
    362         foreach fullpath [exec find $destpath ! -type d] {
     362        fs-traverse fullpath $destpath {
     363            if {[file isdirectory $fullpath]} {
     364                continue
     365            }
    363366                set relpath [strsed $fullpath "s|^$destpath/||"]
    364367                if {![regexp {^[+]} $relpath]} {
     
    389392                #       see existing <portpkg> for the matching source package layout
    390393
    391                 putel $sd name ${portname}
    392                 putel $sd epoch ${portepoch}
    393                 putel $sd version ${portversion}
    394                 putel $sd revision ${portrevision}
     394                putel $sd name ${name}
     395                putel $sd epoch ${epoch}
     396                putel $sd version ${version}
     397                putel $sd revision ${revision}
    395398                putel $sd major 0
    396399                putel $sd minor 0
     
    417420            # Emit dependencies provided by this package
    418421            puts $sd "<provides>"
    419                 set name ${portname}
     422                set name ${name}
    420423                puts $sd "<item>"
    421424                putel $sd name $name
     
    425428            puts $sd "</provides>"
    426429           
    427     set res [mport_lookup $portname]
     430    set res [mport_lookup $name]
    428431    if {[llength $res] < 2} {
    429         ui_error "Dependency $portname not found"
     432        ui_error "Dependency $name not found"
    430433    } else {
    431434    array set portinfo [lindex $res 1]
     
    434437            puts $sd "<requires>"
    435438            foreach {key type} {
     439                depends_fetch "fetch"
     440                depends_extract "extract"
    436441                depends_build "build"
    437442                depends_lib "library"
     
    459464                if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
    460465                        # Define archive file/path
    461                         set archive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${archive.type}"
     466                        set archive.file "${name}-${version}_${revision}${portvariants}.[option os.arch].${archive.type}"
    462467                        set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
    463468
     
    482487proc portarchive::archive_finish {args} {
    483488        global UI_PREFIX
    484         global portname portversion portrevision portvariants
     489        global name version revision portvariants
    485490        global destpath
    486491
     
    493498
    494499        if {[llength [option portarchivetype]] > 1} {
    495                 ui_info "$UI_PREFIX [format [msgcat::mc "Archives for %s %s_%s%s packaged"] $portname $portversion $portrevision $portvariants]"
     500                ui_info "$UI_PREFIX [format [msgcat::mc "Archives for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
    496501        } else {
    497                 ui_info "$UI_PREFIX [format [msgcat::mc "Archive for %s %s_%s%s packaged"] $portname $portversion $portrevision $portvariants]"
     502                ui_info "$UI_PREFIX [format [msgcat::mc "Archive for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
    498503        }
    499504        return 0
  • branches/gsoc09-logging/base/src/package1.0/portdmg.tcl

    r49089 r52218  
    4545
    4646proc portdmg::dmg_main {args} {
    47     global portname portversion portrevision package.destpath UI_PREFIX
     47    global name version revision package.destpath UI_PREFIX
    4848   
    49     ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${portname} ${portversion}]"
     49    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${name} ${version}]"
    5050   
    51     return [package_dmg $portname $portversion $portrevision]
     51    return [package_dmg $name $version $revision]
    5252}
    5353
     
    9090    }
    9191   
    92     if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
     92    set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
     93    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
    9394        return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
    9495    }
    95     if {[catch {set devicename [exec hdid ${tmp_image} | grep s${subdev} | awk "{ print \$1 }"]} error]} {
     96    if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
    9697        return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
    9798    }
    98     set mount_point [exec mount | grep "${devicename}"]
     99    set attach_output [split $attach_output "\t"]
     100    set devicename [string trim [lindex $attach_output 0]]
     101    set mount_point [string trim [lindex $attach_output 2]]
    99102    regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
    100     system "ditto -rsrcFork ${pkgpath} '${mount_point}/${portname}-${portversion}.pkg'"
    101     system "hdiutil detach ${devicename} -quiet"
    102     if {[system "hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
     103    system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${pkgpath} '${mount_point}/${portname}-${portversion}.pkg'"
     104    system "$hdiutil detach ${devicename} -quiet"
     105    if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
    103106        return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
    104107    }
    105     if {[system "hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
     108    if {[system "$hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
    106109        return -code error [format [msgcat::mc "Failed to internet-enable: %s"] ${final_image}]
    107110    }
  • branches/gsoc09-logging/base/src/package1.0/portdpkg.tcl

    r50193 r52218  
    5151        global UI_PREFIX destpath os.arch os.platform
    5252   
    53         ui_msg "$UI_PREFIX [format [msgcat::mc "Creating dpkg for %s-%s"] [option portname] [option portversion]]"
     53        ui_msg "$UI_PREFIX [format [msgcat::mc "Creating dpkg for %s-%s"] [option name] [option version]]"
    5454
    5555        # get deplist
    56         set deps [make_dependency_list [option portname]]
     56        set deps [make_dependency_list [option name]]
    5757        set deps [lsort -unique $deps]
    5858        foreach dep $deps {
     
    6060                set vers [lindex [split $dep /] 1]
    6161                # don't re-package ourself
    62                 if {$name != [option portname]} {
     62                if {$name != [option name]} {
    6363                        lappend dependencies "${name} (>= ${vers})"
    6464                }
     
    9494        # Create dpkg version number
    9595        if {[expr [option epoch] != 0]} {
    96                 set pkg_version "[option epoch]:[option portversion]"
     96                set pkg_version "[option epoch]:[option version]"
    9797        } else {
    98                 set pkg_version "[option portversion]"
     98                set pkg_version "[option version]"
    9999        }
    100100        if {[expr [option revision] != 0]} {
     
    111111                set pkg_long_description " [option description]\n"
    112112        } else {
    113                 set pkg_long_description " [option portname]\n"
     113                set pkg_long_description " [option name]\n"
    114114        }
    115115
     
    138138        }
    139139
    140         puts $controlfd "Package: [option portname]"
     140        puts $controlfd "Package: [option name]"
    141141        puts $controlfd "Architecture: ${pkg_arch}"
    142142        puts $controlfd "Version: ${pkg_version}"
  • branches/gsoc09-logging/base/src/package1.0/portmdmg.tcl

    r49089 r52218  
    4545
    4646proc portmdmg::mdmg_main {args} {
    47     global portname portversion portrevision package.destpath UI_PREFIX
     47    global name version revision package.destpath UI_PREFIX
    4848   
    49     ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${portname} ${portversion}]"
     49    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${name} ${version}]"
    5050   
    51     return [package_mdmg $portname $portversion $portrevision]
     51    return [package_mdmg $name $version $revision]
    5252}
    5353
     
    8989        set subdev 2
    9090    }
    91    
     91
     92  set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
    9293  if {false} {
    93     if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
     94    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
    9495        return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
    9596    }
    96     if {[catch {set devicename [exec hdid ${tmp_image} | grep s${subdev} | awk "{ print \$1 }"]} error]} {
     97    if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
    9798        return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
    9899    }
    99     set mount_point [exec mount | grep "${devicename}"]
     100    set attach_output [split $attach_output "\t"]
     101    set devicename [string trim [lindex $attach_output 0]]
     102    set mount_point [string trim [lindex $attach_output 2]]
    100103    regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
    101     system "ditto -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'"
    102     system "hdiutil detach ${devicename} -quiet"
     104    system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'"
     105    system "$hdiutil detach ${devicename} -quiet"
    103106  } else {
    104     if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${mpkgpath} ${tmp_image}"] != ""} {
     107    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${mpkgpath} ${tmp_image}"] != ""} {
    105108        return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
    106109    }
    107110  }
    108     if {[system "hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
     111    if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
    109112        return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
    110113    }
    111     if {[system "hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
     114    if {[system "$hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
    112115        return -code error [format [msgcat::mc "Failed to internet-enable: %s"] ${final_image}]
    113116    }
  • branches/gsoc09-logging/base/src/package1.0/portmpkg.tcl

    r50415 r52218  
    4848
    4949proc portmpkg::mpkg_main {args} {
    50     global portname portversion portrevision package.destpath package.flat UI_PREFIX
     50    global name version revision package.destpath package.flat UI_PREFIX
    5151
    5252    # Make sure the destination path exists.
    5353    system "mkdir -p ${package.destpath}"
    5454
    55     return [package_mpkg $portname $portversion $portrevision]
     55    return [package_mpkg $name $version $revision]
    5656}
    5757
  • branches/gsoc09-logging/base/src/package1.0/portpkg.tcl

    r49089 r52218  
    5656
    5757proc portpkg::pkg_main {args} {
    58     global portname portversion portrevision package.type package.destpath package.flat UI_PREFIX
    59 
    60     ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s"] ${portname} ${portversion}]"
    61 
    62     return [package_pkg $portname $portversion $portrevision]
     58    global name version revision package.type package.destpath package.flat UI_PREFIX
     59
     60    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s"] ${name} ${version}]"
     61
     62    return [package_pkg $name $version $revision]
    6363}
    6464
     
    7474    }
    7575
    76     set packagemaker "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
     76    set packagemaker "[option developer_dir]/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
    7777    if ([file exists "$packagemaker"]) {
    7878        set resourcepath ${workpath}/pkg_resources
     
    8282
    8383    set language "English"
    84     system "mkdir -p -m 0755 ${resourcepath}/$language.lproj"
     84    file mkdir "${resourcepath}/${language}.lproj"
     85    file attributes "${resourcepath}/${language}.lproj" -permissions 0755
    8586       
    8687    # long_description, description, or homepage may not exist
     
    136137        write_info_plist ${pkgpath}/Contents/Info.plist $portname $portversion $portrevision
    137138
    138         system "mkbom ${destpath} ${pkgpath}/Contents/Archive.bom"
    139         system "cd ${destpath} && pax -x cpio -w -z . > ${pkgpath}/Contents/Archive.pax.gz"
     139        system "[findBinary mkbom $portutil::autoconf::mkbom_path] ${destpath} ${pkgpath}/Contents/Archive.bom"
     140        system "cd ${destpath} && [findBinary pax $portutil::autoconf::pax_path] -x [findBinary cpio $portutil::autoconf::cpio_path] -w -z . > ${pkgpath}/Contents/Archive.pax.gz"
    140141
    141142        write_description_plist ${resourcepath}/Description.plist $portname $portversion $description
     
    147148        if ([file exists "${destpath}/private/$dir"]) {
    148149            # restore any directories that were moved, to avoid confusing the rest of the ports system.
    149             system "mv ${destpath}/private/$dir ${destpath}/$dir; rmdir ${destpath}/private 2>/dev/null"
     150            file rename ${destpath}/private/$dir ${destpath}/$dir
    150151        }
    151152    }
     153    catch {file delete ${destpath}/private}
    152154
    153155    return 0
     
    298300proc portpkg::write_sizes_file {sizesfile portname portversion pkgpath destpath} {
    299301   
    300     if {[catch {set numFiles [exec lsbom -s ${pkgpath}/Contents/Archive.bom | wc -l]} result]} {
     302    if {[catch {set numFiles [llength [split [exec [findBinary lsbom $portutil::autoconf::lsbom_path] -s ${pkgpath}/Contents/Archive.bom] "\n"]]} result]} {
    301303        return -code error [format [msgcat::mc "Reading package bom failed: %s"] $result]
    302304    }
  • branches/gsoc09-logging/base/src/package1.0/portportpkg.tcl

    r49089 r52218  
    9191
    9292proc portportpkg::create_portpkg {} {
    93     global portname portversion prefix UI_PREFIX workpath portpath
     93    global name prefix UI_PREFIX workpath portpath
    9494
    9595        set xar [xar_path]
     
    9797    set dirname "portpkg"
    9898    set dirpath "${workpath}/${dirname}"
    99     set pkgpath "${workpath}/${portname}.portpkg"
     99    set pkgpath "${workpath}/${name}.portpkg"
    100100    set metaname "portpkg_meta.xml"
    101101    set metapath "${workpath}/${metaname}"
    102102   
    103103    # Expose and default some global variables
    104     set vars " portname portversion maintainers categories description \
     104    set vars " maintainers categories description \
    105105        long_description master_sites homepage epoch version revision \
    106106        PortInfo \
     
    142142               
    143143                puts $sd "<package>"
    144                         putel $sd name $portname
     144                        putel $sd name $name
    145145                        putel $sd homepage $homepage
    146146                        putlist $sd categories category $categories
     
    188188    set cmd "cd ${workpath}; ${xar} -cf ${pkgpath} --exclude \\.DSStore --exclude \\.svn ${dirname} -s ${metapath} -n ${metaname}"
    189189    if {[system $cmd] != ""} {
    190                 return -code error [format [msgcat::mc "Failed to create portpkg for port : %s"] $portname]
     190                return -code error [format [msgcat::mc "Failed to create portpkg for port : %s"] $name]
    191191    }
    192192   
     
    196196
    197197proc portportpkg::portpkg_main {args} {
    198     global portname portversion portverbose prefix UI_PREFIX workpath portpath
    199    
    200     ui_msg "$UI_PREFIX [format [msgcat::mc "Creating portpkg for %s-%s"] ${portname} ${portversion}]"
     198    global name version portverbose prefix UI_PREFIX workpath portpath
     199   
     200    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating portpkg for %s-%s"] ${name} ${version}]"
    201201
    202202    # Make sure we have a work directory
  • branches/gsoc09-logging/base/src/package1.0/portrpm.tcl

    r50193 r52218  
    4747
    4848proc portrpm::rpm_main {args} {
    49     global portname portversion portrevision UI_PREFIX
    50    
    51     ui_msg "$UI_PREFIX [format [msgcat::mc "Creating RPM package for %s-%s"] ${portname} ${portversion}]"
    52    
    53     return [rpm_pkg $portname $portversion $portrevision]
     49    global name version revision UI_PREFIX
     50   
     51    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating RPM package for %s-%s"] ${name} ${version}]"
     52   
     53    return [rpm_pkg $name $version $revision]
    5454}
    5555
  • branches/gsoc09-logging/base/src/package1.0/portsrpm.tcl

    r50193 r52218  
    4848
    4949proc portsrpm::srpm_main {args} {
    50     global portname portversion portrevision UI_PREFIX
    51    
    52     ui_msg "$UI_PREFIX [format [msgcat::mc "Creating SRPM package for %s-%s"] ${portname} ${portversion}]"
    53    
    54     return [srpm_pkg $portname $portversion $portrevision]
     50    global name version revision UI_PREFIX
     51   
     52    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating SRPM package for %s-%s"] ${name} ${version}]"
     53   
     54    return [srpm_pkg $name $version $revision]
    5555}
    5656
     
    136136        array set portinfo $array
    137137       
    138         if {[info exists portinfo(depends_build)] || [info exists portinfo(depends_lib)]} {
    139             # get the union of depends_build and depends_lib
     138        if {[info exists portinfo(depends_fetch)] || [info exists portinfo(depends_extract)]
     139            || [info exists portinfo(depends_build)] || [info exists portinfo(depends_lib)]} {
     140            # get the union of depends_fetch, depends_extract, depends_build and depends_lib
    140141            # xxx: only examines the portfile component of the depspec
    141142            set depends {}
     143            if {[info exists portinfo(depends_fetch)]} { eval "lappend depends $portinfo(depends_fetch)" }
     144            if {[info exists portinfo(depends_extract)]} { eval "lappend depends $portinfo(depends_extract)" }
    142145            if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
    143146            if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
  • branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl

    r51384 r52218  
    6464        global UI_PREFIX target_state_fd variations workpath
    6565        global ports_force ports_source_only ports_binary_only
    66         global portname portversion portrevision portvariants portpath
     66        global name version revision portvariants portpath
    6767        global unarchive.srcpath unarchive.type unarchive.file unarchive.path unarchive.fullsrcpath
    6868
     
    9696                return 0
    9797        } elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
    98                 ui_debug "Skipping unarchive ($portname) since source-only is set"
     98                ui_debug "Skipping unarchive ($name) since source-only is set"
    9999                set skipped 1
    100100        } elseif {[check_statefile target org.macports.destroot $target_state_fd]} {
    101                 ui_debug "Skipping unarchive ($portname) since destroot completed"
     101                ui_debug "Skipping unarchive ($name) since destroot completed"
    102102                set skipped 1
    103103        } elseif {[info exists ports_force] && $ports_force == "yes"} {
    104                 ui_debug "Skipping unarchive ($portname) since force is set"
     104                ui_debug "Skipping unarchive ($name) since force is set"
    105105                set skipped 1
    106106        } else {
     
    109109                foreach unarchive.type [option portarchivetype] {
    110110                        if {[catch {archiveTypeIsSupported ${unarchive.type}} errmsg] == 0} {
    111                                 set unarchive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${unarchive.type}"
     111                                set unarchive.file "${name}-${version}_${revision}${portvariants}.[option os.arch].${unarchive.type}"
    112112                                set unarchive.path "[file join ${unarchive.fullsrcpath} ${unarchive.file}]"
    113113                                if {[file exist ${unarchive.path}]} {
     
    126126                } else {
    127127                        if {[info exists ports_binary_only] && $ports_binary_only == "yes"} {
    128                                 return -code error "Archive for ${portname} ${portversion}_${portrevision}${portvariants} not found, required when binary-only is set!"
     128                                return -code error "Archive for ${name} ${version}_${revision}${portvariants} not found, required when binary-only is set!"
    129129                        } else {
    130130                                if {[llength [option portarchivetype]] == $unsupported} {
    131                                         ui_debug "Skipping unarchive ($portname) since specified archive types not supported"
    132                                 } else {
    133                                         ui_debug "Skipping unarchive ($portname) since no archive found"
     131                                        ui_debug "Skipping unarchive ($name) since specified archive types not supported"
     132                                } else {
     133                                        ui_debug "Skipping unarchive ($name) since no archive found"
    134134                                }
    135135                                set skipped 1
     
    146146
    147147proc portunarchive::unarchive_start {args} {
    148         global UI_PREFIX portname portversion portrevision portvariants
     148        global UI_PREFIX name version revision portvariants
    149149        global unarchive.type
    150150
    151         ui_msg "$UI_PREFIX [format [msgcat::mc "Unpacking ${unarchive.type} archive for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
     151        ui_msg "$UI_PREFIX [format [msgcat::mc "Unpacking ${unarchive.type} archive for %s %s_%s%s"] $name $version $revision $portvariants]"
    152152
    153153        return 0
     
    272272proc portunarchive::unarchive_main {args} {
    273273        global UI_PREFIX
    274         global portname portversion portrevision portvariants
     274        global name version revision portvariants
    275275        global unarchive.dir unarchive.file unarchive.pipe_cmd
    276276
     
    295295
    296296proc portunarchive::unarchive_finish {args} {
    297         global UI_PREFIX target_state_fd unarchive.file portname workpath destpath
     297        global UI_PREFIX target_state_fd unarchive.file name workpath destpath
    298298
    299299        # Reset state file with archive version
    300     set statefile [file join $workpath .macports.${portname}.state]
     300    set statefile [file join $workpath .macports.${name}.state]
    301301        file copy -force [file join $destpath "+STATE"] $statefile
    302         exec touch $statefile
     302        file mtime $statefile [clock seconds]
    303303
    304304# Hack to temporarily move com.apple.* strings in statefiles extracted from old archives
  • branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c

    r51384 r52218  
    575575        if(onoblock && ounlock) {
    576576          /* should not be specified together */
    577           Tcl_SetResult(interp, "-noblock can not be used with -unlock", TCL_STATIC);
     577          Tcl_SetResult(interp, "-noblock cannot be used with -unlock", TCL_STATIC);
    578578          return TCL_ERROR;
    579579        }
     
    11661166        Tcl_CreateObjCommand(interp, "name_to_uid", name_to_uidCmd, NULL, NULL);
    11671167        Tcl_CreateObjCommand(interp, "uid_to_name", uid_to_nameCmd, NULL, NULL);
     1168        Tcl_CreateObjCommand(interp, "uname_to_gid", uname_to_gidCmd, NULL, NULL);
    11681169        Tcl_CreateObjCommand(interp, "name_to_gid", name_to_gidCmd, NULL, NULL);
    11691170        Tcl_CreateObjCommand(interp, "gid_to_name", gid_to_nameCmd, NULL, NULL);
  • branches/gsoc09-logging/base/src/pextlib1.0/filemap.c

    r51384 r52218  
    9393
    9494#include <tcl.h>
    95 #include <tclDecls.h>
    9695
    9796#include "filemap.h"
     
    708707                                        *theSubnodeCursor = 0;
    709708                                }
     709                               
     710                                theSubnodeCursor++;
    710711                        }
    711712                }
  • branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c

    r51133 r52218  
    224224                        append_allow("/dev", 0);
    225225                        append_allow(Tcl_GetVar(interp, "macports::prefix", TCL_GLOBAL_ONLY), 2);
    226                         append_allow("/Applications/MacPorts", 0);
    227226                        /* If there is no SDK we will allow everything in /usr /System/Library etc, else add binaries to allow, and redirect root to SDK. */
    228227                        if(sdk&&*sdk)
     
    235234                                append_allow("/usr/libexec/gcc", 0);
    236235                                append_allow("/System/Library/Perl", 0);
    237                                 append_allow("/usr/X11R6/bin", 0);
    238236                                append_allow("/", 1);
    239237                                strcpy(t-1, buf);
  • branches/gsoc09-logging/base/src/pextlib1.0/tty.c

    r51384 r52218  
    4848#include "tty.h"
    4949
    50 int IsattyCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
     50int
     51IsattyCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
    5152{
    52         Tcl_Obj *tcl_result;
    53         Tcl_Channel chan;
    54         int dir;
    55         int fd;
    56         int rval;
     53    Tcl_Obj *tcl_result;
     54    Tcl_Channel chan;
     55    int dir;
     56    int fd;
     57    int rval;
    5758
    58         if (objc != 2) {
    59             Tcl_WrongNumArgs(interp, 1, objv, "channel");
    60             return TCL_ERROR;
    61         }
     59    if (objc != 2) {
     60        Tcl_WrongNumArgs(interp, 1, objv, "channel");
     61        return TCL_ERROR;
     62    }
    6263
    63         chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
    64         if (chan == NULL) {
    65             Tcl_SetResult(interp, "no such channel", TCL_STATIC);
    66             return TCL_ERROR;
    67         }
     64    chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
     65    if (chan == NULL) {
     66        Tcl_SetResult(interp, "no such channel", TCL_STATIC);
     67        return TCL_ERROR;
     68    }
    6869
    69         if (Tcl_GetChannelHandle(chan,
    70                 dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
    71                 (ClientData*) &fd) == TCL_ERROR) {
    72             return TCL_ERROR;
    73         }
     70    if (Tcl_GetChannelHandle(chan,
     71            dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
     72            (ClientData*) &fd) == TCL_ERROR) {
     73        return TCL_ERROR;
     74    }
    7475
    75         rval = isatty(fd);
     76    rval = isatty(fd);
    7677
    77         tcl_result = Tcl_NewIntObj(rval);
    78         Tcl_SetObjResult(interp, tcl_result);
     78    tcl_result = Tcl_NewIntObj(rval);
     79    Tcl_SetObjResult(interp, tcl_result);
    7980
    80         return TCL_OK;
     81    return TCL_OK;
    8182}
    8283
    83 int TermGetSizeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
     84int
     85TermGetSizeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
    8486{
    85         Tcl_Obj *tcl_result;
    86         Tcl_Channel chan;
    87         int dir;
    88         int fd;
    89         Tcl_Obj *robjv[2];
    90         struct winsize ws = {0, 0, 0, 0};
     87    Tcl_Obj *tcl_result;
     88    Tcl_Channel chan;
     89    int dir;
     90    int fd;
     91    Tcl_Obj *robjv[2];
     92    struct winsize ws = {0, 0, 0, 0};
    9193
    92         if (objc != 2) {
    93                 Tcl_WrongNumArgs(interp, 1, objv, "channel");
    94                 return TCL_ERROR;
    95         }
     94    if (objc != 2) {
     95        Tcl_WrongNumArgs(interp, 1, objv, "channel");
     96        return TCL_ERROR;
     97    }
    9698
    97         chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
    98         if (chan == NULL) {
    99             Tcl_SetResult(interp, "no such channel", TCL_STATIC);
    100             return TCL_ERROR;
    101         }
     99    chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
     100    if (chan == NULL) {
     101        Tcl_SetResult(interp, "no such channel", TCL_STATIC);
     102        return TCL_ERROR;
     103    }
    102104
    103         if (Tcl_GetChannelHandle(chan,
    104                 dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
    105                 (ClientData*) &fd) == TCL_ERROR) {
    106             return TCL_ERROR;
    107         }
     105    if (Tcl_GetChannelHandle(chan,
     106            dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
     107            (ClientData*) &fd) == TCL_ERROR) {
     108        return TCL_ERROR;
     109    }
    108110
    109         if (!isatty(fd)) {
    110             Tcl_SetResult(interp, "channel is not connected to a tty", TCL_STATIC);
    111             return TCL_ERROR;
    112         }
     111    if (!isatty(fd)) {
     112        Tcl_SetResult(interp, "channel is not connected to a tty", TCL_STATIC);
     113        return TCL_ERROR;
     114    }
    113115
    114         if (ioctl(fd, TIOCGWINSZ, &ws) == -1) {
    115             Tcl_SetResult(interp, "ioctl failed", TCL_STATIC);
    116             return TCL_ERROR;
    117         }
     116    if (ioctl(fd, TIOCGWINSZ, &ws) == -1) {
     117        Tcl_SetResult(interp, "ioctl failed", TCL_STATIC);
     118        return TCL_ERROR;
     119    }
    118120
    119         robjv[0] = Tcl_NewIntObj(ws.ws_row);
    120         robjv[1] = Tcl_NewIntObj(ws.ws_col);
     121    robjv[0] = Tcl_NewIntObj(ws.ws_row);
     122    robjv[1] = Tcl_NewIntObj(ws.ws_col);
    121123
    122         tcl_result = Tcl_NewListObj(2, robjv);
    123         Tcl_SetObjResult(interp, tcl_result);
     124    tcl_result = Tcl_NewListObj(2, robjv);
     125    Tcl_SetObjResult(interp, tcl_result);
    124126
    125         return TCL_OK;
     127    return TCL_OK;
    126128}
  • branches/gsoc09-logging/base/src/pextlib1.0/uid.c

    r51384 r52218  
    275275
    276276/*
     277        uname_to_gid
     278       
     279        synopsis: uname_to_gid name
     280        this function takes a *user* name
     281*/
     282int uname_to_gidCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
     283{
     284        struct passwd *pwent;
     285        char* name = NULL;
     286       
     287        /* Check the arg count */
     288        if (objc != 2) {
     289                Tcl_WrongNumArgs(interp, 1, objv, "name");
     290                return TCL_ERROR;
     291        }
     292       
     293        /* Get the  name */
     294        name = Tcl_GetString(objv[1]);
     295        if (name == NULL || !*name)
     296                return TCL_ERROR;
     297       
     298        /* Map the name --> user gid */
     299        pwent = getpwnam(name);
     300
     301        if (pwent == NULL)
     302                Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
     303        else
     304                Tcl_SetObjResult(interp, Tcl_NewIntObj(pwent->pw_gid));
     305
     306        return TCL_OK;
     307}
     308
     309/*
    277310    name_to_gid
     311
     312        synopsis: name_to_gid name
     313    this function takes a *group* name
    278314*/
    279315int name_to_gidCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
  • branches/gsoc09-logging/base/src/pextlib1.0/uid.h

    r30972 r52218  
    4646int name_to_uidCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
    4747int uid_to_nameCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
     48int uname_to_gidCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
    4849int name_to_gidCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
    4950int gid_to_nameCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
  • branches/gsoc09-logging/base/src/port/Makefile

    r36770 r52218  
    88
    99include ../../Mk/macports.autoconf.mk
     10
     11.PHONY: mkdirs
    1012
    1113all: ${SCRIPTS}
     
    3032distclean: clean
    3133
    32 install: port portindex portmirror mkdirs
     34install: all mkdirs
    3335        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/bin
    3436        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/var/macports
  • branches/gsoc09-logging/base/src/port/port-help.tcl

    r49752 r52218  
    140140which case all will be included.  If no fields are specified, a useful default
    141141set will be used.  The other options which do not correspond to fields are:
    142    --depends   An abbreviation for all three depends_* fields
     142   --depends   An abbreviation for all depends_* fields
    143143   --index     Do not read the Portfile, instead rely solely on the index
    144144               information. Note this option will prevent the information
  • branches/gsoc09-logging/base/src/port/port.tcl

    r51826 r52218  
    9595Additional pseudo-portnames start with...
    9696variants:, variant:, description:, depends:, depends_lib:, depends_run:,
    97 depends_build:, portdir:, homepage:, epoch:, platforms:, platform:, name:,
    98 long_description:, maintainers:, maintainer:, categories:, category:, version:,
    99 and revision:.
     97depends_build:, depends_fetch:, depends_extract:, portdir:, homepage:, epoch:,
     98platforms:, platform:, name:, long_description:, maintainers:, maintainer:,
     99categories:, category:, version:, and revision:.
    100100These each select a set of ports based on a regex search of metadata
    101101about the ports. In all such cases, a standard regex pattern following
     
    935935        ^depends_build:     -
    936936        ^depends_run:       -
     937        ^depends_extract:   -
     938        ^depends_fetch:     -
    937939        ^revision:          { # Handle special port selectors
    938940            advance
     
    948950        }
    949951
    950         ^depends:           { # A port selector shorthand for depends_lib, depends_build or depends_run
     952        ^depends:           { # A port selector shorthand for depends_{lib,build,run,fetch,extract}
    951953            advance
    952954
     
    957959            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_build"]
    958960            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_run"]
     961            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_extract"]
     962            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_fetch"]
    959963
    960964            set el 1
     
    15081512        array set list_map "
    15091513            categories      1
     1514            depends_fetch   1
     1515            depends_extract 1
    15101516            depends_build   1
    15111517            depends_lib     1
     
    15141520            platforms       1
    15151521            variants        1
     1522            conflicts       1
    15161523        "
    15171524
     
    15201527            heading     ""
    15211528            variants    Variants
     1529            depends_fetch "Fetch Dependencies"
     1530            depends_extract "Extract Dependencies"
    15221531            depends_build "Build Dependencies"
    15231532            depends_run "Runtime Dependencies"
     
    15301539            maintainers Maintainers
    15311540            license     License
     1541            conflicts   "Conflicts with"
    15321542        }
    15331543
     
    15361546            heading 0
    15371547            variants 22
     1548            depends_fetch 22
     1549            depends_extract 22
    15381550            depends_build 22
    15391551            depends_run 22
     
    15441556            platforms 22
    15451557            license 22
     1558            conflicts 22
    15461559            maintainers 22
    15471560        }
     
    15501563        if {[info exists options(ports_info_depends)] && $options(ports_info_depends) == "yes"} {
    15511564            array unset options ports_info_depends
     1565            set options(ports_info_depends_fetch) yes
     1566            set options(ports_info_depends_extract) yes
    15521567            set options(ports_info_depends_build) yes
    15531568            set options(ports_info_depends_lib) yes
     
    15961611                ports_info_skip_line
    15971612                ports_info_long_description ports_info_homepage
    1598                 ports_info_skip_line ports_info_depends_build
     1613                ports_info_skip_line ports_info_depends_fetch
     1614                ports_info_depends_extract ports_info_depends_build
    15991615                ports_info_depends_lib ports_info_depends_run
     1616                ports_info_conflicts
    16001617                ports_info_platforms ports_info_license
    16011618                ports_info_maintainers
     
    18771894    }
    18781895    foreachport $portlist {
    1879         if { [catch {portimage::activate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
    1880             global errorInfo
    1881             ui_debug "$errorInfo"
    1882             break_softcontinue "port activate failed: $result" 1 status
     1896        if {![macports::global_option_isset ports_dryrun]} {
     1897            if { [catch {portimage::activate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
     1898                global errorInfo
     1899                ui_debug "$errorInfo"
     1900                break_softcontinue "port activate failed: $result" 1 status
     1901            }
     1902        } else {
     1903            ui_msg "Skipping activate $portname (dry run)"
    18831904        }
    18841905    }
     
    18941915    }
    18951916    foreachport $portlist {
    1896         if { [catch {portimage::deactivate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
    1897             global errorInfo
    1898             ui_debug "$errorInfo"
    1899             break_softcontinue "port deactivate failed: $result" 1 status
     1917        if {![macports::global_option_isset ports_dryrun]} {
     1918            if { [catch {portimage::deactivate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
     1919                global errorInfo
     1920                ui_debug "$errorInfo"
     1921                break_softcontinue "port deactivate failed: $result" 1 status
     1922            }
     1923        } else {
     1924            ui_msg "Skipping deactivate $portname (dry run)"
    19001925        }
    19011926    }
     
    21472172            global errorInfo
    21482173            ui_debug "$errorInfo"
    2149 
    2150             # start gsoc08-privileges
    2151             if { [string first "permission denied" $result] != -1 } {
    2152                 set result "port requires root privileges for this action and needs you to execute 'sudo port uninstall $portname' to continue."
    2153                 #ui_msg [exec sudo port uninstall $portname]
    2154                 # The above line is what should be here to let the user simply enter his/her password to uninstall as root.
    2155                 # However, for some as yet unknown reason, executing it here will not work.
    2156             }
    2157             # end gsoc08-privileges
    2158 
    21592174            break_softcontinue "port uninstall failed: $result" 1 status
    21602175        }
     
    25142529    if {[info exists options(ports_search_depends)] && $options(ports_search_depends) == "yes"} {
    25152530        array unset options ports_search_depends
     2531        set options(ports_search_depends_fetch) yes
     2532        set options(ports_search_depends_extract) yes
    25162533        set options(ports_search_depends_build) yes
    25172534        set options(ports_search_depends_lib) yes
     
    29262943
    29272944        mportclose $workername
    2928        
    2929         # start gsoc08-privileges
    2930         if { [geteuid] != 0 && $result == 2} {
    2931             # mportexec will return an error result code 2 if eval_targets fails due to insufficient privileges.
    2932 
    2933             set portbinary "${macports::prefix}/bin/port"
    2934 
    2935             ui_info "Attempting port action with 'sudo port': 'sudo $portbinary $target $portname'."
    2936             set result 0
    2937             if {[catch {set sudomsgs [exec sudo $portbinary $target $portname]} sudomsgs]} {
    2938                 global errorInfo
    2939                 ui_debug "$errorInfo"
    2940                 break_softcontinue "Unable to execute port: $errorInfo" 1 status
    2941             }
    2942 
    2943             ui_msg $sudomsgs
    2944             ui_debug "'sudo $portbinary $target $portname' has completed."
    2945         }
    2946         # end gsoc08-privileges
    29472945       
    29482946        # Process any error that wasn't thrown and handled already
     
    31403138    edit        {{editor 1}}
    31413139    ed          {{editor 1}}
    3142     info        {category categories depends_build depends_lib depends_run
     3140    info        {category categories depends_fetch depends_extract
     3141                 depends_build depends_lib depends_run
    31433142                 depends description epoch fullname heading homepage index license
    31443143                 line long_description
    31453144                 maintainer maintainers name platform platforms portdir pretty
    31463145                 revision variant variants version}
    3147     search      {case-sensitive category categories depends_build depends_lib depends_run
     3146    search      {case-sensitive category categories depends_fetch
     3147                 depends_extract depends_build depends_lib depends_run
    31483148                 depends description epoch exact glob homepage line
    31493149                 long_description maintainer maintainers name platform
  • branches/gsoc09-logging/base/src/port/portindex.tcl

    r51135 r52218  
    6969        }
    7070
    71         set keepkeys {categories depends_build depends_lib depends_run description epoch homepage long_description maintainers name platforms revision variants version portdir}
     71        set keepkeys {categories depends_fetch depends_extract depends_build depends_lib depends_run description epoch homepage long_description maintainers name platforms revision variants version portdir}
    7272        foreach availkey [array names portinfo] {
    7373            if {[lsearch -exact ${keepkeys} $availkey] == -1} {
  • branches/gsoc09-logging/base/src/port1.0/Makefile

    r51384 r52218  
    2222        rm -f pkgIndex.tcl
    2323
    24 distclean::
     24distclean:: clean
    2525        rm -f port_autoconf.tcl
    2626
    27 install::
     27install:: all
    2828        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    2929        $(SILENT)set -x; for file in ${SRCS}; do \
  • branches/gsoc09-logging/base/src/port1.0/port_autoconf.tcl.in

    r51135 r52218  
    3434        variable bzip2_path "@BZIP2@"
    3535        variable cp_path "@CP@"
     36        variable cpio_path "@CPIO@"
     37        variable diff_path "@DIFF@"
     38        variable ditto_path "@DITTO@"
     39        variable dscl_path "@DSCL@"
     40        variable file_path "@FILE@"
    3641        variable cvs_path "@CVS@"
    3742        variable svn_path "@SVN@"
    3843        variable git_path "@GIT@"
     44        variable hg_path "@HG@"
    3945        variable gzip_path "@GZIP@"
     46        variable lipo_path "@LIPO@"
     47        variable nice_path "@NICE@"
     48        variable patch_path "@PATCH@"
    4049        variable rmdir_path "@RMDIR@"
    4150        variable rsync_path "@RSYNC@"
    4251        variable unzip_path "@UNZIP@"
    4352        variable zip_path "@ZIP@"
     53        variable lsbom_path "@LSBOM@"
     54        variable make_path "@MAKE@"
     55        variable gnumake_path "@GNUMAKE@"
     56        variable bsdmake_path "@BSDMAKE@"
     57        variable mkbom_path "@MKBOM@"
    4458        variable mtree_path "@MTREE@"
    4559        variable pax_path "@PAX@"
  • branches/gsoc09-logging/base/src/port1.0/portactivate.tcl

    r50562 r52218  
    5353
    5454proc portactivate::activate_main {args} {
    55     global env portname portversion portrevision portvariants user_options portnotes
    56     registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
     55    global env name version revision portvariants user_options portnotes
     56    registry_activate $name ${version}_${revision}${portvariants} [array get user_options]
    5757
    5858    # Display notes at the end of the activation phase.
  • branches/gsoc09-logging/base/src/port1.0/portbuild.tcl

    r50562 r52218  
    6363proc portbuild::build_getmaketype {args} {
    6464    if {![exists build.type]} {
    65         return make
     65        return [findBinary make $portutil::autoconf::make_path]
    6666    }
    6767    switch -exact -- [option build.type] {
    6868        bsd {
    6969            if {[option os.platform] == "darwin"} {
    70                 return bsdmake
     70                return [findBinary bsdmake $portutil::autoconf::bsdmake_path]
    7171            } elseif {[option os.platform] == "freebsd"} {
    72                 return make
     72                return [binaryInPath make]
    7373            } else {
    74                 return pmake
     74                return [binaryInPath pmake]
    7575            }
    7676        }
    7777        gnu {
    7878            if {[option os.platform] == "darwin"} {
    79                 return gnumake
     79                return [findBinary gnumake $portutil::autoconf::gnumake_path]
    8080            } elseif {[option os.platform] == "linux"} {
    81                 return make
     81                return [binaryInPath make]
    8282            } else {
    83                 return gmake
     83                return [binaryInPath gmake]
    8484            }
    8585        }
    8686        pbx {
    87             set pbxbuild "pbxbuild"
    88             set xcodebuild "xcodebuild"
    89 
    9087            if {[option os.platform] != "darwin"} {
    9188                return -code error "[format [msgcat::mc "This port requires 'pbxbuild/xcodebuild', which is not available on %s."] [option os.platform]]"
    9289            }
    9390
    94             if {[catch {set xcodebuild [binaryInPath $xcodebuild]}] == 0} {
     91            if {[catch {set xcodebuild [binaryInPath xcodebuild]}] == 0} {
    9592                return $xcodebuild
    96             } elseif {[catch {set pbxbuild [binaryInPath $pbxbuild]}] == 0} {
     93            } elseif {[catch {set pbxbuild [binaryInPath pbxbuild]}] == 0} {
    9794                return $pbxbuild
    9895            } else {
     
    10299        default {
    103100            ui_warn "[format [msgcat::mc "Unknown build.type %s, using 'gnumake'"] [option build.type]]"
    104             return gnumake
     101            return [findBinary gnumake $portutil::autoconf::gnumake_path]
    105102        }
    106103    }
     
    115112        return ""
    116113    }
    117     return "nice -n $nice "
     114    return "[findBinary nice $portutil::autoconf::nice_path] -n $nice "
    118115}
    119116
     
    132129    # if set to '0', use the number of cores for the number of jobs
    133130    if {$jobs == 0} {
    134         set jobs [exec "/usr/sbin/sysctl" "-n" "hw.ncpu"]
     131        if {[catch {set jobs [exec "/usr/sbin/sysctl" "-n" "hw.availcpu"]}]} {
     132            set jobs 2
     133            ui_warn "failed to determine the number of available CPUs (probably not supported on this platform)"
     134            ui_warn "defaulting to $jobs jobs, consider setting buildmakejobs to a nonzero value in macports.conf"
     135        }
    135136    }
    136137    if {![string is integer -strict $jobs] || $jobs <= 1} {
     
    141142
    142143proc portbuild::build_start {args} {
    143     global UI_PREFIX build.asroot
     144    global UI_PREFIX
    144145
    145     ui_msg "$UI_PREFIX [format [msgcat::mc "Building %s"] [option portname]]"
    146 
    147     # start gsoc08-privileges
    148     if { [tbool build.asroot] } {
    149     # if port is marked as needing root
    150         elevateToRoot "build"
    151     }
    152     # end gsoc08-privileges
    153 
     146    ui_msg "$UI_PREFIX [format [msgcat::mc "Building %s"] [option name]]"
    154147}
    155148
  • branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl

    r50562 r52218  
    180180    global UI_PREFIX
    181181
    182     ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying checksum(s) for %s"] [option portname]]"
     182    ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying checksum(s) for %s"] [option name]]"
    183183}
    184184
  • branches/gsoc09-logging/base/src/port1.0/portclean.tcl

    r50562 r52218  
    5353    global UI_PREFIX
    5454
    55     ui_msg "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option portname]]"
     55    ui_msg "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option name]]"
    5656}
    5757
     
    6363    if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
    6464        [info exists ports_clean_dist] && $ports_clean_dist == "yes"} {
    65         ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option portname]]"
     65        ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option name]]"
    6666        clean_dist
    6767    }
    6868    if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
    6969        [info exists ports_clean_archive] && $ports_clean_archive == "yes"} {
    70         ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option portname]]"
     70        ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option name]]"
    7171        clean_archive
    7272    }
    7373    if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
    7474        [info exists ports_clean_work] && $ports_clean_work == "yes" || \
    75         (!([info exists ports_clean_dist] && $ports_clean_dist == "yes") && \
    76          !([info exists ports_clean_archive] && $ports_clean_archive == "yes"))} {
    77          ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option portname]]"
     75        (!([info exists ports_clean_archive] && $ports_clean_archive == "yes"))} {
     76         ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option name]]"
    7877         clean_work
    7978    }
     
    8180    # start gsoc-08 privileges
    8281    if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
    83         ui_info "$UI_PREFIX [format [msgcat::mc "Removing alt source directory for %s"] [option portname]]"
     82        ui_info "$UI_PREFIX [format [msgcat::mc "Removing alt source directory for %s"] [option name]]"
    8483        clean_altsource
    8584    }
     
    112111#
    113112proc portclean::clean_dist {args} {
    114     global ports_force portname distpath dist_subdir distfiles
     113    global ports_force name distpath dist_subdir distfiles
    115114
    116115    # remove known distfiles for sure (if they exist)
     
    140139    # or if user forces us to
    141140    set dirlist [list]
    142     if {($dist_subdir != $portname)} {
     141    if {($dist_subdir != $name)} {
    143142        if {[info exists dist_subdir]} {
    144143            set distfullpath [file join $distpath $dist_subdir]
     
    149148            } else {
    150149                lappend dirlist $dist_subdir
    151                 lappend dirlist $portname
     150                lappend dirlist $name
    152151            }
    153152        } else {
    154             lappend dirlist $portname
    155         }
    156     } else {
    157         lappend dirlist $portname
     153            lappend dirlist $name
     154        }
     155    } else {
     156        lappend dirlist $name
    158157    }
    159158    # loop through directories
     
    201200
    202201proc portclean::clean_archive {args} {
    203     global workpath portarchivepath portname portversion ports_version_glob
     202    global workpath portarchivepath name version ports_version_glob
    204203
    205204    # Define archive destination directory and target filename
     
    211210        # Match all possible archive variatns that match the version
    212211        # glob specified by the user for this OS.
    213         set fileglob "$portname-[option ports_version_glob]*.[option os.arch].*"
     212        set fileglob "$name-[option ports_version_glob]*.[option os.arch].*"
    214213    } else {
    215214        # Match all possible archive variants for the current version on
     
    220219        # first part of the name (e.g. trying to remove foo-*, it will
    221220        # pick up anything foo-bar-* as well, which is undesirable).
    222         set fileglob "$portname-$portversion*.[option os.arch].*"
     221        set fileglob "$name-$version*.[option os.arch].*"
    223222    }
    224223
     
    230229            # Make sure file is truly a port archive file, and not
    231230            # and accidental match with some other file that might exist.
    232             if {[regexp "^$portname-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\][option os.arch]\[\.\]\[a-z\]+\$" $file]} {
     231            if {[regexp "^$name-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\][option os.arch]\[\.\]\[a-z\]+\$" $file]} {
    233232                if {[file isfile $path]} {
    234233                    ui_debug "Removing archive: $path"
  • branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl

    r51384 r52218  
    6666    if {[string equal ${action} "set"] && [tbool args]} {
    6767        switch $option {
    68             use_autoreconf {
    69                 depends_build-append bin:autoreconf:autoconf
    70             }
    71             use_automake {
    72                 depends_build-append bin:automake:automake
    73             }
    74             use_autoconf {
    75                 depends_build-append bin:autoconf:autoconf
    76             }
    7768            use_xmkmf {
    78                 depends_build-append path:bin/xmkmf:imake
     69                depends_build-append port:imake
     70            }
     71            default {
     72                depends_build-append port:autoconf port:automake port:libtool
    7973            }
    8074        }
     
    135129default configure.pkg_config_path   {}
    136130
    137 # backwards compatibility for hardcoded ports
    138 if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
    139     set sysroot "/Developer/SDKs/MacOSX10.5.sdk"
    140 } else {
    141     set sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
    142 }
    143 
    144131options configure.universal_target configure.universal_sysroot configure.universal_archs configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
    145132default configure.universal_target      {${universal_target}}
    146133default configure.universal_sysroot     {${universal_sysroot}}
    147134default configure.universal_archs       {${universal_archs}}
    148 default configure.universal_args        {[portconfigure::configure_get_universal_args]}
     135default configure.universal_args        {--disable-dependency-tracking}
    149136default configure.universal_cflags      {[portconfigure::configure_get_universal_cflags]}
    150137default configure.universal_cppflags    {[portconfigure::configure_get_universal_cppflags]}
     
    173160    global configure.compiler
    174161   
    175     ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option portname]]"
     162    ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option name]]"
    176163
    177164    set name ""
     
    196183    }
    197184    ui_debug "Using compiler '$name'"
    198    
    199     # start gsoc08-privileges
    200     if { [tbool configure.asroot] } {
    201         # if port is marked as needing root
    202         elevateToRoot "configure"
    203     }
    204     # end gsoc08-privileges
    205 }
    206 
    207 # internal function to determine the universal args for configure.cmd
    208 proc portconfigure::configure_get_universal_args {args} {
    209     set params "--disable-dependency-tracking"
    210     return $params
    211185}
    212186
     
    271245# internal function to find correct compilers
    272246proc portconfigure::configure_get_compiler {type} {
    273     global configure.compiler prefix
     247    global configure.compiler prefix developer_dir
    274248    set ret ""
    275249    switch -exact ${configure.compiler} {
     
    307281        llvm-gcc-4.2 {
    308282            switch -exact ${type} {
    309                 cc   { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
    310                 objc { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
    311                 cxx  { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 }
    312                 cpp  { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 }
     283                cc   { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
     284                objc { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
     285                cxx  { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 }
     286                cpp  { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 }
    313287            }
    314288        }
    315289        clang {
    316290            switch -exact ${type} {
    317                 cc   { set ret /usr/bin/clang }
    318                 objc { set ret /usr/bin/clang }
     291                cc   { set ret ${developer_dir}/usr/bin/clang }
     292                objc { set ret ${developer_dir}/usr/bin/clang }
    319293            }
    320294        }
  • branches/gsoc09-logging/base/src/port1.0/portdepends.tcl

    r50562 r52218  
    3838
    3939# define options
    40 options depends_build depends_run depends_lib depends
     40options depends_fetch depends_extract depends_build depends_run depends_lib depends
    4141# Export options via PortInfo
    42 options_export depends_build depends_lib depends_run
     42options_export depends_fetch depends_extract depends_build depends_lib depends_run
    4343
     44option_proc depends_fetch portdepends::validate_depends_options
     45option_proc depends_extract portdepends::validate_depends_options
    4446option_proc depends_build portdepends::validate_depends_options
    4547option_proc depends_run portdepends::validate_depends_options
  • branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl

    r51135 r52218  
    6969default destroot.violate_mtree no
    7070
    71 default startupitem.name        {${portname}}
     71default startupitem.name        {${name}}
    7272default startupitem.uniquename  {org.macports.${startupitem.name}}
    7373default startupitem.plist       {${startupitem.uniquename}.plist}
     
    8888
    8989proc portdestroot::destroot_start {args} {
    90     global UI_PREFIX prefix portname porturl destroot os.platform destroot.clean portsharepath
     90    global UI_PREFIX prefix name porturl destroot os.platform destroot.clean portsharepath
    9191    global destroot.umask destroot.asroot macportsuser euid egid usealtworkpath altprefix
    9292    global applications_dir frameworks_dir
    9393    variable oldmask
    9494
    95     ui_msg "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${portname}]"
     95    ui_msg "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${name}]"
    9696
    9797    # start gsoc08-privileges
     
    107107
    108108    if { [tbool destroot.asroot] && [getuid] != 0 } {
    109         global errorisprivileges
    110         set errorisprivileges yes
    111         return -code error "You can not run this port without elevated privileges. You need to re-run with 'sudo port'.";
     109        return -code error "You cannot run this port without root privileges. You need to re-run with 'sudo port'.";
    112110    }
    113111
     
    123121
    124122    set oldmask [umask ${destroot.umask}]
    125     set mtree ${portutil::autoconf::mtree_path}
     123    set mtree [findBinary mtree ${portutil::autoconf::mtree_path}]
    126124
    127125    if { ${destroot.clean} == "yes" } {
     
    145143
    146144proc portdestroot::destroot_finish {args} {
    147     global UI_PREFIX destroot prefix portname startupitem.create destroot.violate_mtree
     145    global UI_PREFIX destroot prefix name startupitem.create destroot.violate_mtree
     146    global applications_dir frameworks_dir developer_dir destroot.keepdirs
    148147    global os.platform os.version
    149148    variable oldmask
     
    163162
    164163    # Prune empty directories in ${destroot}
    165     set exclude_dirs [list]
    166     set exclude_phrase ""
    167     foreach path [option destroot.keepdirs] {
     164    foreach path ${destroot.keepdirs} {
    168165        if {![file isdirectory ${path}]} {
    169166            xinstall -m 0755 -d ${path}
    170167        }
    171         if {![file exists ${path}/.turd_${portname}]} {
    172             xinstall -c -m 0644 /dev/null ${path}/.turd_${portname}
    173         }
    174         lappend exclude_dirs "-path \"${path}\""
    175     }
    176     if { [llength ${exclude_dirs}] > 0 } {
    177         set exclude_phrase "! \\( [join ${exclude_dirs} " -or "] \\)"
    178     }
    179     catch {system "find \"${destroot}\" -depth -type d ${exclude_phrase} -exec rmdir -- \{\} \\; 2>/dev/null"}
     168        if {![file exists ${path}/.turd_${name}]} {
     169            xinstall -c -m 0644 /dev/null ${path}/.turd_${name}
     170        }
     171    }
     172    fs-traverse -depth dir ${destroot} {
     173        if {[file isdirectory $dir]} {
     174            catch {file delete $dir}
     175        }
     176    }
    180177
    181178    # Compress all manpages with gzip (instead)
    182     # but NOT on Jaguar (Darwin 6.x)
    183     if {![regexp {darwin6} "${os.platform}${os.version}"]} {
    184         set manpath "${destroot}${prefix}/share/man"
    185         set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
    186         set gunzip "$gzip -d"
    187         set bunzip2 "[findBinary bzip2 ${portutil::autoconf::bzip2_path}] -d"
    188         if {[file isdirectory ${manpath}] && [file type ${manpath}] == "directory"} {
    189             ui_info "$UI_PREFIX [format [msgcat::mc "Compressing man pages for %s"] ${portname}]"
    190             set found 0
    191             set manlinks [list]
    192             foreach mandir [readdir "${manpath}"] {
    193                 if {![regexp {^(cat|man)(.)$} ${mandir} match ignore manindex]} { continue }
    194                 set mandirpath [file join ${manpath} ${mandir}]
    195                 if {[file isdirectory ${mandirpath}] && [file type ${mandirpath}] == "directory"} {
    196                     ui_debug "Scanning ${mandir}"
    197                     foreach manfile [readdir ${mandirpath}] {
    198                         set manfilepath [file join ${mandirpath} ${manfile}]
    199                         if {[file isfile ${manfilepath}] && [file type ${manfilepath}] == "file"} {
    200                             if {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]gz\$" ${manfile} gzfile manfile]} {
    201                                 set found 1
    202                                 system "cd ${manpath} && \
    203                                 $gunzip -f [file join ${mandir} ${gzfile}] && \
    204                                 $gzip -9vf [file join ${mandir} ${manfile}]"
    205                             } elseif {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]bz2\$" ${manfile} bz2file manfile]} {
    206                                 set found 1
    207                                 system "cd ${manpath} && \
    208                                 $bunzip2 -f [file join ${mandir} ${bz2file}] && \
    209                                 $gzip -9vf [file join ${mandir} ${manfile}]"
    210                             } elseif {[regexp "\[.\]${manindex}\[a-z\]*\$" ${manfile}]} {
    211                                 set found 1
    212                                 system "cd ${manpath} && \
    213                                 $gzip -9vf [file join ${mandir} ${manfile}]"
     179    set manpath "${destroot}${prefix}/share/man"
     180    set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
     181    set gunzip "$gzip -d"
     182    set bunzip2 "[findBinary bzip2 ${portutil::autoconf::bzip2_path}] -d"
     183    if {[file isdirectory ${manpath}] && [file type ${manpath}] == "directory"} {
     184        ui_info "$UI_PREFIX [format [msgcat::mc "Compressing man pages for %s"] ${name}]"
     185        set found 0
     186        set manlinks [list]
     187        foreach mandir [readdir "${manpath}"] {
     188            if {![regexp {^(cat|man)(.)$} ${mandir} match ignore manindex]} { continue }
     189            set mandirpath [file join ${manpath} ${mandir}]
     190            if {[file isdirectory ${mandirpath}] && [file type ${mandirpath}] == "directory"} {
     191                ui_debug "Scanning ${mandir}"
     192                foreach manfile [readdir ${mandirpath}] {
     193                    set manfilepath [file join ${mandirpath} ${manfile}]
     194                    if {[file isfile ${manfilepath}] && [file type ${manfilepath}] == "file"} {
     195                        if {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]gz\$" ${manfile} gzfile manfile]} {
     196                            set found 1
     197                            system "cd ${manpath} && \
     198                            $gunzip -f [file join ${mandir} ${gzfile}] && \
     199                            $gzip -9vf [file join ${mandir} ${manfile}]"
     200                        } elseif {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]bz2\$" ${manfile} bz2file manfile]} {
     201                            set found 1
     202                            system "cd ${manpath} && \
     203                            $bunzip2 -f [file join ${mandir} ${bz2file}] && \
     204                            $gzip -9vf [file join ${mandir} ${manfile}]"
     205                        } elseif {[regexp "\[.\]${manindex}\[a-z\]*\$" ${manfile}]} {
     206                            set found 1
     207                            system "cd ${manpath} && \
     208                            $gzip -9vf [file join ${mandir} ${manfile}]"
     209                        }
     210                        set gzmanfile ${manfile}.gz
     211                        set gzmanfilepath [file join ${mandirpath} ${gzmanfile}]
     212                        if {[file exists ${gzmanfilepath}]} {
     213                            set desired 00444
     214                            set current [file attributes ${gzmanfilepath} -permissions]
     215                            if {$current != $desired} {
     216                                ui_info "[file join ${mandir} ${gzmanfile}]: changing permissions from $current to $desired"
     217                                file attributes ${gzmanfilepath} -permissions $desired
    214218                            }
    215                             set gzmanfile ${manfile}.gz
    216                             set gzmanfilepath [file join ${mandirpath} ${gzmanfile}]
    217                             if {[file exists ${gzmanfilepath}]} {
    218                                 set desired 00444
    219                                 set current [file attributes ${gzmanfilepath} -permissions]
    220                                 if {$current != $desired} {
    221                                     ui_info "[file join ${mandir} ${gzmanfile}]: changing permissions from $current to $desired"
    222                                     file attributes ${gzmanfilepath} -permissions $desired
    223                                 }
    224                             }
    225                         } elseif {[file type ${manfilepath}] == "link"} {
    226                             lappend manlinks [file join ${mandir} ${manfile}]
    227                         }
     219                        }
     220                    } elseif {[file type ${manfilepath}] == "link"} {
     221                        lappend manlinks [file join ${mandir} ${manfile}]
    228222                    }
    229223                }
    230224            }
    231             if {$found == 1} {
    232                 # check man page links and rename/repoint them if necessary
    233                 foreach manlink $manlinks {
    234                     set manlinkpath [file join $manpath $manlink]
    235                     # if link destination is not gzipped, check it
    236                     set manlinksrc [file readlink $manlinkpath]
    237                     # if link destination is an absolute path, convert it to a
    238                     # relative path
    239                     if {[file pathtype $manlinksrc] eq "absolute"} {
    240                         set manlinksrc [file tail $manlinksrc]
    241                     }
    242                     if {![regexp "\[.\]gz\$" ${manlinksrc}]} {
    243                         set mandir [file dirname $manlink]
    244                         set mandirpath [file join $manpath $mandir]
    245                         set pwd [pwd]
    246                         if {[catch {_cd $mandirpath} err]} {
    247                             puts $err
    248                             return
    249                         }
    250                         # if gzipped destination exists, fix link
    251                         if {[file isfile ${manlinksrc}.gz]} {
    252                             # if actual link name does not end with gz, rename it
    253                             if {![regexp "\[.\]gz\$" ${manlink}]} {
    254                                 ui_debug "renaming link: $manlink to ${manlink}.gz"
    255                                 file rename $manlinkpath ${manlinkpath}.gz
    256                                 set manlink ${manlink}.gz
    257                                 set manlinkpath [file join $manpath $manlink]
    258                             }
    259                             # repoint the link
    260                             ui_debug "repointing link: $manlink from $manlinksrc to ${manlinksrc}.gz"
    261                             file delete $manlinkpath
    262                             ln -s "${manlinksrc}.gz" "${manlinkpath}"
    263                         }
    264                         _cd $pwd
    265                     }
    266                 }
    267             } else {
    268                 ui_debug "No man pages found to compress."
     225        }
     226        if {$found == 1} {
     227            # check man page links and rename/repoint them if necessary
     228            foreach manlink $manlinks {
     229                set manlinkpath [file join $manpath $manlink]
     230                # if link destination is not gzipped, check it
     231                set manlinksrc [file readlink $manlinkpath]
     232                # if link destination is an absolute path, convert it to a
     233                # relative path
     234                if {[file pathtype $manlinksrc] eq "absolute"} {
     235                    set manlinksrc [file tail $manlinksrc]
     236                }
     237                if {![regexp "\[.\]gz\$" ${manlinksrc}]} {
     238                    set mandir [file dirname $manlink]
     239                    set mandirpath [file join $manpath $mandir]
     240                    set pwd [pwd]
     241                    if {[catch {_cd $mandirpath} err]} {
     242                        puts $err
     243                        return
     244                    }
     245                    # if gzipped destination exists, fix link
     246                    if {[file isfile ${manlinksrc}.gz]} {
     247                        # if actual link name does not end with gz, rename it
     248                        if {![regexp "\[.\]gz\$" ${manlink}]} {
     249                            ui_debug "renaming link: $manlink to ${manlink}.gz"
     250                            file rename $manlinkpath ${manlinkpath}.gz
     251                            set manlink ${manlink}.gz
     252                            set manlinkpath [file join $manpath $manlink]
     253                        }
     254                        # repoint the link
     255                        ui_debug "repointing link: $manlink from $manlinksrc to ${manlinksrc}.gz"
     256                        file delete $manlinkpath
     257                        ln -s "${manlinksrc}.gz" "${manlinkpath}"
     258                    }
     259                    _cd $pwd
     260                }
    269261            }
    270         }
    271     } else {
    272         ui_debug "No man page compression on ${os.platform}${os.version}."
     262        } else {
     263            ui_debug "No man pages found to compress."
     264        }
    273265    }
    274266
     
    308300                    lpush pathsToCheck $dfile
    309301                } else {
    310                     # these files are outside of the prefix
    311                     switch $dfile {
    312                         /Applications -
    313                         /Developer -
    314                         /Library { ui_debug "port installs files in $dfile" }
    315                         default {
    316                             ui_warn "violation by $dfile"
    317                             set mtree_violation "yes"
    318                         }
     302                    set dir_allowed no
     303                    # these files are (at least potentially) outside of the prefix
     304                    foreach dir "$applications_dir $frameworks_dir /Library/LaunchAgents /Library/LaunchDaemons /Library/StartupItems" {
     305                        if {[string equal -length [expr [string length $dfile] + 1] $dfile/ $dir]} {
     306                            # it's a prefix of one of the allowed paths
     307                            set dir_allowed yes
     308                            break
     309                        }
     310                    }
     311                    if {$dir_allowed} {
     312                        lpush pathsToCheck $dfile
     313                    } else {
     314                        # not a prefix of an allowed path, so it's either the path itself or a violation
     315                        switch $dfile \
     316                            $applications_dir - \
     317                            $frameworks_dir - \
     318                            /Library/LaunchAgents - \
     319                            /Library/LaunchDaemons - \
     320                            /Library/StartupItems { ui_debug "port installs files in $dfile" } \
     321                            default {
     322                                ui_warn "violation by $dfile"
     323                                set mtree_violation "yes"
     324                            }
    319325                    }
    320326                }
     
    324330        # abort here only so all violations can be observed
    325331        if { ${mtree_violation} != "no" } {
    326             ui_warn "[format [msgcat::mc "%s violates the layout of the ports-filesystems!"] [option portname]]"
     332            ui_warn "[format [msgcat::mc "%s violates the layout of the ports-filesystems!"] [option name]]"
    327333            ui_warn "Please fix or indicate this misbehavior (if it is intended), it will be an error in future releases!"
    328334            # error "mtree violation!"
    329335        }
    330336    } else {
    331         ui_warn "[format [msgcat::mc "%s requests to install files outside the common directory structure!"] [option portname]]"
     337        ui_msg "[format [msgcat::mc "Note: %s installs files outside the common directory structure."] [option name]]"
    332338    }
    333339
     
    335341    umask $oldmask
    336342
    337     # start gsoc08-privileges
    338     chownAsRoot $destroot
    339     # end gsoc08-privileges
    340 
    341343    return 0
    342344}
  • branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl

    r50562 r52218  
    5555    global distcheck.check
    5656    global fetch.type
    57     global portname portpath
     57    global name portpath
    5858
    5959    set port_moddate [file mtime ${portpath}/Portfile]
     
    8383                    set file_url [portfetch::assemble_url $site $distfile]
    8484                    if {[catch {set urlnewer [curl isnewer $file_url $port_moddate]} error]} {
    85                         ui_warn "couldn't fetch $file_url for $portname ($error)"
     85                        ui_warn "couldn't fetch $file_url for $name ($error)"
    8686                    } else {
    8787                        if {$urlnewer} {
    88                             ui_warn "port $portname: $file_url is newer than portfile"
     88                            ui_warn "port $name: $file_url is newer than portfile"
    8989                        }
    9090                        incr count
     
    9292                }
    9393                if {$count == 0} {
    94                     ui_error "no mirror had $distfile for $portname"
     94                    ui_error "no mirror had $distfile for $name"
    9595                }
    9696            } elseif {${distcheck.check} == "filesize"} {
     
    100100                    set file_url [portfetch::assemble_url $site $distfile]
    101101                    if {[catch {set urlsize [curl getsize $file_url]} error]} {
    102                         ui_warn "couldn't fetch $file_url for $portname ($error)"
     102                        ui_warn "couldn't fetch $file_url for $name ($error)"
    103103                    } else {
    104104                        incr count
    105105                        if {$urlsize > 0} {
    106                             ui_info "port $portname: $distfile $urlsize bytes"
     106                            ui_info "port $name: $distfile $urlsize bytes"
    107107                            incr totalsize $urlsize
    108108                            break
     
    111111                }
    112112                if {$count == 0} {
    113                     ui_error "no mirror had $distfile for $portname"
     113                    ui_error "no mirror had $distfile for $name"
    114114                }
    115115            } else {
     
    133133                set humansize [format "%.1fG" $size]
    134134            }
    135             ui_msg "$portname: $humansize"
     135            ui_msg "$name: $humansize"
    136136        }
    137137    }
  • branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl

    r49087 r52218  
    4949
    5050proc portdistfiles::distfiles_start {args} {
    51     global UI_PREFIX portname
    52     ui_msg "$UI_PREFIX [format [msgcat::mc "Distfiles for %s"] ${portname}]"
     51    global UI_PREFIX name
     52    ui_msg "$UI_PREFIX [format [msgcat::mc "Distfiles for %s"] ${name}]"
    5353}
    5454
  • branches/gsoc09-logging/base/src/port1.0/portextract.tcl

    r51135 r52218  
    9999    } elseif {[tbool use_dmg]} {
    100100        global worksrcdir
    101         set dmg_tmp_dir [exec mktemp -d -q "/tmp/mports.XXXXXXXX"]
     101        set dmg_tmp_dir [mkdtemp "/tmp/mports.XXXXXXXX"]
    102102        set dmg_mount ${dmg_tmp_dir}/${worksrcdir}
    103103        file mkdir ${dmg_mount}
     
    111111    global UI_PREFIX
    112112
    113     ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option portname]]"
     113    ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option name]]"
    114114}
    115115
  • branches/gsoc09-logging/base/src/port1.0/portfetch.tcl

    r50835 r52218  
    5656options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 use_lzma use_7z use_dmg dist_subdir \
    5757    fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
    58     master_sites.mirror_subdir patch_sites.mirror_subdir portname \
     58    master_sites.mirror_subdir patch_sites.mirror_subdir \
    5959    cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
    60     svn.url svn.tag svn.revision svn.method \
    61     git.url git.branch \
    62     hg.url hg.tag
     60    svn.url svn.revision svn.method \
     61    git.cmd git.url git.branch \
     62    hg.cmd hg.url hg.tag
    6363
    6464# XXX we use the command framework to buy us some useful features,
     
    7171default fetch.type standard
    7272
    73 default cvs.cmd {$portutil::autoconf::cvs_path}
     73default cvs.cmd {[findBinary cvs $portutil::autoconf::cvs_path]}
    7474default cvs.password ""
    7575default cvs.dir {${workpath}}
     
    8383default cvs.post_args {"${cvs.module}"}
    8484
    85 default svn.cmd {$portutil::autoconf::svn_path}
     85default svn.cmd {[findBinary svn $portutil::autoconf::svn_path]}
    8686default svn.dir {${workpath}}
    8787default svn.method {export}
    88 default svn.tag ""
    8988default svn.revision ""
    9089default svn.env {}
     
    9392default svn.post_args {"${svn.url}"}
    9493
     94default git.cmd {[findBinary git $portutil::autoconf::git_path]}
    9595default git.dir {${workpath}}
    9696default git.branch {}
    9797
     98default hg.cmd {[findBinary hg $portutil::autoconf::hg_path]}
    9899default hg.dir {${workpath}}
    99100default hg.tag {tip}
     
    101102# Set distfiles
    102103default distfiles {[portfetch::suffix $distname]}
    103 default dist_subdir {${portname}}
     104default dist_subdir {${name}}
    104105
    105106# user name & password
     
    130131option_proc fetch.type portfetch::set_fetch_type
    131132
    132 # We should probably add something like a depends_fetch; see #15161
    133133proc portfetch::set_extract_type {option action args} {
    134134    global extract.suffix
     
    140140            use_lzma {
    141141                set extract.suffix .tar.lzma
    142                 depends_build-append bin:lzma:lzmautils
     142                depends_extract-append bin:lzma:lzmautils
    143143            }
    144144            use_zip {
    145145                set extract.suffix .zip
    146                 depends_build-append bin:unzip:unzip
     146                depends_extract-append bin:unzip:unzip
    147147            }
    148148            use_7z {
    149149                set extract.suffix .7z
    150                 depends_build-append bin:7za:p7zip
     150                depends_extract-append bin:7za:p7zip
    151151            }
    152152            use_dmg {
     
    161161        switch $args {
    162162            cvs {
    163                 depends_build-append bin:cvs:cvs
     163                depends_fetch-append bin:cvs:cvs
    164164            }
    165165            svn {
    166                 depends_build-append bin:svn:subversion
     166                depends_fetch-append bin:svn:subversion
    167167            }
    168168            git {
    169                 depends_build-append bin:git:git-core
     169                depends_fetch-append bin:git:git-core
    170170            }
    171171            hg {
    172                 depends_build-append bin:hg:mercurial
     172                depends_fetch-append bin:hg:mercurial
    173173            }
    174174        }
     
    208208# pre-registered set of sites, and if so, return them.
    209209proc portfetch::mirror_sites {mirrors tag subdir} {
    210     global UI_PREFIX portname porturl mirror_sites.listfile mirror_sites.listpath dist_subdir
     210    global UI_PREFIX name porturl mirror_sites.listfile mirror_sites.listpath dist_subdir
    211211    global global_mirror_site fallback_mirror_site
    212212
     
    243243        set thesubdir ${dist_subdir}
    244244    } elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
    245         set thesubdir ${portname}
     245        set thesubdir ${name}
    246246    } else {
    247247        set thesubdir ${subdir}
     
    486486        set saveargs ${cvs.args}
    487487        set savepost_args ${cvs.post_args}
    488         set cvs.cmd "echo ${cvs.password} | $portutil::autoconf::cvs_path"
     488        set cvs.cmd "echo ${cvs.password} | ${cvs.cmd}"
    489489        set cvs.args login
    490490        set cvs.post_args ""
     
    511511# Perform an svn fetch
    512512proc portfetch::svnfetch {args} {
    513     global workpath prefix_frozen
    514     global svn.env svn.cmd svn.args svn.post_args svn.revision svn.url svn.method
    515 
    516     # Look for the svn command, either in the path or in the prefix
    517     set goodcmd 0
    518     foreach svncmd "${svn.cmd} ${prefix_frozen}/bin/svn svn" {
    519         if { [file executable ${svncmd}] } {
    520             set svn.cmd $svncmd
    521             set goodcmd 1
    522             break;
    523         }
    524     }
    525     if { !$goodcmd } {
    526         ui_error "The subversion tool (svn) is required to fetch ${svn.url}."
    527         ui_error "Please install the subversion port before proceeding."
    528         return -code error [msgcat::mc "Subversion check out failed"]
    529     }
     513    global svn.args svn.revision svn.method
    530514
    531515    set svn.args "${svn.method} ${svn.args}"
     
    547531# Perform a git fetch
    548532proc portfetch::gitfetch {args} {
    549     global worksrcpath prefix_frozen
    550     global git.url git.branch git.sha1
    551 
    552     # Look for the git command
    553     set git.cmd {}
    554     foreach gitcmd "$portutil::autoconf::git_path $prefix_frozen/bin/git git" {
    555         if {[file executable $gitcmd]} {
    556             set git.cmd $gitcmd
    557             break
    558         }
    559     }
    560     if {${git.cmd} == {}} {
    561         ui_error "git is required to fetch ${git.url}"
    562         ui_error "Please install the git-core port before proceeding."
    563         return -code error [msgcat::mc "Git command not found"]
    564     }
     533    global worksrcpath
     534    global git.url git.branch git.sha1 git.cmd
    565535
    566536    set options "-q"
     
    594564proc portfetch::hgfetch {args} {
    595565    global worksrcpath prefix_frozen
    596     global hg.url hg.tag
    597 
    598     # Look for the hg command.
    599     set hg.cmd {}
    600     foreach hgcmd "$prefix_frozen/bin/hg hg" {
    601         if {[file executable $hgcmd]} {
    602             set hg.cmd $hgcmd
    603             break
    604         }
    605     }
    606     if {${hg.cmd} == {}} {
    607         ui_error "hg is required to fetch ${hg.url}"
    608         ui_error "Please install the mercurial port before proceeding."
    609         return -code error [msgcat::mc "Mercurial command not found"]
    610     }
     566    global hg.url hg.tag hg.cmd
    611567
    612568    set cmdstring "${hg.cmd} clone --rev ${hg.tag} ${hg.url} ${worksrcpath} 2>&1"
     
    634590    if {![file isdirectory $distpath]} {
    635591        if {[catch {file mkdir $distpath} result]} {
    636             return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
    637         }
     592            elevateToRoot "fetch"
     593            set elevated yes
     594            if {[catch {file mkdir $distpath} result]} {
     595                return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
     596            }
     597        }
     598    }
     599    chownAsRoot $distpath
     600    if {[info exists elevated] && $elevated == yes} {
     601        dropPrivileges
    638602    }
    639603
     
    757721
    758722proc portfetch::fetch_start {args} {
    759     global UI_PREFIX portname
    760 
    761     ui_msg "$UI_PREFIX [format [msgcat::mc "Fetching %s"] $portname]"
     723    global UI_PREFIX name
     724
     725    ui_msg "$UI_PREFIX [format [msgcat::mc "Fetching %s"] $name]"
    762726}
    763727
  • branches/gsoc09-logging/base/src/port1.0/portinstall.tcl

    r50801 r52218  
    5656
    5757proc portinstall::install_start {args} {
    58     global UI_PREFIX portname portversion portrevision variations portvariants
    59     global install.asroot prefix
    60     ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $portname $portversion $portrevision $portvariants]"
     58    global UI_PREFIX name version revision variations portvariants
     59    global prefix
     60    ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $name $version $revision $portvariants]"
    6161   
    6262    # start gsoc08-privileges
    63     if { [tbool install.asroot] } {
    64         # if port is marked as needing root
    65         elevateToRoot "install"
    66     } elseif { ![file writable $prefix] } {
     63    if { ![file writable $prefix] } {
    6764        # if install location is not writable, need root privileges to install
    6865        elevateToRoot "install"
     
    8077   
    8178    # if the file is a symlink, do not try to set file attributes
    82     # if the destination file is an existing directory,
    83     # do not overwrite its file attributes
    84     if {[file type $src_element] != "link" || [file isdirectory $dst_element]} {
    85         set attributes [file attributes $src_element]
    86         for {set i 0} {$i < [llength $attributes]} {incr i} {
    87             set opt [lindex $attributes $i]
    88             incr i
    89             set arg [lindex $attributes $i]
    90             file attributes $dst_element $opt $arg
    91             # set mtime on installed element
    92             exec touch -r $src_element $dst_element
    93         }
     79    if {[file type $src_element] != "link"} {
     80        eval file attributes {$dst_element} [file attributes $src_element]
     81        # set mtime on installed element
     82        file mtime $dst_element [file mtime $src_element]
    9483    }
    9584}
     
    140129
    141130proc portinstall::install_main {args} {
    142     global portname portversion portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot portrevision maintainers ports_force portvariants targets depends_lib PortInfo epoch
     131    global name version portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot revision maintainers ports_force portvariants targets depends_lib PortInfo epoch license
    143132   
    144133    # Begin the registry entry
    145     set regref [registry_new $portname $portversion $portrevision $portvariants $epoch]
     134    set regref [registry_new $name $version $revision $portvariants $epoch]
    146135   
    147136    # Install the files
     
    167156    if {[info exists depends_run]} {
    168157        registry_prop_store $regref depends_run $depends_run
    169         registry_register_deps $depends_run $portname
     158        registry_register_deps $depends_run $name
    170159    }
    171160    if {[info exists depends_lib]} {
    172161        registry_prop_store $regref depends_lib $depends_lib
    173         registry_register_deps $depends_lib $portname
     162        registry_register_deps $depends_lib $name
    174163    }
    175164    if {[info exists installPlist]} {
    176165        registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
    177166        if { [registry_prop_retr $regref installtype] != "image" } {
    178             registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $portname
     167            registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $name
    179168        }
    180169    }
  • branches/gsoc09-logging/base/src/port1.0/portlint.tcl

    r50375 r52218  
    9090
    9191proc portlint::lint_start {args} {
    92     global UI_PREFIX portname
    93     ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying Portfile for %s"] ${portname}]"
     92    global UI_PREFIX name
     93    ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying Portfile for %s"] ${name}]"
    9494}
    9595
    9696proc portlint::lint_main {args} {
    97     global UI_PREFIX portname portpath porturl ports_lint_nitpick
     97    global UI_PREFIX name portpath porturl ports_lint_nitpick
    9898    set portfile ${portpath}/Portfile
    9999    set portdirs [split ${portpath} /]
     
    262262
    263263    global os.platform os.arch os.version
    264     global portversion portrevision portepoch
     264    global version revision epoch
    265265    # hoping for "noarch" :
    266266    set portarch ${os.arch}
    267267    global description long_description platforms categories all_variants
    268268    global maintainers homepage master_sites checksums patchfiles
    269     global depends_lib depends_build depends_run distfiles fetch.type
     269    global depends_fetch depends_extract depends_lib depends_build depends_run distfiles fetch.type
    270270   
    271271    global lint_portsystem lint_platforms
     
    295295
    296296    foreach req_var $lint_required {
    297         if {$req_var == "name"} {
    298             set var "portname"
    299         } elseif {$req_var == "version"} {
    300             set var "portversion"
    301         } else {
    302             set var $req_var
    303         }
    304 
    305         if {$var == "master_sites"} {
     297
     298        if {$req_var == "master_sites"} {
    306299            if {${fetch.type} != "standard"} {
    307                 ui_info "OK: $var not required for fetch.type ${fetch.type}"
     300                ui_info "OK: $req_var not required for fetch.type ${fetch.type}"
    308301                continue
    309302            }
    310303            if {[llength ${distfiles}] == 0} {
    311                 ui_info "OK: $var not required when there are no distfiles"
     304                ui_info "OK: $req_var not required when there are no distfiles"
    312305                continue
    313306            }
    314307        }
    315308
    316         if {![info exists $var]} {
     309        if {![info exists $req_var]} {
    317310            ui_error "Missing required variable: $req_var"
    318311            incr errors
     
    323316
    324317    foreach opt_var $lint_optional {
    325         if {$opt_var == "epoch"} {
    326             set var "portepoch"
    327         } elseif {$opt_var == "revision"} {
    328             set var "portrevision"
    329         } else {
    330             set var $opt_var
    331         }
    332         if {[info exists $var]} {
     318        if {[info exists $opt_var]} {
    333319            # TODO: check whether it was seen (or default)
    334320            ui_info "OK: Found optional variable: $opt_var"
     
    357343    }
    358344
    359     if {![string is integer -strict $portepoch]} {
    360         ui_error "Port epoch is not numeric:  $portepoch"
    361         incr errors
    362     }
    363     if {![string is integer -strict $portrevision]} {
    364         ui_error "Port revision is not numeric: $portrevision"
     345    if {![string is integer -strict $epoch]} {
     346        ui_error "Port epoch is not numeric:  $epoch"
     347        incr errors
     348    }
     349    if {![string is integer -strict $revision]} {
     350        ui_error "Port revision is not numeric: $revision"
    365351        incr errors
    366352    }
     
    427413
    428414    set all_depends {}
     415    if {[info exists depends_fetch]} { eval "lappend all_depends $depends_fetch" }
     416    if {[info exists depends_extract]} { eval "lappend all_depends $depends_extract" }
    429417    if {[info exists depends_lib]} { eval "lappend all_depends $depends_lib" }
    430418    if {[info exists depends_build]} { eval "lappend all_depends $depends_build" }
     
    473461        ui_info "OK: Portfile parent directory matches primary category"
    474462    }
    475     if {$portdir != $portname} {
    476         ui_error "Portfile directory $portdir does not match port name $portname"
     463    if {$portdir != $name} {
     464        ui_error "Portfile directory $portdir does not match port name $name"
    477465        incr errors
    478466    } else {
     
    489477    }
    490478
     479    # Check for use of deprecated options
     480    set deprecated_options_name [get_deprecated_options]
     481    global $deprecated_options_name
     482    foreach option [array names $deprecated_options_name] {
     483        set newoption [lindex [set ${deprecated_options_name}($option)] 0]
     484        set refcount  [lindex [set ${deprecated_options_name}($option)] 1]
     485
     486        if {$refcount > 0} {
     487            if {$newoption != ""} {
     488                ui_warn "Using deprecated option '$option', superseded by '$newoption'"
     489            } else {
     490                ui_warn "Using deprecated option '$option'"
     491            }
     492            incr warnings
     493        }
     494    }
     495
    491496    ### TODO: more checks to Tcl variables/sections
    492497
    493     ui_debug "Name: $portname"
    494     ui_debug "Epoch: $portepoch"
    495     ui_debug "Version: $portversion"
    496     ui_debug "Revision: $portrevision"
     498    ui_debug "Name: $name"
     499    ui_debug "Epoch: $epoch"
     500    ui_debug "Version: $version"
     501    ui_debug "Revision: $revision"
    497502    ui_debug "Arch: $portarch"
    498503    ###################################################################
  • branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl

    r51069 r52218  
    4747
    4848# define options
    49 options livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
     49options livecheck.url livecheck.type livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
    5050
    5151# defaults
    5252default livecheck.url {$homepage}
    5353default livecheck.check default
     54default livecheck.type default
    5455default livecheck.md5 ""
    5556default livecheck.regex ""
     
    5859default livecheck.version {$version}
    5960
     61# Deprecation
     62option_deprecate livecheck.check livecheck.type
     63
    6064proc portlivecheck::livecheck_main {args} {
    61     global livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
     65    global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
    6266    global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert
    63     global homepage portname portpath workpath
     67    global homepage portpath workpath
    6468    global master_sites name distfiles
    6569
     
    99103    set available_types [regsub -all {\.tcl} [join $available_types |] {}]
    100104
    101     if {${livecheck.check} eq "default"} {
     105    if {${livecheck.type} eq "default"} {
    102106        # Determine the default type from the mirror.
    103107        if {$has_master_sites} {
     
    107111                        set livecheck.name ${subdir}
    108112                    }
    109                     set livecheck.check ${site}
     113                    set livecheck.type ${site}
    110114
    111115                    break
     
    114118        }
    115119        # If the default type cannot be determined from the mirror, use the
    116         # fallback type (which is a symlink to one of the available types).
    117         if {${livecheck.check} eq "default"} {
    118             set livecheck.check "fallback"
    119         }
    120         # If livecheck.name is still "default", set it to $name.
    121         if {${livecheck.name} eq "default"} {
    122             set livecheck.name $name
    123         }
    124 
    125         # Load the defaults from _resources/port1.0/livecheck/${livecheck.check}.tcl.
    126         set defaults_file "$types_dir/${livecheck.check}.tcl"
     120        # fallback.
     121        if {${livecheck.type} eq "default"} {
     122            set livecheck.type "fallback"
     123        }
     124    }
     125    # If livecheck.name is still "default", set it to $name.
     126    if {${livecheck.name} eq "default"} {
     127        set livecheck.name $name
     128    }
     129    if {[lsearch -exact [split $available_types "|"] ${livecheck.type}] != -1} {
     130        # Load the defaults from _resources/port1.0/livecheck/${livecheck.type}.tcl.
     131        set defaults_file "$types_dir/${livecheck.type}.tcl"
    127132        ui_debug "Loading the defaults from '$defaults_file'"
    128133        if {[catch {source $defaults_file} result]} {
     
    134139    set livecheck.url [join ${livecheck.url}]
    135140
    136     switch ${livecheck.check} {
     141    switch ${livecheck.type} {
    137142        "regex" -
    138143        "regexm" {
     
    140145            ui_debug "Fetching ${livecheck.url}"
    141146            if {[catch {eval curl fetch $fetch_options {${livecheck.url}} $tempfile} error]} {
    142                 ui_error "cannot check if $portname was updated ($error)"
     147                ui_error "cannot check if $name was updated ($error)"
    143148                set updated -1
    144149            } else {
     
    148153                set the_re [join ${livecheck.regex}]
    149154                ui_debug "The regex is \"$the_re\""
    150                 if {${livecheck.check} == "regexm"} {
     155                if {${livecheck.type} == "regexm"} {
    151156                    set data [read $chan]
    152157                    if {[regexp $the_re $data matched updated_version]} {
     
    182187                close $chan
    183188                if {$updated < 0} {
    184                     ui_error "cannot check if $portname was updated (regex didn't match)"
     189                    ui_error "cannot check if $name was updated (regex didn't match)"
    185190                }
    186191            }
     
    189194            ui_debug "Fetching ${livecheck.url}"
    190195            if {[catch {eval curl fetch $fetch_options {${livecheck.url}} $tempfile} error]} {
    191                 ui_error "cannot check if $portname was updated ($error)"
     196                ui_error "cannot check if $name was updated ($error)"
    192197                set updated -1
    193198            } else {
     
    203208            set port_moddate [file mtime ${portpath}/Portfile]
    204209            if {[catch {set updated [curl isnewer ${livecheck.url} $port_moddate]} error]} {
    205                 ui_error "cannot check if $portname was updated ($error)"
     210                ui_error "cannot check if $name was updated ($error)"
    206211                set updated -1
    207212            } else {
     
    214219        }
    215220        default {
    216             ui_error "unknown livecheck.check ${livecheck.check}"
     221            ui_error "unknown livecheck.type ${livecheck.type}"
    217222        }
    218223    }
     
    220225    file delete -force $tempfile
    221226
    222     if {${livecheck.check} != "none"} {
     227    if {${livecheck.type} != "none"} {
    223228        if {$updated > 0} {
    224             ui_msg "$portname seems to have been updated (port version: ${livecheck.version}, new version: $updated_version)"
     229            ui_msg "$name seems to have been updated (port version: ${livecheck.version}, new version: $updated_version)"
    225230        } elseif {$updated == 0} {
    226             ui_info "$portname seems to be up to date"
     231            ui_info "$name seems to be up to date"
    227232        }
    228233    }
  • branches/gsoc09-logging/base/src/port1.0/portmain.tcl

    r50801 r52218  
    4646# define options
    4747options prefix macportsuser name version revision epoch categories maintainers
    48 options long_description description homepage license
     48options long_description description homepage license provides conflicts
    4949options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target
    5050options universal_variant os.universal_supported
    5151
    5252# Export options via PortInfo
    53 options_export name version revision epoch categories maintainers platforms description long_description homepage license
     53options_export name version revision epoch categories maintainers platforms description long_description homepage license provides conflicts
    5454
    5555# Assign option procedure to default_variants
     
    6262default applications_dir /Applications/MacPorts
    6363default frameworks_dir {${prefix}/Library/Frameworks}
     64default developer_dir {/Developer}
    6465default destdir destroot
    6566default destpath {${workpath}/${destdir}}
     
    7071default epoch 0
    7172default license unknown
    72 default distname {${portname}-${portversion}}
     73default distname {${name}-${version}}
    7374default worksrcdir {$distname}
    7475default filespath {[file join $portpath $filesdir]}
     
    7980default install.user {${portutil::autoconf::install_user}}
    8081default install.group {${portutil::autoconf::install_group}}
    81 
    82 # Compatibility namespace
    83 default portname {$name}
    84 default portversion {$version}
    85 default portrevision {$revision}
    86 default portepoch {$epoch}
    8782
    8883# Platform Settings
     
    135130}
    136131
     132# Record initial euid/egid
     133set euid [geteuid]
     134set egid [getegid]
     135
    137136proc portmain::main {args} {
    138137    return 0
  • branches/gsoc09-logging/base/src/port1.0/portmirror.tcl

    r50562 r52218  
    5353
    5454proc portmirror::mirror_main {args} {
    55     global fetch.type portname mirror_filemap ports_mirror_new portdbpath
     55    global fetch.type name mirror_filemap ports_mirror_new portdbpath
    5656
    5757    set mirror_filemap_path [file join $portdbpath distfiles_mirror.db]
  • branches/gsoc09-logging/base/src/port1.0/portpatch.tcl

    r50562 r52218  
    5050default patch.asroot no
    5151default patch.dir {${worksrcpath}}
    52 default patch.cmd patch
     52default patch.cmd {[findBinary patch $portutil::autoconf::patch_path]}
    5353default patch.pre_args -p0
    5454
     
    5858    # First make sure that patchfiles exists and isn't stubbed out.
    5959    if {![exists patchfiles]} {
    60     return 0
     60        return 0
    6161    }
    6262
    63     ui_msg "$UI_PREFIX [format [msgcat::mc "Applying patches to %s"] [option portname]]"
    64 
    65     # start gsoc08-privileges
    66     if { [tbool patch.asroot] } {
    67     # if port is marked as needing root
    68         elevateToRoot "patch"
    69     }
    70     # end gsoc08-privileges
     63    ui_msg "$UI_PREFIX [format [msgcat::mc "Applying patches to %s"] [option name]]"
    7164
    7265    foreach patch [option patchfiles] {
    73     set patch_file [getdistname $patch]
    74     if {[file exists [option filespath]/$patch_file]} {
    75         lappend patchlist [option filespath]/$patch_file
    76     } elseif {[file exists [option distpath]/$patch_file]} {
    77         lappend patchlist [option distpath]/$patch_file
    78     } else {
    79         return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
    80     }
     66        set patch_file [getdistname $patch]
     67        if {[file exists [option filespath]/$patch_file]} {
     68            lappend patchlist [option filespath]/$patch_file
     69        } elseif {[file exists [option distpath]/$patch_file]} {
     70            lappend patchlist [option distpath]/$patch_file
     71        } else {
     72            return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
     73        }
    8174    }
    8275    if {![info exists patchlist]} {
    83     return -code error [msgcat::mc "Patch files missing"]
     76        return -code error [msgcat::mc "Patch files missing"]
    8477    }
    8578    _cd [option worksrcpath]
     79    set gzcat "[findBinary gzip $portutil::autoconf::gzip_path] -dc"
     80    set bzcat "[findBinary bzip2 $portutil::autoconf::bzip2_path] -dc"
    8681    foreach patch $patchlist {
    87     ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
    88     if {[option os.platform] == "linux"} {
    89         set gzcat "zcat"
    90     } else {
    91         set gzcat "gzcat"
    92     }
    93     switch -glob -- [file tail $patch] {
    94         *.Z -
    95         *.gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
    96         *.bz2 {command_exec patch "bzcat \"$patch\" | (" ")"}
    97         default {command_exec patch "" "< '$patch'"}
    98     }
     82        ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
     83        switch -- [file extension $patch] {
     84            .Z -
     85            .gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
     86            .bz2 {command_exec patch "$bzcat \"$patch\" | (" ")"}
     87            default {command_exec patch "" "< '$patch'"}
     88        }
    9989    }
    10090    return 0
  • branches/gsoc09-logging/base/src/port1.0/portstartupitem.tcl

    r49087 r52218  
    7575
    7676proc portstartupitem::startupitem_create_rcng {args} {
    77     global prefix destroot portname os.platform
     77    global prefix destroot name os.platform
    7878    global startupitem.name startupitem.requires
    7979    global startupitem.start startupitem.stop startupitem.restart
     
    121121
    122122proc portstartupitem::startupitem_create_darwin_systemstarter {args} {
    123     global UI_PREFIX prefix destroot destroot.keepdirs  portname os.platform
     123    global UI_PREFIX prefix destroot destroot.keepdirs name os.platform
    124124    global startupitem.name startupitem.requires startupitem.init
    125125    global startupitem.start startupitem.stop startupitem.restart startupitem.executable
     
    178178    } else {
    179179        if { ![llength ${startupitem.start} ] } {
    180             set startupitem.start [list "sh ${scriptdir}/${portname}.sh start"]
     180            set startupitem.start [list "sh ${scriptdir}/${name}.sh start"]
    181181        }
    182182        if { ![llength ${startupitem.stop} ] } {
    183             set startupitem.stop [list "sh ${scriptdir}/${portname}.sh stop"]
     183            set startupitem.stop [list "sh ${scriptdir}/${name}.sh stop"]
    184184        }
    185185    }
     
    378378    ui_msg "###########################################################"
    379379    ui_msg "# A startup item has been generated that will aid in"
    380     ui_msg "# starting ${portname} with SystemStarter. It is disabled"
     380    ui_msg "# starting ${name} with SystemStarter. It is disabled"
    381381    ui_msg "# by default. Add the following line to /etc/hostconfig"
    382382    ui_msg "# or ${prefix}/etc/rc.conf to start it at startup:"
     
    387387
    388388proc portstartupitem::startupitem_create_darwin_launchd {args} {
    389     global UI_PREFIX prefix destroot destroot.keepdirs portname os.platform
     389    global UI_PREFIX prefix destroot destroot.keepdirs name os.platform
    390390    global startupitem.name startupitem.uniquename startupitem.plist startupitem.location
    391391    global startupitem.init startupitem.start startupitem.stop startupitem.restart startupitem.executable
     
    426426
    427427        if { ![llength ${startupitem.start}] } {
    428             set startupitem.start [list "sh ${scriptdir}/${portname}.sh start"]
     428            set startupitem.start [list "sh ${scriptdir}/${name}.sh start"]
    429429        }
    430430        if { ![llength ${startupitem.stop}] } {
    431             set startupitem.stop [list "sh ${scriptdir}/${portname}.sh stop"]
     431            set startupitem.stop [list "sh ${scriptdir}/${name}.sh stop"]
    432432        }
    433433        if { ![llength ${startupitem.restart}] } {
     
    604604    ui_msg "###########################################################"
    605605    ui_msg "# A startup item has been generated that will aid in"
    606     ui_msg "# starting ${portname} with launchd. It is disabled"
     606    ui_msg "# starting ${name} with launchd. It is disabled"
    607607    ui_msg "# by default. Execute the following command to start it,"
    608608    ui_msg "# and to cause it to launch at startup:"
  • branches/gsoc09-logging/base/src/port1.0/portsubmit.tcl

    r50562 r52218  
    5656
    5757proc portsubmit::submit_main {args} {
    58     global mp_remote_submit_url portname portversion portverbose prefix UI_PREFIX workpath portpath
     58    global mp_remote_submit_url name version portverbose prefix UI_PREFIX workpath portpath
    5959
    6060    set submiturl $mp_remote_submit_url
     
    6969
    7070    # Create portpkg.xar in the work directory
    71     set pkgpath "${workpath}/${portname}.portpkg"
     71    set pkgpath "${workpath}/${name}.portpkg"
    7272
    7373    # TODO: If a private key was provided, create a signed digest of the submission
     
    8484
    8585    if {[tbool portverbose]} {
    86         ui_msg "Submitting portpkg $pkgpath for $portname to $submiturl"
     86        ui_msg "Submitting portpkg $pkgpath for $name to $submiturl"
    8787    }
    8888
     
    9090    ui_debug $cmd
    9191    if {[system $cmd] != ""} {
    92         return -code error [format [msgcat::mc "Failure during submit of port %s"] $portname]
     92        return -code error [format [msgcat::mc "Failure during submit of port %s"] $name]
    9393    }
    9494
     
    109109    if {[info exists result(STATUS)]} {
    110110        if { $result(STATUS) == 0 } {
    111             ui_msg "Submitted portpkg for $portname"
     111            ui_msg "Submitted portpkg for $name"
    112112            if {[info exists result(DOWNLOAD_URL)]} {
    113113                ui_msg "    download URL => $result(DOWNLOAD_URL)"
     
    117117            }
    118118        } else {
    119             return -code error [format [msgcat::mc "Status %d reported during submit of port %s"] $result(STATUS) $portname]
     119            return -code error [format [msgcat::mc "Status %d reported during submit of port %s"] $result(STATUS) $name]
    120120        }
    121121    } else {
    122         return -code error [format [msgcat::mc "Status not received during submit of port %s"] $portname]
     122        return -code error [format [msgcat::mc "Status not received during submit of port %s"] $name]
    123123    }
    124124
     
    137137
    138138    if {[system $cmd] != ""} {
    139     return -code error [format [msgcat::mc "Failed to archive port : %s"] $portname]
     139    return -code error [format [msgcat::mc "Failed to archive port : %s"] $name]
    140140    }
    141141
     
    153153    }
    154154    if {$portsource == ""} {
    155         ui_msg "$UI_PREFIX Submitting $portname-$portversion"
     155        ui_msg "$UI_PREFIX Submitting $name-$version"
    156156        puts -nonewline "URL: "
    157157        flush stdout
     
    159159    }
    160160
    161     ui_msg "$UI_PREFIX Submitting $portname-$portversion to $portsource"
     161    ui_msg "$UI_PREFIX Submitting $name-$version to $portsource"
    162162
    163163    puts -nonewline "Username: "
     
    171171    exec stty echo
    172172
    173     set vars {portname portversion maintainers categories description \
     173    set vars {name version maintainers categories description \
    174174        long_description master_sites}
    175175    eval "global $vars"
     
    182182    append cmd "--url [regsub -- {^mports} $portsource {http}]/cgi-bin/portsubmit.cgi "
    183183    append cmd "--output ${workpath}/.portsubmit.out "
    184     append cmd "-F name=${portname} "
    185     append cmd "-F version=${portversion} "
     184    append cmd "-F name=${name} "
     185    append cmd "-F version=${version} "
    186186    append cmd "-F base_rev=${base_rev} "
    187187    append cmd "-F md5=[md5 file ${workpath}/Portfile.tar.gz] "
     
    197197    ui_debug $cmd
    198198    if {[system $cmd] != ""} {
    199     return -code error [format [msgcat::mc "Failed to submit port : %s"] $portname]
     199    return -code error [format [msgcat::mc "Failed to submit port : %s"] $name]
    200200    }
    201201
     
    218218        set fd [open ".mports_source" w]
    219219        puts $fd "source: $portsource"
    220         puts $fd "port: $portname"
    221         puts $fd "version: $portversion"
     220        puts $fd "port: $name"
     221        puts $fd "version: $version"
    222222        puts $fd "revision: $result(revision)"
    223223        close $fd
    224224
    225         ui_msg "$portname-$portversion submitted successfully."
     225        ui_msg "$name-$version submitted successfully."
    226226        ui_msg "New revision: $result(revision)"
    227227    } elseif {[info exists result(ERROR)]} {
     
    233233        file mkdir $tmpdir/new
    234234        file mkdir $tmpdir/old
    235         set worker [mport_open $portsource/files/$portname/$portversion/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
     235        set worker [mport_open $portsource/files/$name/$version/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
    236236        if {$base_rev != ""} {
    237             set worker2 [mport_open $portsource/files/$portname/$portversion/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
    238             catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$portname-$portversion/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
     237            set worker2 [mport_open $portsource/files/$name/$version/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
     238            catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$name-$version/Portfile $tmpdir/new/$name-$version/Portfile > $tmpdir/Portfile"}
    239239            file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
    240240            mport_close $worker2
    241241        } else {
    242             catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
     242            catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$name-$version/Portfile > $tmpdir/Portfile"}
    243243            file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
    244244        }
     
    248248        set fd [open [file join "$portpath" ".mports_source"] w]
    249249        puts $fd "source: $portsource"
    250         puts $fd "port: $portname"
    251         puts $fd "version: $portversion"
     250        puts $fd "port: $name"
     251        puts $fd "version: $version"
    252252        puts $fd "revision: $result(revision)"
    253253        close $fd
    254254
    255255        ui_error "A newer revision of this port has already been submitted."
    256         ui_error "Portfile: $portname-$portversion"
     256        ui_error "Portfile: $name-$version"
    257257        ui_error "Base revision: $base_rev"
    258258        ui_error "Current revision: $result(revision)"
  • branches/gsoc09-logging/base/src/port1.0/porttest.tcl

    r50562 r52218  
    2727
    2828proc porttest::test_start {args} {
    29     global UI_PREFIX portname
    30     ui_msg "$UI_PREFIX [format [msgcat::mc "Testing %s"] ${portname}]"
     29    global UI_PREFIX name
     30    ui_msg "$UI_PREFIX [format [msgcat::mc "Testing %s"] ${name}]"
    3131}
    3232
    3333proc porttest::test_main {args} {
    34     global portname test.run
     34    global name test.run
    3535    if {[tbool test.run]} {
    3636        command_exec test
    3737    } else {
    38     return -code error [format [msgcat::mc "%s has no tests turned on. see 'test.run' in portfile(7)"] $portname]
     38    return -code error [format [msgcat::mc "%s has no tests turned on. see 'test.run' in portfile(7)"] $name]
    3939    }
    4040    return 0
  • branches/gsoc09-logging/base/src/port1.0/portutil.tcl

    r51384 r52218  
    5555# This is an accessor for Portfile options.  Targets may use
    5656# this in the same style as the standard Tcl "set" procedure.
    57 #   name  - the name of the option to read or write
     57#   option  - the name of the option to read or write
     58#       not called 'name' because this would fail if its value was 'name'...
    5859#   value - an optional value to assign to the option
    5960
    60 proc option {name args} {
     61proc option {option args} {
    6162    # XXX: right now we just transparently use globals
    6263    # eventually this will need to bridge the options between
    6364    # the Portfile's interpreter and the target's interpreters.
    64     global $name
     65    global $option
    6566    if {[llength $args] > 0} {
    66         ui_debug "setting option $name to $args"
    67         set $name [lindex $args 0]
    68     }
    69     return [set $name]
     67        ui_debug "setting option $option to $args"
     68        set $option [lindex $args 0]
     69    }
     70    return [set $option]
    7071}
    7172
     
    7374# This is an accessor for Portfile options.  Targets may use
    7475# this procedure to test for the existence of a Portfile option.
    75 #   name - the name of the option to test for existence
    76 
    77 proc exists {name} {
     76#   option - the name of the option to test for existence
     77
     78proc exists {option} {
    7879    # XXX: right now we just transparently use globals
    7980    # eventually this will need to bridge the options between
    8081    # the Portfile's interpreter and the target's interpreters.
    81     global $name
    82     return [info exists $name]
     82    global $option
     83    return [info exists $option]
    8384}
    8485
     
    197198# @param action read/set
    198199# @param value ignored
    199 proc warn_deprecated_option {option action {value ""}} {
    200     global portname $option deprecated_options
    201     set newoption $deprecated_options($option)
     200proc handle_deprecated_option {option action {value ""}} {
     201    global name $option deprecated_options
     202    set newoption [lindex $deprecated_options($option) 0]
     203    set refcount  [lindex $deprecated_options($option) 1]
    202204    global $newoption
    203205
    204206    if {$newoption == ""} {
    205         ui_warn "Port $portname using deprecated option \"$option\"."
     207        ui_warn "Port $name using deprecated option \"$option\"."
    206208        return
    207209    }
    208210
    209     ui_warn "Port $portname using deprecated option \"$option\", superseded by \"$newoption\"."
     211    # Increment reference counter
     212    lset deprecated_options($option) 1 [expr $refcount + 1]
     213
    210214    if {$action != "read"} {
    211215        $newoption [set $option]
     
    216220
    217221##
    218 # Causes a warning to be printed when an option is set or accessed
     222# Get the name of the array containing the deprecated options
     223# Thin layer avoiding to share global variables without notice
     224proc get_deprecated_options {} {
     225    return "deprecated_options"
     226}
     227
     228##
     229# Mark an option as deprecate
     230# If it is set or accessed, it will be mapped it to the new option
    219231#
    220232# @param option name of the option
     
    223235    global deprecated_options
    224236    # If a new option is specified, default the option to $newoption
    225     set deprecated_options($option) $newoption
    226     # Register a proc for printing a warning
    227     option_proc $option warn_deprecated_option
     237    set deprecated_options($option) [list $newoption 0]
     238    # Create a normal option for compatibility
     239    options $option
     240    # Register a proc for handling the deprecation
     241    option_proc $option handle_deprecated_option
    228242}
    229243
     
    816830# Provides "sed in place" functionality
    817831proc reinplace {args}  {
    818     global euid macportsuser
    819832
    820833    set extended 0
     
    11601173            append lipoSources "-arch ${arch} ${workpath}/${arch}/${file} "
    11611174        }
    1162         system "lipo ${lipoSources}-create -output ${file}"
     1175        system "[findBinary lipo $portutil::autoconf::lipo_path] ${lipoSources}-create -output ${file}"
    11631176    }
    11641177}
     
    11951208
    11961209proc target_run {ditem} {
    1197     global target_state_fd portname workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped errorisprivileges
     1210    global target_state_fd workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped
     1211    set portname [option name]
    11981212    set result 0
    11991213    set skipped 0
     
    12051219
    12061220    if {$procedure != ""} {
    1207         set name [ditem_key $ditem name]
     1221        set targetname [ditem_key $ditem name]
     1222        if { [tbool ${targetname}.asroot] } {
     1223            elevateToRoot $targetname
     1224        }
    12081225
    12091226        if {[ditem_contains $ditem init]} {
    1210             set result [catch {[ditem_key $ditem init] $name} errstr]
     1227            set result [catch {[ditem_key $ditem init] $targetname} errstr]
    12111228        }
    12121229
     
    12151232            # check if the step was already done (as mentioned in the state file)
    12161233            if {[ditem_key $ditem state] != "no"
    1217                     && [check_statefile target $name $target_state_fd]} {
    1218                 ui_debug "Skipping completed $name ($portname)"
     1234                    && [check_statefile target $targetname $target_state_fd]} {
     1235                ui_debug "Skipping completed $targetname ($portname)"
    12191236                set skipped 1
    12201237            }
     
    12241241                # only one message per portname
    12251242                if {$portname != $ports_dry_last_skipped} {
    1226                     ui_msg "For $portname: skipping $name (dry run)"
     1243                    ui_msg "For $portname: skipping $targetname (dry run)"
    12271244                    set ports_dry_last_skipped $portname
    12281245                } else {
    1229                     ui_info "    .. and skipping $name"
     1246                    ui_info "    .. and skipping $targetname"
    12301247                }
    12311248                set skipped 1
     
    12381255                # Execute pre-run procedure
    12391256                if {[ditem_contains $ditem prerun]} {
    1240                     set result [catch {[ditem_key $ditem prerun] $name} errstr]
     1257                    set result [catch {[ditem_key $ditem prerun] $targetname} errstr]
    12411258                }
    12421259
     
    12581275
    12591276                    # collect deps
    1260 
    1261                     # Don't check dependencies for extract (they're not honored
    1262                     # anyway). This avoids warnings about bzip2.
    1263                     if {$target != "extract"} {
    1264                         set depends {}
    1265                         set deptypes {}
    1266 
    1267                         # Determine deptypes to look for based on target
    1268                         switch $target {
    1269                             configure   -
    1270                             build       { set deptypes "depends_lib depends_build" }
    1271 
    1272                             test        -
    1273                             destroot    -
    1274                             install     -
    1275                             archive     -
    1276                             dmg         -
    1277                             pkg         -
    1278                             portpkg     -
    1279                             mpkg        -
    1280                             rpm         -
    1281                             srpm        -
    1282                             dpkg        -
    1283                             mdmg        -
    1284                             activate    -
    1285                             ""          { set deptypes "depends_lib depends_build depends_run" }
     1277                    set depends {}
     1278                    set deptypes {}
     1279
     1280                    # Determine deptypes to look for based on target
     1281                    switch $target {
     1282                        fetch       -
     1283                        checksum    { set deptypes "depends_fetch" }
     1284                        extract     -
     1285                        patch       { set deptypes "depends_fetch depends_extract" }
     1286                        configure   -
     1287                        build       { set deptypes "depends_fetch depends_extract depends_lib depends_build" }
     1288
     1289                        test        -
     1290                        destroot    -
     1291                        install     -
     1292                        archive     -
     1293                        dmg         -
     1294                        pkg         -
     1295                        portpkg     -
     1296                        mpkg        -
     1297                        rpm         -
     1298                        srpm        -
     1299                        dpkg        -
     1300                        mdmg        -
     1301                        activate    -
     1302                        ""          { set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run" }
     1303                    }
     1304
     1305                    # Gather the dependencies for deptypes
     1306                    foreach deptype $deptypes {
     1307                        # Add to the list of dependencies if the option exists and isn't empty.
     1308                        if {[info exists PortInfo($deptype)] && $PortInfo($deptype) != ""} {
     1309                            set depends [concat $depends $PortInfo($deptype)]
    12861310                        }
    1287 
    1288                         # Gather the dependencies for deptypes
    1289                         foreach deptype $deptypes {
    1290                             # Add to the list of dependencies if the option exists and isn't empty.
    1291                             if {[info exists PortInfo($deptype)] && $PortInfo($deptype) != ""} {
    1292                                 set depends [concat $depends $PortInfo($deptype)]
    1293                             }
    1294                         }
    1295 
    1296                         # Dependencies are in the form verb:[param:]port
    1297                         set depsPorts {}
    1298                         foreach depspec $depends {
    1299                             # grab the portname portion of the depspec
    1300                             set dep_portname [lindex [split $depspec :] end]
    1301                             lappend depsPorts $dep_portname
    1302                         }
    1303 
    1304                         # always allow gzip in destroot as it is used to compress man pages
    1305                         if {$target == "destroot"} {
    1306                             lappend depsPorts "gzip"
    1307                         }
    1308 
    1309                         set portlist $depsPorts
    1310                         foreach depName $depsPorts {
    1311                             set portlist [recursive_collect_deps $depName $deptypes $portlist]
    1312                         }
    1313 
    1314                         if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
    13151311                    }
     1312
     1313                    # Dependencies are in the form verb:[param:]port
     1314                    set depsPorts {}
     1315                    foreach depspec $depends {
     1316                        # grab the portname portion of the depspec
     1317                        set dep_portname [lindex [split $depspec :] end]
     1318                        lappend depsPorts $dep_portname
     1319                    }
     1320
     1321                    set portlist $depsPorts
     1322                    foreach depName $depsPorts {
     1323                        set portlist [recursive_collect_deps $depName $deptypes $portlist]
     1324                    }
     1325
     1326                    if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
    13161327                }
    13171328
     
    13191330                    foreach pre [ditem_key $ditem pre] {
    13201331                        ui_debug "Executing $pre"
    1321                         set result [catch {$pre $name} errstr]
     1332                        set result [catch {$pre $targetname} errstr]
    13221333                        if {$result != 0} { break }
    13231334                    }
     
    13251336
    13261337                if {$result == 0} {
    1327                 ui_debug "Executing $name ($portname)"
    1328                 set result [catch {$procedure $name} errstr]
     1338                ui_debug "Executing $targetname ($portname)"
     1339                set result [catch {$procedure $targetname} errstr]
    13291340                }
    13301341
     
    13321343                    foreach post [ditem_key $ditem post] {
    13331344                        ui_debug "Executing $post"
    1334                         set result [catch {$post $name} errstr]
     1345                        set result [catch {$post $targetname} errstr]
    13351346                        if {$result != 0} { break }
    13361347                    }
     
    13401351                    set postrun [ditem_key $ditem postrun]
    13411352                    ui_debug "Executing $postrun"
    1342                     set result [catch {$postrun $name} errstr]
     1353                    set result [catch {$postrun $targetname} errstr]
    13431354                }
    13441355
     
    13651376          && [ditem_key $ditem runtype] != "always"
    13661377          && [ditem_key $ditem state] != "no"} {
    1367             write_statefile target $name $target_state_fd
     1378            write_statefile target $targetname $target_state_fd
    13681379            }
    13691380        } else {
    1370             if {$errorisprivileges != "yes"} {
    1371                 global errorInfo
    1372                 ui_error "Target $name returned: $errstr"
    1373                 ui_debug "Backtrace: $errorInfo"
    1374             } else {
    1375                 ui_msg "Target $name returned: $errstr"
    1376             }
     1381            global errorInfo
     1382            ui_error "Target $targetname returned: $errstr"
     1383            ui_debug "Backtrace: $errorInfo"
    13771384            set result 1
    13781385        }
    13791386
    13801387    } else {
    1381         ui_info "Warning: $name does not have a registered procedure"
     1388        ui_info "Warning: $targetname does not have a registered procedure"
    13821389        set result 1
    13831390    }
     
    14241431
    14251432proc eval_targets {target} {
    1426     global targets target_state_fd portname portversion portrevision portvariants ports_dryrun user_options errorisprivileges
     1433    global targets target_state_fd name version revision portvariants ports_dryrun user_options
    14271434    set dlist $targets
    1428     set errorisprivileges "no"
    14291435
    14301436    # the statefile will likely be autocleaned away after install,
    14311437    # so special-case ignore already-completed install and activate
    1432     if {[registry_exists $portname $portversion $portrevision $portvariants]} {
     1438    if {[registry_exists $name $version $revision $portvariants]} {
    14331439        if {$target == "install"} {
    1434             ui_debug "Skipping $target ($portname) since this port is already installed"
     1440            ui_debug "Skipping $target ($name) since this port is already installed"
    14351441            return 0
    14361442        } elseif {$target == "activate"} {
    1437             set regref [registry_open $portname $portversion $portrevision $portvariants]
     1443            set regref [registry_open $name $version $revision $portvariants]
    14381444            if {[registry_prop_retr $regref active] != 0} {
    14391445                # Something to close the registry entry may be called here, if it existed.
    1440                 ui_debug "Skipping $target ($portname @${portversion}_${portrevision}${portvariants}) since this port is already active"
     1446                ui_debug "Skipping $target ($name @${version}_${revision}${portvariants}) since this port is already active"
    14411447            } else {
    14421448                # do the activate here since target_run doesn't know how to selectively ignore the preceding steps
    14431449                if {[info exists ports_dryrun] && $ports_dryrun == "yes"} {
    1444                     ui_msg "For $portname: skipping $target (dry run)"
     1450                    ui_msg "For $name: skipping $target (dry run)"
    14451451                } else {
    1446                     registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
     1452                    registry_activate $name ${version}_${revision}${portvariants} [array get user_options]
    14471453                }
    14481454            }
     
    14681474    if {[llength $dlist] > 0} {
    14691475        # somebody broke!
    1470         set errstring "Warning: the following items did not execute (for $portname):"
     1476        set errstring "Warning: the following items did not execute (for $name):"
    14711477        foreach ditem $dlist {
    14721478            append errstring " [ditem_key $ditem name]"
     
    14781484    }
    14791485
    1480     # start gsoc08-privileges
    1481     if { $result == 1 && $errorisprivileges == "yes" } {
    1482         set result 2
    1483     }
    1484     # end gsoc08-privileges
    1485 
    14861486    return $result
    14871487}
     
    14901490# open file to store name of completed targets
    14911491proc open_statefile {args} {
    1492     global workpath worksymlink place_worksymlink portname portpath ports_ignore_older
     1492    global workpath worksymlink place_worksymlink name portpath ports_ignore_older
    14931493    global altprefix usealtworkpath env applications_dir portbuildpath distpath
    14941494
    14951495    # start gsoc08-privileges
    1496 
    1497     # de-escalate privileges - only run if MacPorts was started with sudo
    1498     dropPrivileges
    1499 
    15001496    if { ![file exists $workpath] } {
    15011497        if {[catch {set result [file mkdir $workpath]} result]} {
     
    15141510        if { $userid !=0 } {
    15151511            ui_msg "MacPorts running without privileges.\
    1516                     You may be prompted for your sudo password in order to complete certain actions (eg install)."
     1512                    You may be unable to complete certain actions (eg install)."
    15171513        }
    15181514
     
    15711567        file mkdir $workpath
    15721568    }
     1569
    15731570    # flock Portfile
    1574     set statefile [file join $workpath .macports.${portname}.state]
     1571    set statefile [file join $workpath .macports.${name}.state]
    15751572    if {[file exists $statefile]} {
    15761573        if {![file writable $statefile]} {
     
    15841581        }
    15851582    }
     1583    chownAsRoot $workpath
    15861584
    15871585    # Create a symlink to the workpath for port authors
     
    15901588        ln -sf $workpath $worksymlink
    15911589    }
     1590    # de-escalate privileges - only run if MacPorts was started with sudo
     1591    dropPrivileges
    15921592
    15931593    set fd [open $statefile a+]
     
    15951595        if {"$result" == "EAGAIN"} {
    15961596            ui_msg "Waiting for lock on $statefile"
    1597     } elseif {"$result" == "EOPNOTSUPP"} {
    1598         # Locking not supported, just return
    1599         return $fd
     1597        } elseif {"$result" == "EOPNOTSUPP"} {
     1598            # Locking not supported, just return
     1599            return $fd
    16001600        } else {
    16011601            return -code error "$result obtaining lock on $statefile"
     
    18691869        ui_debug "using xmkmf, so not adding the default universal variant"
    18701870        return no
    1871     } elseif {[exists use_configure] && ![option use_configure] && ![exists xcode.universal.settings]} {
     1871    } elseif {[exists use_configure] && ![option use_configure] && ![exists xcode.project]} {
    18721872        # Allow +universal if port uses xcode portgroup.
    18731873        ui_debug "not using configure, so not adding the default universal variant"
     
    20692069
    20702070    if {${os.platform} eq "darwin"} {
    2071         exec dscl . -create /Users/${name} Password ${passwd}
    2072         exec dscl . -create /Users/${name} UniqueID ${uid}
    2073         exec dscl . -create /Users/${name} PrimaryGroupID ${gid}
    2074         exec dscl . -create /Users/${name} RealName ${realname}
    2075         exec dscl . -create /Users/${name} NFSHomeDirectory ${home}
    2076         exec dscl . -create /Users/${name} UserShell ${shell}
     2071        set dscl [findBinary dscl $portutil::autoconf::dscl_path]
     2072        exec $dscl . -create /Users/${name} Password ${passwd}
     2073        exec $dscl . -create /Users/${name} UniqueID ${uid}
     2074        exec $dscl . -create /Users/${name} PrimaryGroupID ${gid}
     2075        exec $dscl . -create /Users/${name} RealName ${realname}
     2076        exec $dscl . -create /Users/${name} NFSHomeDirectory ${home}
     2077        exec $dscl . -create /Users/${name} UserShell ${shell}
    20772078    } else {
    20782079        # XXX adduser is only available for darwin, add more support here
     
    21002101
    21012102    if {${os.platform} eq "darwin"} {
    2102         exec dscl . -create /Groups/${name} Password ${passwd}
    2103         exec dscl . -create /Groups/${name} RealName ${realname}
    2104         exec dscl . -create /Groups/${name} PrimaryGroupID ${gid}
     2103        set dscl [findBinary dscl $portutil::autoconf::dscl_path]
     2104        exec $dscl . -create /Groups/${name} Password ${passwd}
     2105        exec $dscl . -create /Groups/${name} RealName ${realname}
     2106        exec $dscl . -create /Groups/${name} PrimaryGroupID ${gid}
    21052107        if {${users} ne ""} {
    2106             exec dscl . -create /Groups/${name} GroupMembership ${users}
     2108            exec $dscl . -create /Groups/${name} GroupMembership ${users}
    21072109        }
    21082110    } else {
     
    21312133
    21322134# check for a binary in the path
    2133 # returns an error code if it can not be found
     2135# returns an error code if it cannot be found
    21342136proc binaryInPath {binary} {
    21352137    global env
     
    22622264    }
    22632265    set exec-lipo [concat ${exec-lipo}]
    2264     system "/usr/bin/lipo ${exec-lipo} -create -output ${target}${file}"
     2266    system "[findBinary lipo $portutil::autoconf::lipo_path] ${exec-lipo} -create -output ${target}${file}"
    22652267}
    22662268
     
    22862288    foreach arch [lrange ${archs} 1 end] {
    22872289        # checking for differences; TODO: error more gracefully on non-equal files
    2288         exec "/usr/bin/diff" "-q" "${base}/${basearch}${file}" "${base}/${arch}${file}"
     2290        exec [findBinary diff $portutil::autoconf::diff_path] "-q" "${base}/${basearch}${file}" "${base}/${arch}${file}"
    22892291    }
    22902292    ui_debug "ba: '${basearch}'"
     
    23152317        if {${fpath} != ""} {
    23162318            # determine the type (dir/file/link)
    2317             set filetype [exec "/usr/bin/file" "-b" "${basepath}${fpath}"]
     2319            set filetype [exec [findBinary file $portutil::autoconf::file_path] "-b" "${basepath}${fpath}"]
    23182320            switch -regexp ${filetype} {
    23192321                directory {
     
    23972399# @param action the action for which privileges are being elevated
    23982400proc elevateToRoot {action} {
    2399     global euid egid macportsuser errorisprivileges
     2401    global euid egid macportsuser
    24002402
    24012403    if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
     
    24082410
    24092411    if { [getuid] != 0 } {
    2410         set errorisprivileges yes
    2411         return -code error "port requires root privileges for this action and needs you to type your password for sudo.";
     2412        return -code error "MacPorts requires root privileges for this action";
    24122413    }
    24132414}
     
    24202421    if { [geteuid] == 0 } {
    24212422        if { [catch {
    2422                 set euid [geteuid]
    2423                 set egid [getegid]
    24242423                ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
    24252424
     
    24272426                #setegid [name_to_gid [file attributes $workpath -group]]
    24282427
    2429                 setegid [name_to_gid "$macportsuser"]
     2428                setegid [uname_to_gid "$macportsuser"]
    24302429                seteuid [name_to_uid "$macportsuser"]
    24312430                ui_debug "egid changed to: [getegid]"
    24322431                ui_debug "euid changed to: [geteuid]"
    2433 
    2434                 if {![file writable $workpath]} {
    2435                     ui_debug "Privileges successfully de-escalated. Unable to write to default workpath."
    2436                 }
    24372432            }]
    24382433        } {
  • branches/gsoc09-logging/base/src/registry1.0/Makefile

    r51384 r52218  
    1616        rm -f registry_autoconf.tcl
    1717
    18 install::
     18install:: all
    1919        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    2020        $(SILENT)set -x; for file in ${SRCS}; do \
  • branches/gsoc09-logging/base/src/registry1.0/portimage.tcl

    r51134 r52218  
    125125        set imagefiles [_check_contents $name $contents $imagedir]
    126126       
     127        registry::open_file_map
    127128        _activate_contents $name $imagefiles $imagedir
    128129
     
    131132        registry::write_entry $ref
    132133
    133         registry::open_file_map
    134134        foreach file $imagefiles {
    135135                registry::register_file $file $name
     
    281281                if { ![file isdirectory $dstfile] } {
    282282                        file mkdir $dstfile
    283        
    284283                        # fix attributes on the directory.
    285                         set attributes [file attributes $srcfile]
    286                         for {set i 0} {$i < [llength $attributes]} {incr i} {
    287                                 set opt [lindex $attributes $i]
    288                                 incr i
    289                                 set arg [lindex $attributes $i]
    290                                 file attributes $dstfile $opt $arg
    291                         }
    292        
     284                        eval file attributes {$dstfile} [file attributes $srcfile]
    293285                        # set mtime on installed element
    294                         exec touch -r $srcfile $dstfile
     286                        file mtime $dstfile [file mtime $srcfile]
    295287                }
    296288        } elseif { [file type $srcfile] == "link" } {
     
    331323        #  we remove the file from the file_map, take ownership of it, and
    332324        #  clobber it
    333         registry::open_file_map
    334325        foreach file $imagefiles {
    335326                set srcfile ${imagedir}${file}
     
    383374        }
    384375        registry::write_file_map
    385         registry::close_file_map
    386376
    387377        # Sort the list in forward order, removing duplicates.
  • branches/gsoc09-logging/base/src/registry1.0/portuninstall.tcl

    r49845 r52218  
    125125        set installtype [registry::property_retrieve $ref installtype]
    126126        if { $installtype == "image" && [registry::property_retrieve $ref active] == 1} {
    127                 #return -code error [msgcat::mc "Registry Error: ${portname} ${version}_${revision}${variants} is active."]
    128                 portimage::deactivate $portname ${version}_${revision}${variants} $optionslist
    129         }
    130 
     127                if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} {
     128                        ui_msg "For $portname @${version}_${revision}${variants}: skipping deactivate (dry run)"
     129                } else {
     130                        portimage::deactivate $portname ${version}_${revision}${variants} $optionslist
     131                }
     132        }
     133
     134        if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} {
     135                ui_msg "For $portname @${version}_${revision}${variants}: skipping uninstall (dry run)"
     136                return 0
     137        }
     138       
    131139        ui_msg "$UI_PREFIX [format [msgcat::mc "Uninstalling %s @%s_%s%s"] $portname $version $revision $variants]"
    132140
  • branches/gsoc09-logging/base/src/registry2.0/Makefile

    r51384 r52218  
    2020        ${TCLSH} tests/depends.tcl ${SHLIB_NAME}
    2121
    22 install::
     22install:: all
    2323        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    2424        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
Note: See TracChangeset for help on using the changeset viewer.