Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svr4pkg/pkgscripts/i.CompCpio.sh
          +++ new/usr/src/cmd/svr4pkg/pkgscripts/i.CompCpio.sh
↓ open down ↓ 90 lines elided ↑ open up ↑
  91   91  Ld=usr/lib/ld.so
  92   92  Libintl=usr/lib/libintl.so.1
  93   93  Libmalloc=usr/lib/libmapmalloc.so.1
  94   94  Libc=usr/lib/libc.so.1  
  95   95  Libw=usr/lib/libw.so.1
  96   96  Libdl=usr/lib/libdl.so.1
  97   97  Cpio=usr/bin/cpio
  98   98  Rm=usr/bin/rm
  99   99  Ln=usr/bin/ln
 100  100  Mv=usr/bin/mv
 101      -Nawk=usr/bin/nawk
      101 +Awk=usr/xpg4/bin/awk
 102  102  Zcat=usr/bin/zcat
 103  103  
 104  104  # Set up the default paths
 105  105  MV_xpath=/usr/bin
 106  106  MV_cmd=$MV_xpath/mv
 107  107  CPIO_xpath=/usr/bin
 108  108  CPIO_cmd=$CPIO_xpath/cpio
 109  109  ZCAT_xpath=/usr/bin
 110  110  ZCAT_cmd=$ZCAT_xpath/zcat
 111  111  LN_xpath=/usr/bin
 112  112  LN_cmd=$LN_xpath/ln
 113      -NAWK_xpath=/usr/bin
 114      -NAWK_cmd=$NAWK_xpath/nawk
      113 +AWK_xpath=/usr/xpg4/bin/
      114 +AWK_cmd=$AWK_xpath/awk
 115  115  RM_xpath=/usr/bin
 116  116  RM_cmd=$RM_xpath/rm
 117  117  Tmp_xpath=/usr/tmp$$dir
 118  118  Tmp_Creat=0
 119  119  rm_cpio=0
 120  120  rm_ln=0
 121  121  rm_zcat=0
 122      -rm_nawk=0
      122 +rm_awk=0
 123  123  rm_rm=0
 124  124  rm_mv=0
 125  125  no_select=0
 126  126  
 127  127  # Functions
 128  128  
 129  129  #
 130  130  # This creates the temporary directory for holding the old dynamic
 131  131  # libraries and executables.
 132  132  #
↓ open down ↓ 18 lines elided ↑ open up ↑
 151  151                          $Ld)            no_select=1;;
 152  152                          $Ld1)           no_select=1;;
 153  153                          $Libintl)       Spcl_lib=1; file=libintl.so.1;;
 154  154                          $Libmalloc)     Spcl_lib=1; file=libmapmalloc.so.1;;
 155  155                          $Libc)          Spcl_lib=1; file=libc.so.1;;
 156  156                          $Libw)          Spcl_lib=1; file=libw.so.1;;
 157  157                          $Libdl)         Spcl_lib=1; file=libdl.so.1;;
 158  158                          $Cpio)          rm_cpio=1; Spcl_exec=1;;
 159  159                          $Ln)            rm_ln=1; Spcl_exec=1;;
 160  160                          $Zcat)          rm_zcat=1; Spcl_exec=1;;
 161      -                        $Nawk)          rm_nawk=1; Spcl_exec=1;;
      161 +                        $Awk)           rm_awk=1; Spcl_exec=1;;
 162  162                          $Rm)            rm_rm=1; Spcl_exec=1;;
 163  163                          $Mv)            rm_mv=1; Spcl_exec=1;;
 164  164                  esac
 165  165  
 166  166                  if [ $no_select -eq 1 ]; then
 167  167                          is_a_filelist=0
 168  168                          list_empty=1
 169  169                          $RM_cmd $FILELIST
 170  170                          if [ $Rm_alt_sav -eq 1 ]; then
 171  171                                  $RM_cmd -r $PKGSAV
↓ open down ↓ 28 lines elided ↑ open up ↑
 200  200                          if [ $rm_cpio -eq 1 ]; then
 201  201                                  $LN_cmd -s ../..$Tmp_xpath/cpio $1
 202  202                                  CPIO_cmd="$Tmp_xpath/cpio"
 203  203                                  Movelist="$1 cpio $Movelist"
 204  204                                  rm_cpio=0
 205  205                          elif [ $rm_ln -eq 1 ]; then
 206  206                                  $Tmp_xpath/ln -s ../..$Tmp_xpath/ln $1
 207  207                                  LN_cmd="$Tmp_xpath/ln"
 208  208                                  Movelist="$1 ln $Movelist"
 209  209                                  rm_ln=0
 210      -                        elif [ $rm_nawk -eq 1 ]; then
 211      -                                $LN_cmd -s ../..$Tmp_xpath/nawk $1
 212      -                                NAWK_cmd="$Tmp_xpath/nawk"
 213      -                                Movelist="$1 nawk $Movelist"
 214      -                                rm_nawk=0
      210 +                        elif [ $rm_awk -eq 1 ]; then
      211 +                                $LN_cmd -s ../..$Tmp_xpath/awk $1
      212 +                                AWK_cmd="$Tmp_xpath/awk"
      213 +                                Movelist="$1 awk $Movelist"
      214 +                                rm_awk=0
 215  215                          elif [ $rm_zcat -eq 1 ]; then
 216  216                                  $LN_cmd -s ../..$Tmp_xpath/zcat $1
 217  217                                  ZCAT_cmd="$Tmp_xpath/zcat"
 218  218                                  Movelist="$1 zcat $Movelist"
 219  219                                  rm_zcat=0
 220  220                          elif [ $rm_rm -eq 1 ]; then
 221  221                                  $LN_cmd -s ../..$Tmp_xpath/rm $1
 222  222                                  RM_cmd="$Tmp_xpath/rm"
 223  223                                  Movelist="$Movelist $1 rm"
 224  224                                  rm_rm=0
