Ignore:
Timestamp:
Sep 5, 2013, 1:11:10 AM (13 years ago)
Author:
tobayer
Message:

[titan] tobayer01 skins: optimize control files

Location:
ipk/source.sh4/titanswapskins_tobayer01/CONTROL
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst

    r23248 r23270  
    1212
    1313
    14 ### FUNCTIONS ###
    15 
    16 RES_COL=60                                                                      # column number to place the status
    17 
    18 echo_success() {                                                        # function to print the OK status
    19         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    20 }
    21 
    22 echo_failure() {                                                        # function to print the FAILED status
    23         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    24 }
    25 
    26 
    27 
    2814### MAIN ###
    2915
     
    3218FREE=`expr $SPACE - 100`
    3319echo
    34 echo "New free space: $FREE kB"
     20echo "New free space: ${FREE}kB"
    3521
    3622
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postrm

    r23248 r23270  
    99
    1010
    11 ### FUNCTIONS ###
    12 
    13 RES_COL=60                                                                      # column number to place the status
    14 
    15 echo_success() {                                                        # function to print the OK status
    16         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    17 }
    18 
    19 echo_failure() {                                                        # function to print the FAILED status
    20         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    21 }
    22 
    23 
    24 
    2511### MAIN ###
    2612
     
    3016SPACE=`getfreespace $plugin_target`
    3117FREE=`expr $SPACE - 100`
     18echo "New free space: ${FREE}kB"
    3219echo
    33 echo "New free space: $FREE kB"
    34 
    3520echo "Successfully removed $plugin."
    3621
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst

    r23248 r23270  
    99plugin="$plugin_short $plugin_type"
    1010
    11 model=`cat /etc/model`
    12 buildgroup=`cat /etc/.buildgroup`
    13 
    14 
    15 ### FUNCTIONS ###
    16 
    17 RES_COL=60                                                                      # column number to place the status
    18 
    19 echo_success() {                                                        # function to print the OK status
    20         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    21 }
    22 
    23 echo_failure() {                                                        # function to print the FAILED status
    24         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    25 }
    26 
    27 
    2811
    2912### MAIN ###
    3013
    31 msg="Checking box type..."
    32 if [ "$model" = "" ]; then
    33         echo_failure "$msg"
     14# Is this check for anything useful???
     15#model=`cat /etc/model`
     16#echo -n "Checking box type..."
     17#if [ "$model" = "" ]; then
     18#       echo "......[FAILED]"
     19#       echo
     20#       echo "Sorry, $plugin is not available for the $model!"
     21#       echo "Aborting installation..."
     22#       exit 1
     23#else
     24#       echo "......[OK]"
     25#fi
     26
     27
     28echo -n "Checking installation directory..."
     29if [ ! -d $plugin_target ]; then
     30        echo "......[FAILED]"
    3431        echo
    35         echo "Sorry, $plugin is not available for the $model!"
     32        echo "'$plugin_target' not found!"
    3633        echo "Aborting installation..."
    3734        exit 1
    3835else
    39         echo_success "$msg"
    40 fi
    41 
    42 
    43 msg="Checking installation directory..."
    44 if [ ! -d $plugin_target ]; then
    45         echo_failure "$msg"
     36#       echo "......[OK]"
    4637        echo
    47         echo "Sorry, $plugin_target not found!"
    48         echo "Aborting installation..."
    49         exit 1
    50 else
    51         echo_success "$msg"
    5238fi
    5339
     
    5642SPACE=`getfreespace $plugin_target`
    5743FREE=`expr $SPACE - 100`
    58 msg="Checking free space ($plugin_size in $FREE kB)..."
     44echo -n "Checking free space (${plugin_size}/${FREE}kB)..."
    5945if [ "$FREE" -lt "$plugin_size" ]; then
    60         echo_failure "$msg"
     46        echo "......[FAILED]"
    6147        echo
    62         echo "Sorry, not enough free space in $plugin_target!"
     48        echo "Not enough free space in $plugin_target!"
    6349        echo "Aborting installation..."
    6450        exit 1
    6551else
    66         echo_success "$msg"
     52#       echo "......[OK]"
     53        echo
    6754fi
    6855
    6956
    70 msg="Checking image type..."
    71 if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
    72         echo_failure "$msg"
    73         echo
    74         echo "Sorry, $plugin is not available for this image type!"
    75         echo "Aborting installation..."
    76         exit 1
    77 else
    78         echo_success "$msg"
    79 fi
     57# Is this check for anything useful???
     58#buildgroup=`cat /etc/.buildgroup`
     59#echo -n "Checking image type..."
     60#if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
     61#       echo "......[FAILED]"
     62#       echo
     63#       echo "Sorry, $plugin is not available for this image type!"
     64#       echo "Aborting installation..."
     65#       exit 1
     66#else
     67#       echo "......[OK]"
     68#fi
    8069
    8170
    8271rm -rf $plugin_dir
    8372
    84 msg="Installing $plugin..."
    85 echo_success "$msg"
     73#echo -n "Installing $plugin..."
     74#echo "......[OK]"
    8675
    8776exit 0
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm

    r23248 r23270  
    99
    1010
    11 ### FUNCTIONS ###
    12 
    13 RES_COL=60                                                                      # column number to place the status
    14 
    15 echo_success() {                                                        # function to print the OK status
    16         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    17 }
    18 
    19 echo_failure() {                                                        # function to print the FAILED status
    20         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    21 }
    22 
    23 
    24 
    2511### MAIN ###
    2612
     
    2814SPACE=`getfreespace $plugin_target`
    2915FREE=`expr $SPACE - 100`
    30 echo "Old free space: $FREE kB"
    31 
    32 
    33 msg="Removing $plugin..."
    34 echo_success "$msg"
     16echo "Old free space: ${FREE}kB"
    3517
    3618exit 0
Note: See TracChangeset for help on using the changeset viewer.