Diff for /embedaddon/sudo/pp between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2012/05/29 12:26:49 version 1.1.1.3, 2012/10/09 09:29:52
Line 1 Line 1
 #!/bin/sh  #!/bin/sh
 # Copyright 2012 Quest Software, Inc. ALL RIGHTS RESERVED  # Copyright 2012 Quest Software, Inc. ALL RIGHTS RESERVED
pp_revision="355"pp_revision="368"
  # Copyright 2012 Quest Software, Inc.  ALL RIGHTS RESERVED.   # Copyright 2012 Quest Software, Inc.  ALL RIGHTS RESERVED.
  #   #
  # Redistribution and use in source and binary forms, with or without   # Redistribution and use in source and binary forms, with or without
Line 2288  pp_sd_write_files () { Line 2288  pp_sd_write_files () {
                 # current working (source) directory, not the destination;                  # current working (source) directory, not the destination;
                 # we need to qualify them to prevent this.                  # we need to qualify them to prevent this.
                 case "$st" in                  case "$st" in
                    /*) echo "$line $st $p";;                    [!/]*) st="`dirname \"$p\"`/$st";;
                    *) echo "$line `dirname $p`/$st $p";; 
                 esac                  esac
                   echo "$line -o $o -g $g -m $m $st $p"
                 ;;                  ;;
             *)              *)
                 echo "$line -o $o -g $g -m $m $pp_destdir$p $p"                  echo "$line -o $o -g $g -m $m $pp_destdir$p $p"
Line 3847  pp_backend_deb_init () { Line 3847  pp_backend_deb_init () {
     pp_deb_release=      pp_deb_release=
     pp_deb_arch=      pp_deb_arch=
     pp_deb_arch_std=      pp_deb_arch_std=
    pp_deb_maintainer=support@quest.com    pp_deb_maintainer="Quest Software, Inc <support@quest.com>"
     pp_deb_copyright=      pp_deb_copyright=
     pp_deb_distro=      pp_deb_distro=
     pp_deb_control_description=      pp_deb_control_description=
Line 3863  pp_backend_deb_init () { Line 3863  pp_backend_deb_init () {
   
     # Make sure any programs we require are installed      # Make sure any programs we require are installed
     pp_deb_check_required_programs      pp_deb_check_required_programs
   
     # Set generated/interrogated platforms variables  
     pp_deb_munge_description  
 }  }
   
 pp_deb_check_required_programs () {  pp_deb_check_required_programs () {
Line 3896  pp_deb_check_required_programs () { Line 3893  pp_deb_check_required_programs () {
 pp_deb_munge_description () {  pp_deb_munge_description () {
     # Insert a leading space on each line, replace blank lines with a      # Insert a leading space on each line, replace blank lines with a
     #space followed by a full-stop.      #space followed by a full-stop.
    pp_deb_control_description=`echo ${pp_deb_description:-$description} | \    pp_deb_control_description="`echo ${pp_deb_description:-$description} | \
        sed "s,^\(.*\)$, \1, " \        sed 's,^\(.*\)$, \1, ' | sed 's,^[ \t]*$, .,g' | fmt -w 80`"
        | sed "s,^[ \t]*$, .,g"` 
 
 }  }
   
 pp_deb_detect_arch () {  pp_deb_detect_arch () {
Line 3934  pp_deb_conflict () { Line 3929  pp_deb_conflict () {
 }  }
   
 pp_deb_make_control() {  pp_deb_make_control() {
    package_name=`pp_deb_cmp_full_name "$1"`    local cmp="$1"
     local installed_size
 
     # compute the installed size
     installed_size=`pp_deb_files_size < $pp_wrkdir/%files.$cmp`
 
     package_name=`pp_deb_cmp_full_name "$cmp"`
     cat <<-.      cat <<-.
         Package: ${package_name}          Package: ${package_name}
         Version: `pp_deb_version_final`-${pp_deb_release:-1}          Version: `pp_deb_version_final`-${pp_deb_release:-1}
Line 3944  pp_deb_make_control() { Line 3945  pp_deb_make_control() {
         Maintainer: ${pp_deb_maintainer:-$maintainer}          Maintainer: ${pp_deb_maintainer:-$maintainer}
         Description: ${pp_deb_summary:-$summary}          Description: ${pp_deb_summary:-$summary}
         ${pp_deb_control_description}          ${pp_deb_control_description}
           Installed-Size: ${installed_size}
 .  .
    if test -s $pp_wrkdir/%depend."$1"; then    if test -s $pp_wrkdir/%depend."$cmp"; then
         sed -ne '/^[    ]*$/!s/^[       ]*/Depends: /p' \          sed -ne '/^[    ]*$/!s/^[       ]*/Depends: /p' \
            < $pp_wrkdir/%depend."$1"            < $pp_wrkdir/%depend."$cmp"
     fi      fi
    if test -s $pp_wrkdir/%conflict."$1"; then    if test -s $pp_wrkdir/%conflict."$cmp"; then
        pp_deb_conflict < $pp_wrkdir/%conflict."$1"        pp_deb_conflict < $pp_wrkdir/%conflict."$cmp"
     fi      fi
 }  }
   