↓ open down ↓ 8 lines elided ↑ open up ↑
 233  233          fi
 234  234  
 235  235          return 0
 236  236  }
 237  237  
 238  238  #
 239  239  # Clean up the libraries and executables that were moved.
 240  240  #
 241  241  exec_clean() {  # $1 =1 means be quiet
 242  242          if [ ! -z "${Movelist}" ]; then
 243      -                echo $Movelist | $NAWK_cmd '
      243 +                echo $Movelist | $AWK_cmd '
 244  244                          { split ($0, line)
 245  245                          for (n=1; n <= NF; n++) {
 246  246                                  print line[n]
 247  247                          }
 248  248                  }' | while read path; do
 249  249                          read file
 250  250                          if [ -h $path ]; then   # If it's our slink
 251  251                                  # then put the original back
 252  252                                  if [ $1 -eq 0 ]; then
 253  253                                          echo `gettext "WARNING : $path not found in archive."`
↓ open down ↓ 3 lines elided ↑ open up ↑
 257  257                                  # remove the temporary copy
 258  258                                  $RM_cmd $Tmp_xpath/$file
 259  259                          fi
 260  260                  done
 261  261                  for path in $Movelist; do
 262  262                          if [ -x $path ]; then
 263  263                                  case $path in
 264  264                                          $Cpio)  CPIO_cmd="$CPIO_xpath/cpio";;
 265  265                                          $Ln)    LN_cmd="$LN_xpath/ln";;
 266  266                                          $Zcat)  ZCAT_cmd="$ZCAT_xpath/zcat";;
 267      -                                        $Nawk)  NAWK_cmd="$NAWK_xpath/nawk";;
      267 +                                        $Awk)   AWK_cmd="$AWK_xpath/awk";;
 268  268                                          $Rm)    RM_cmd="$RM_xpath/rm";;
 269  269                                          $Mv)    MV_cmd="$MV_xpath/mv";;
 270  270                                  esac
 271  271                          fi
 272  272                  done
 273  273                  Movelist=""
 274  274  
 275  275                  if [ $Tmp_Creat -eq 1 ]; then
 276  276                          $RM_cmd -r $Tmp_xpath
 277  277                          Tmp_Creat=0
↓ open down ↓ 133 lines elided ↑ open up ↑
 411  411                                          spclcase $full_path
 412  412                                          if [ $? -eq 1 ]; then
 413  413                                                  break
 414  414                                          fi
 415  415                                  fi
 416  416                          done
 417  417  
 418  418                          # If there's a path containing a '$' then we can't
 419  419                          # use the extraction list because of the shell
 420  420                          if [ $list_empty -eq 0 ]; then
 421      -                                s=`LD_PRELOAD="$Ld_Preload" $NAWK_cmd ' /\\$/ { print } ' $FILELIST`
      421 +                                s=`LD_PRELOAD="$Ld_Preload" $AWK_cmd ' /\\$/ { print } ' $FILELIST`
 422  422  
 423  423                                  if [ ! -z "${s}" ]; then
 424  424                                          is_a_filelist=0
 425  425                                  fi
 426  426                          fi
 427  427                  else    # No extraction list is desired
 428  428                          while   read  path
 429  429                          do
 430  430                                  if [ -x ${path:-NULL} ]; then
 431  431                                          full_path=`echo $Client_BD/$path | sed s@//@/@g`
↓ open down ↓ 10 lines elided ↑ open up ↑
 442  442                          is_a_filelist=1
 443  443                          while   read path
 444  444                          do
 445  445                                  echo $path >> $FILELIST
 446  446                                  list_empty=0
 447  447                          done
 448  448  
 449  449                          # If there's a path containing a '$' then we can't
 450  450                          # use the extraction list because of the shell
 451  451                          if [ $list_empty -eq 0 ]; then
 452      -                                s=`LD_PRELOAD="$Ld_Preload" $NAWK_cmd ' /\\$/ { print } ' $FILELIST`
      452 +                                s=`LD_PRELOAD="$Ld_Preload" $AWK_cmd ' /\\$/ { print } ' $FILELIST`
 453  453  
 454  454                                  if [ ! -z "${s}" ]; then
 455  455                                          is_a_filelist=0
 456  456                                  fi
 457  457                          fi
 458  458                  fi      # $mk_filelist -eq 1
 459  459          fi      # $local_install -eq 1
 460  460  fi      # ${PKG_INIT_INSTALL:-null} = null
 461  461  
 462  462  # Now extract the data from the archive(s)
↓ open down ↓ 76 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX