diff --git a/bin/cpu-freq b/bin/cpu-freq index 0350d1c9..fa38eff2 100755 --- a/bin/cpu-freq +++ b/bin/cpu-freq @@ -1,8 +1,8 @@ #!/bin/sh -e mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$//"` -if [ $mhz -gt 1000 -a -x /usr/bin/bc ]; then - ghz=$(echo "scale=1; $mhz/1000" | bc) +if [ $mhz -ge 1000 ]; then + ghz=$(echo "$mhz" | awk '{ printf "%.1f", $1 / 1000 }') echo "$ghz""GHz" else echo "$mhz""MHz" diff --git a/bin/mem-available b/bin/mem-available index ef19c12c..cd3b9319 100755 --- a/bin/mem-available +++ b/bin/mem-available @@ -1,11 +1,11 @@ #!/bin/sh -e mem=`free | grep -m 1 "^Mem:" | awk '{print $2}'` -if [ $mem -gt 1000000 -a -x /usr/bin/bc ]; then - mem=$(echo "scale=1; $mem/1000000" | bc) +if [ $mem -ge 1048576 ]; then + mem=$(echo "$mem" | awk '{ printf "%.1f", $1 / 1048576 }') echo "$mem""GB" -elif [ $mem -gt 1000 -a -x /usr/bin/bc ]; then - mem=$(echo "scale=0; $mem/1000" | bc) +elif [ $mem -ge 1024 ]; then + mem=$(echo "$mem" | awk '{ printf "%.0f", $1 / 1024 }') echo "$mem""MB" else echo "$mem""KB" diff --git a/debian/changelog b/debian/changelog index 662cef66..9e687d60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,9 @@ screen-profiles (1.13) UNRELEASED; urgency=low information * doc/help.txt: updated help page * keybindings/common: F12 -> lockscreen + * debian/control, bin/*: remove dependencing on bc by using awk - -- Dustin Kirkland Thu, 22 Jan 2009 00:30:14 -0500 + -- Dustin Kirkland Thu, 22 Jan 2009 00:31:23 -0500 screen-profiles (1.12-0ubuntu1) jaunty; urgency=low diff --git a/debian/control b/debian/control index 09c87474..5f55d0fd 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ Package: screen-profiles Architecture: all Depends: ${misc:Depends}, debconf (>= 0.5) | debconf-2.0, screen, gettext-base, python, python-newt Recommends: update-notifier-common -Suggests: bc Enhances: screen Description: a set of useful profiles and a profile-switcher for GNU screen screen-profiles includes a set of profiles for the GNU screen window manager. @@ -22,7 +21,5 @@ Description: a set of useful profiles and a profile-switcher for GNU screen updates-available), etc. The profile-switcher allows users to quickly switch their .screenrc to any of the available profiles. . - bc provides more advanced calculations of memory and cpu-speed in the - status panel. update-notifier-common provides a more efficient and standard - mechanism for calculating the number of updates available in the status - panel. + update-notifier-common provides a more efficient and standard mechanism for + calculating the number of updates available in the status panel.