Skip to content

Commit

Permalink
Merge pull request #581 from arakasi72/rtorrentnewloc
Browse files Browse the repository at this point in the history
Rtorrentnewloc
  • Loading branch information
arakasi72 authored Aug 22, 2021
2 parents 0d4ae9b + f8d667c commit 5cee68c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 78 deletions.
6 changes: 3 additions & 3 deletions scripts/rtinst
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ echo $ip_address
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin

# if left blank will install latest version of rtorrent, or set to a specific release E.G. '0.9.6' to install that release
rtorrentrel='0.9.6'
rtorrentrel='0.9.8'

#url's of the major components
rt_url="http://rtorrent.net/downloads/"
rt_url="https://rakshasa.github.io/rtorrent/"

xmlrpc_url="https://svn.code.sf.net/p/xmlrpc-c/code/advanced/"
xmlrpc_url_alt="https://github.com/mirror/xmlrpc-c"
Expand Down Expand Up @@ -551,7 +551,7 @@ echo "Updating package lists" | tee $logfile
apt-get -qq update | tee -a $logfile

# Installing Aptitude
apt-get -qqy install aptitude
apt-get -qqy install aptitude >> $logfile 2>&1

echo "Upgrading packages" | tee -a $logfile
export DEBIAN_FRONTEND=noninteractive
Expand Down
86 changes: 11 additions & 75 deletions scripts/rtupdate
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ "$fullrelno" = "" ]; then
fi


sourcedir='http://rtorrent.net/downloads/'
sourcedir='https://rakshasa.github.io/rtorrent/'

xmlrpc_url='https://svn.code.sf.net/p/xmlrpc-c/code/stable/'
xmlrpcloc='svn://svn.code.sf.net/p/xmlrpc-c/code/stable/'
Expand All @@ -40,33 +40,13 @@ xmlrpcloc_alt='https://github.com/mirror/xmlrpc-c/trunk/stable'

rtdevrel=1

if [ "$fullrelno" = "17.10" ]; then
rtdevrel=0
fi

if ([ "$osname" = "Debian" ] || [ "$osname" = "Raspbian" ] && [ $relno -ge 9 ]) || ([ "$osname" = "Ubuntu" ] && [ $relno -ge 18 ]); then
rtdevrel=0
fi
libvers='0.13.8'
rtvers='0.9.8'

listsize=6
duoversion=''
passed_rtvers=$1
[ -z $logfile ] && logfile="/dev/null"

# get a list of the most recent releases
rt_releases=$(wget -q -O - $sourcedir | grep -o "rtorrent-[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}\.tar.gz" | sort -uV | tail -$listsize | grep -o "[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}")

# extract the release numbers from the list of most recent releases
for rtversion in $rt_releases
do
libversion=$(echo $rtversion | awk -F. -v OFS=. '{$2='$(( $(echo $rtversion | cut -d. -f2) + 4 ))'; print }')
duoversion="$duoversion $libversion/$rtversion"
done

# get the most recent release version number
latest_duo=$(echo $duoversion | rev | cut -d' ' -f1 | rev)
latest_libvers=$(echo $latest_duo | cut -d/ -f1)
latest_rtvers=$(echo $latest_duo | cut -d/ -f2)

# checks if an application is installed
installed() {
Expand All @@ -78,20 +58,6 @@ check_url() {
if [[ `wget -S -T 3 --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then return 0; else return 1; fi
}

# function to create a list of versions to install
list_version() {
local verschoice
while [ -z "$verschoice" ]
do
echo "Please select libtorrent/rtorrent version."
select verschoice in ${duoversion[*]}
do
libvers=$(echo $verschoice | cut -d/ -f1)
rtvers=$(echo $verschoice | cut -d/ -f2)
break
done
done
}

ask_user(){
local answer
Expand Down Expand Up @@ -149,46 +115,15 @@ if [ -z $passed_rtvers ]; then
if ( installed rtorrent ); then
rt_current=$(rtorrent -h | grep -om 1 "[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}")
echo "rtorrent $rt_current detected"
exit 1
else
echo "rtorrent NOT installed"
echo "This script is for upgrading/downgrading only, not for initial install"
exit 1
fi

# checks if the OS is debian 9, and forces the version to 0.9.7 of it is
if [ $rtdevrel = 0 ]; then
echo "For Debian 9, and Ubuntu 17.10 and later, recommend libtorrent-0.13.7/rtorrent-0.9.7 or later"
fi

list_version

echo "Install libtorrent-$libvers and rtorrent-$rtvers"
echo "Your rtorrent config, torrents, and data will not be lost or changed"
echo -n "Continue? "
if ! ask_user; then
exit
fi
else
if [ "$passed_rtvers" = "latest" ] || [ $(wget -q -O - $sourcedir | grep -o "rtorrent-$passed_rtvers.tar.gz" | wc -l) -eq 0 ]; then
if [ "$passed_rtvers" != "latest" ]; then
echo " Could not find $passed_rtvers so using latest version instead"
fi
libvers=$latest_libvers
rtvers=$latest_rtvers
else
libvers=$(echo $passed_rtvers | awk -F. -v OFS=. '{$2='$(( $(echo $rtversion | cut -d. -f2) + 4 ))'; print }')
rtvers=$passed_rtvers
fi

# checks if the OS is debian 9, and forces the version to 0.9.7 of it is
if [ $rtdevrel = 0 ]; then
libvers='0.13.8'
rtvers='0.9.8'
echo "Debian 9, and Ubuntu 17.10 and later, are only supported by libtorrent-0.13.7/rtorrent-0.9.7 or later"
fi

fi


if [ -z "$home" ]; then
home=$HOME
fi
Expand All @@ -207,13 +142,14 @@ rm -rf xmlrpc libtorrent* rtorrent*

echo "Fetching source files"


#if [ $rtdevrel = 0 ]; then
# git clone -q -b feature-bind --single-branch https://github.com/rakshasa/libtorrent.git libtorrent-$libvers
# git clone -q -b feature-bind --single-branch https://github.com/rakshasa/rtorrent.git rtorrent-$rtvers
#else
curl -# http://rtorrent.net/downloads/libtorrent-$libvers.tar.gz | tar xz
curl -# http://rtorrent.net/downloads/rtorrent-$rtvers.tar.gz | tar xz
curl -LOJ# https://github.com/rakshasa/rtorrent-archive/raw/master/libtorrent-$libvers.tar.gz
tar -xzf libtorrent-$libvers.tar.gz
curl -LOJ# https://github.com/rakshasa/rtorrent-archive/raw/master/rtorrent-$rtvers.tar.gz
tar -xzf rtorrent-$rtvers.tar.gz
#fi

if [ $xmlrpc_repo = 0 ]; then
Expand All @@ -230,7 +166,7 @@ if [ $xmlrpc_repo = 0 ]; then
cd $home/source
fi

cd libtorrent*
cd libtorrent-$libvers
echo "Installing libtorrent" | tee -a $logfile
./autogen.sh >> $logfile 2>&1
if [ $osname = "Raspbian" ]; then
Expand All @@ -241,7 +177,7 @@ fi
make -j$(nproc) >> $logfile 2>&1
make -s install >> $logfile 2>&1

cd ../rtorrent*
cd ../rtorrent-$rtvers
echo "Installing rtorrent" | tee -a $logfile
./autogen.sh >> $logfile 2>&1
./configure --prefix=/usr --with-xmlrpc-c --enable-ipv6 >> $logfile 2>&1
Expand Down

0 comments on commit 5cee68c

Please sign in to comment.