Line 4002  pp_deb_handle_services() { Line 4004  pp_deb_handle_services() {
             #-- append %post code to install the svc              #-- append %post code to install the svc
             test x"yes" = x"$enable" &&              test x"yes" = x"$enable" &&
             cat<<-. >> $pp_wrkdir/%post.run              cat<<-. >> $pp_wrkdir/%post.run
                # Install the service links                case "\$1" in
                /usr/sbin/update-rc.d $svc defaults                    configure)
                         # Install the service links
                         update-rc.d $svc defaults
                         ;;
                 esac
 .  .
   
             #-- prepend %preun code to stop svc              #-- prepend %preun code to stop svc
             cat<<-. | pp_prepend $pp_wrkdir/%preun.run              cat<<-. | pp_prepend $pp_wrkdir/%preun.run
                # Stop the $svc service                case "\$1" in
                if test -x /usr/sbin/invoke-rc.d; then                    remove|deconfigure|upgrade)
                    /usr/sbin/invoke-rc.d $svc stop                        # Stop the $svc service
                else                        invoke-rc.d $svc stop
                    /etc/init.d/$svc stop                        ;;
                fi                esac
                # Remove the service links 
                /usr/sbin/update-rc.d -f $svc remove 
 .  .
   
               #-- prepend %postun code to remove service
               cat<<-. | pp_prepend $pp_wrkdir/%postun.run
                   case "\$1" in
                       purge)
                           # Remove the service links
                           update-rc.d $svc remove
                           ;;
                   esac
   .
         done          done
         #pp_deb_service_remove_common | pp_prepend $pp_wrkdir/%preun.run          #pp_deb_service_remove_common | pp_prepend $pp_wrkdir/%preun.run
     fi      fi
Line 4030  pp_deb_fakeroot () { Line 4044  pp_deb_fakeroot () {
     fi      fi
 }  }
   
   pp_deb_files_size () {
       local t m o g f p st
       while read t m o g f p st; do
           case $t in
               f|s) du -k "${pp_destdir}$p";;
               d)   echo 4;;
           esac
       done | awk '{n+=$1} END {print n}'
   }
   
 pp_deb_make_DEBIAN() {  pp_deb_make_DEBIAN() {
     local cmp="${1:-run}"      local cmp="${1:-run}"
     local data cmp_full_name      local data cmp_full_name
Line 4051  pp_deb_make_DEBIAN() { Line 4075  pp_deb_make_DEBIAN() {
         cp $pp_wrkdir/%conffiles.$cmp $data/DEBIAN/conffiles          cp $pp_wrkdir/%conffiles.$cmp $data/DEBIAN/conffiles
     fi      fi
   
       # Create preinst
       pp_deb_make_package_maintainer_script "$data/DEBIAN/preinst" \
           "$pp_wrkdir/%pre.$cmp" "Pre-install script for $cmp_full_name"\
           || exit $?
   
     # Create postinst      # Create postinst
     pp_deb_make_package_maintainer_script "$data/DEBIAN/postinst" \      pp_deb_make_package_maintainer_script "$data/DEBIAN/postinst" \
        "$pp_wrkdir/%post.$cmp" "Post install script for $cmp_full_name"\        "$pp_wrkdir/%post.$cmp" "Post-install script for $cmp_full_name"\
         || exit $?          || exit $?
   
     # Create prerm      # Create prerm
Line 4141  pp_deb_makedeb () { Line 4170  pp_deb_makedeb () {
   
     # Create md5sums      # Create md5sums
     pp_deb_make_md5sums $cmp `(cd $package_build_dir;      pp_deb_make_md5sums $cmp `(cd $package_build_dir;
        find . -type f -a -not -name DEBIAN | sed "s,^\./,,")` ||        find . -name DEBIAN -prune -o -type f -print | sed "s,^\./,,")` ||
             pp_die "Could not make DEBIAN md5sums for $cmp"              pp_die "Could not make DEBIAN md5sums for $cmp"
 }  }
   
 pp_backend_deb () {  pp_backend_deb () {
     local debname      local debname
   
       # Munge description for control file inclusion
       pp_deb_munge_description
   
     # Handle services      # Handle services
     pp_deb_handle_services $cmp      pp_deb_handle_services $cmp
   
Line 4363  pp_backend_deb_init_svc_vars () { Line 4395  pp_backend_deb_init_svc_vars () {
   
     lsb_required_start='$local_fs $network'      lsb_required_start='$local_fs $network'
     lsb_should_start=      lsb_should_start=
    lsb_required_stop=    lsb_required_stop='$local_fs'
     lsb_description=      lsb_description=
   
     start_priority=50      start_priority=50
Line 4376  pp_deb_service_make_init_script () { Line 4408  pp_deb_service_make_init_script () {
     local out=$pp_destdir$script      local out=$pp_destdir$script
     local _process _cmd      local _process _cmd
   
    pp_add_file_if_missing $script run 755 || return 0    pp_add_file_if_missing $script run 755 v || return 0
   
     #-- start out as an empty shell script      #-- start out as an empty shell script
     cat <<-'.' >$out      cat <<-'.' >$out
Line 6800  pp_macos_bom_fix_parents () { Line 6832  pp_macos_bom_fix_parents () {
         sub chk { my $d=shift;          sub chk { my $d=shift;
                   &chk(&dirname($d)) if $d =~ m,/,;                    &chk(&dirname($d)) if $d =~ m,/,;
                   unless ($seen{$d}++) {                    unless ($seen{$d}++) {
                       # Make sure we do not override system directories
                       if ($d =~ m:^\./(etc|var)$:) {
                         my $tgt = "private/$1";
                         my $_ = `/usr/bin/printf "$tgt" | /usr/bin/cksum /dev/stdin`;
                         my ($sum, $len) = split;
                         print "$d\t120755\t0/0\t$len\t$sum\t$tgt\n";
                       } elsif ($d eq "." || $d eq "./Library") {
                         print "$d\t41775\t0/80\n";
                       } elsif ($d eq "./Applications" || $d eq "./Developer") {
                         print "$d\t40775\t0/80\n";
                       } else {
                       print "$d\t40755\t0/0\n";                        print "$d\t40755\t0/0\n";
                       }
                   }                    }
                 }                  }
         m/^(\S+)\s+(\d+)/;          m/^(\S+)\s+(\d+)/;

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>