View Single Post
coredumb's Avatar
Posts: 92 | Thanked: 74 times | Joined on Nov 2008 @ Indonesia
#1598
Originally Posted by Mohammad View Post
excuse me gurus
just a question
can some body translate this to me line by line


Code: Select all
SVN="subversion"
rpm -q $SVN >/dev/null 2>&1
# 'rpm' exits with a 0 if the package is in the system
if [ "$?" -ne "0" ]; then
yum -y install $SVN
fi

I tried in Mint with

Code: Select all
if [ "subversion" != "0" ]; then
echo "No suitable SVN package installed. Grabbing one now . . ."; sleep 1
apt-get install -y subversion >/dev/null && echo "Got one."
else
echo -e "Dependencies met. Continuing on . . .\n"; sleep 1
fi
i think when you use apt (or dpkg), the script should be like below:
Code:
SVN="subversion"
dpkg -L $SVN > /dev/null 2>&1
# 'dpkg' exits with a 0 if the package is in the system
if [ "$?" -ne "0" ]; then
   apt-get install -y $SVN
fi
dpkg performs the same function as rpm, and apt-get performs the same function as yum
 

The Following User Says Thank You to coredumb For This Useful Post: