made branch v0.5.0 to stabilise the dev of v0.5

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2524 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-03-12 20:15:27 +00:00
parent 5e0c8e062e
commit b4d8c398ce
12 changed files with 80 additions and 27 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
###################### PARAMETERS #################### ###################### PARAMETERS ####################
version="0.4.12" version="0.5-alpha1"
arch=`dpkg --print-architecture` arch=`dpkg --print-architecture`
packager="Cyril Soler <csoler@users.sourceforge.net>" packager="Cyril Soler <csoler@users.sourceforge.net>"
###################################################### ######################################################
@ -11,14 +11,15 @@ svn=`svn info | grep 'Revision:' | cut -d\ -f2`
echo done. echo done.
version="$version"."$svn" version="$version"."$svn"
pkgname=RetroShare_"$version"_ubuntu_"$arch".deb pkgname=RetroShare_"$version"_ubuntu_"$arch".deb
rsdir="../.."
echo Building retroshare debian package version $version for Ubuntu $arch. echo Building retroshare debian package version $version for Ubuntu $arch.
echo Please check that: echo Please check that:
echo " "- you have sudo access and that root has right to write in this directory and the subdirectories. echo " "- you have sudo access and that root has right to write in this directory and the subdirectories.
echo " "- you have compiled libretroshare and retroshare-gui in ../../libretroshare/src/ echo " "- you have compiled libretroshare and retroshare-gui in "$rsdir"/libretroshare/src/
echo " "and ../../retroshare-gui/src/ echo " "and "$rsdir"/retroshare-gui/src/
echo " "- you have updated version numbers in ../../retroshare-gui/src/util/rsversion.cpp echo " "- you have updated version numbers in "$rsdir"/retroshare-gui/src/util/rsversion.cpp
echo " "and ../../retroshare-gui/src/retroshare.nsi echo " "and "$rsdir"/retroshare-gui/src/retroshare.nsi
echo " "- version and name will be: $pkgname echo " "- version and name will be: $pkgname
if ! test `whoami` = "root" ; then if ! test `whoami` = "root" ; then
@ -47,22 +48,22 @@ mv retroshare/DEBIAN/control.tmp retroshare/DEBIAN/control
find retroshare -name "*~" -exec \rm -f {} \; find retroshare -name "*~" -exec \rm -f {} \;
# copy executables at the right place # copy executables at the right place
if ! test -f ../../retroshare-gui/src/RetroShare; then if ! test -f "$rsdir"/retroshare-gui/src/RetroShare; then
echo Can not find executable ../../retroshare-gui/src/RetroShare. Please fix this. echo Can not find executable "$rsdir"/retroshare-gui/src/RetroShare. Please fix this.
echo
exit ;
fi
if ! test -f ../../retroshare-nogui/src/retroshare-nogui; then
echo Can not find executable ../../retroshare-nogui/src/retroshare-nogui. Please fix this.
echo echo
exit ; exit ;
fi fi
#if ! test -f "$rsdir"/retroshare-nogui/src/retroshare-nogui; then
# echo Can not find executable "$rsdir"/retroshare-nogui/src/retroshare-nogui. Please fix this.
# echo
# exit ;
#fi
echo Stripping executables... echo Stripping executables...
cp ../../retroshare-gui/src/RetroShare retroshare/usr/bin/ cp "$rsdir"/retroshare-gui/src/RetroShare retroshare/usr/bin/
strip retroshare/usr/bin/RetroShare strip retroshare/usr/bin/RetroShare
cp ../../retroshare-nogui/src/retroshare-nogui retroshare/usr/bin/ #cp ../../retroshare-nogui/src/retroshare-nogui retroshare/usr/bin/
strip retroshare/usr/bin/retroshare-nogui #strip retroshare/usr/bin/retroshare-nogui
# compute md5 sums # compute md5 sums
echo Computing/setting md5 sums... echo Computing/setting md5 sums...

View File

@ -15,3 +15,4 @@ rm -rf ./retroshare-0.5
sudo pbuilder build *.dsc sudo pbuilder build *.dsc
cp /var/cache/pbuilder/result/retroshare_0.5-1_i386.deb .

View File

@ -5,10 +5,27 @@ if test -d "RetroShare" ; then
exit exit
fi fi
###################### PARAMETERS ####################
version="0.5-alpha1"
######################################################
echo attempting to get svn revision number...
svn=`svn info | grep 'Revision:' | cut -d\ -f2`
echo done.
version="$version"."$svn"
echo got version number $version. Is this correct ?
read tmp
packages="." packages="."
tar zxvf $packages/BaseRetroShareDirs.tgz tar zxvf $packages/BaseRetroShareDirs.tgz
echo Setting up version numbers...
cat retroshare-0.5/debian/control | sed -e s/XXXXXX/"$version"/g | sed -e s/YYYYYY/"$arch"/g | sed -e s/ZZZZZZ/"$packager"/g > retroshare-0.5/debian/control.tmp
mv retroshare-0.5/debian/control.tmp retroshare-0.5/debian/control
echo Getting svn sources
# Ultimately, use the following, but # Ultimately, use the following, but
cd retroshare-0.5/src/libretroshare/ cd retroshare-0.5/src/libretroshare/
#tar zxvf ../../../libretroshare.tgz #tar zxvf ../../../libretroshare.tgz
@ -22,8 +39,10 @@ cd ../../..
# Various cleaning # Various cleaning
echo Cleaning...
find retroshare-0.5 -name ".svn" -exec rm -rf {} \; # remove all svn repositories find retroshare-0.5 -name ".svn" -exec rm -rf {} \; # remove all svn repositories
echo Preparing package
mv retroshare-0.5/src/retroshare-gui/RetroShare.pro retroshare-0.5/src/retroshare-gui/retroshare-gui.pro mv retroshare-0.5/src/retroshare-gui/RetroShare.pro retroshare-0.5/src/retroshare-gui/retroshare-gui.pro
./cleanProFile.sh retroshare-0.5/src/libretroshare/libretroshare.pro ./cleanProFile.sh retroshare-0.5/src/libretroshare/libretroshare.pro

View File

@ -550,12 +550,18 @@ void ftController::locked_checkQueueElement(uint32_t pos)
if(pos < _max_active_downloads) if(pos < _max_active_downloads)
{ {
_queue[pos]->mState = ftFileControl::DOWNLOADING ; _queue[pos]->mState = ftFileControl::DOWNLOADING ;
if(_queue[pos]->mFlags & RS_FILE_HINTS_NETWORK_WIDE)
mTurtle->monitorFileTunnels(_queue[pos]->mName,_queue[pos]->mHash,_queue[pos]->mSize) ;
} }
if(pos >= _max_active_downloads && _queue[pos]->mState != ftFileControl::QUEUED) if(pos >= _max_active_downloads && _queue[pos]->mState != ftFileControl::QUEUED)
{ {
_queue[pos]->mState = ftFileControl::QUEUED ; _queue[pos]->mState = ftFileControl::QUEUED ;
_queue[pos]->mCreator->closeFile() ; _queue[pos]->mCreator->closeFile() ;
if(_queue[pos]->mFlags & RS_FILE_HINTS_NETWORK_WIDE)
mTurtle->stopMonitoringFileTunnels(_queue[pos]->mHash) ;
} }
} }

View File

@ -238,6 +238,9 @@ void p3turtle::autoWash()
#endif #endif
// Remove hashes that are marked as such. // Remove hashes that are marked as such.
// //
std::vector<std::pair<TurtleFileHash,TurtleVirtualPeerId> > peers_to_remove ;
{ {
RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/
@ -270,7 +273,7 @@ void p3turtle::autoWash()
std::cerr << ")" << std::endl ; std::cerr << ")" << std::endl ;
#endif #endif
for(unsigned int k=0;k<tunnels_to_remove.size();++k) for(unsigned int k=0;k<tunnels_to_remove.size();++k)
locked_closeTunnel(tunnels_to_remove[k]) ; locked_closeTunnel(tunnels_to_remove[k],peers_to_remove) ;
_incoming_file_hashes.erase(it) ; _incoming_file_hashes.erase(it) ;
} }
@ -340,13 +343,18 @@ void p3turtle::autoWash()
tunnels_to_close.push_back(it->first) ; tunnels_to_close.push_back(it->first) ;
} }
for(unsigned int i=0;i<tunnels_to_close.size();++i) for(unsigned int i=0;i<tunnels_to_close.size();++i)
locked_closeTunnel(tunnels_to_close[i]) ; locked_closeTunnel(tunnels_to_close[i],peers_to_remove) ;
} }
// File hashes can only be removed by calling the 'stopMonitoringFileTunnels()' command. // File hashes can only be removed by calling the 'stopMonitoringFileTunnels()' command.
// All calls to _ft_controller are done off-mutex, to avoir cross-lock
for(uint32_t i=0;i<peers_to_remove.size();++i)
_ft_controller->removeFileSource(peers_to_remove[i].first,peers_to_remove[i].second) ;
} }
void p3turtle::locked_closeTunnel(TurtleTunnelId tid) void p3turtle::locked_closeTunnel(TurtleTunnelId tid,std::vector<std::pair<TurtleFileHash,TurtleVirtualPeerId> >& sources_to_remove)
{ {
// This is closing a given tunnel, removing it from file sources, and from the list of tunnels of its // This is closing a given tunnel, removing it from file sources, and from the list of tunnels of its
// corresponding file hash. In the original turtle4privacy paradigm, they also send back and forward // corresponding file hash. In the original turtle4privacy paradigm, they also send back and forward
@ -378,7 +386,7 @@ void p3turtle::locked_closeTunnel(TurtleTunnelId tid)
std::cerr << " Virtual Peer Id " << vpid << std::endl ; std::cerr << " Virtual Peer Id " << vpid << std::endl ;
std::cerr << " Associated file source." << std::endl ; std::cerr << " Associated file source." << std::endl ;
#endif #endif
_ft_controller->removeFileSource(hash,vpid) ; sources_to_remove.push_back(std::pair<TurtleFileHash,TurtleVirtualPeerId>(hash,vpid)) ;
// Let's be cautious. Normally we should never be here without consistent information, // Let's be cautious. Normally we should never be here without consistent information,
// but still, this happens, rarely. // but still, this happens, rarely.
@ -1677,6 +1685,20 @@ void p3turtle::monitorFileTunnels(const std::string& name,const std::string& fil
{ {
RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/
// First, check if the hash is tagged for removal (there's a delay)
for(uint i=0;i<_hashes_to_remove.size();++i)
if(_hashes_to_remove[i] == file_hash)
{
_hashes_to_remove[i] = _hashes_to_remove.back() ;
_hashes_to_remove.pop_back() ;
#ifdef P3TURTLE_DEBUG
std::cerr << "p3turtle: File hash " << file_hash << " Was scheduled for removal. Canceling the removal." << std::endl ;
#endif
}
// Then, check if the hash is already there
//
if(_incoming_file_hashes.find(file_hash) != _incoming_file_hashes.end()) // download already asked. if(_incoming_file_hashes.find(file_hash) != _incoming_file_hashes.end()) // download already asked.
{ {
#ifdef P3TURTLE_DEBUG #ifdef P3TURTLE_DEBUG
@ -1730,7 +1752,7 @@ static std::string printNumber(uint64_t num,bool hex=false)
if(num < (((uint64_t)1)<<32)) if(num < (((uint64_t)1)<<32))
sprintf(tmp,"%08x", uint32_t(num)) ; sprintf(tmp,"%08x", uint32_t(num)) ;
else else
sprintf(tmp,"%08x%08x", uint32_t(num >> 32),uint32_t(num & ( (1<<32)-1 ))) ; sprintf(tmp,"%08x%08x", uint32_t(num >> 32),uint32_t(num & ( (((uint64_t)1)<<32)-1 ))) ;
return std::string(tmp) ; return std::string(tmp) ;
} }
else else

View File

@ -311,8 +311,11 @@ class p3turtle: public p3Service, public pqiMonitor, public RsTurtle,/* public f
/// Handle tunnel digging for current file hashes /// Handle tunnel digging for current file hashes
void manageTunnels() ; void manageTunnels() ;
/// closes a given tunnel. Should be called with mutex set. /// Closes a given tunnel. Should be called with mutex set.
void locked_closeTunnel(TurtleTunnelId tid) ; /// The hashes and peers to remove (by calling
/// ftController::removeFileSource() are happended to the supplied vector
/// so that they can be removed off the turtle mutex.
void locked_closeTunnel(TurtleTunnelId tid,std::vector<std::pair<TurtleFileHash,TurtleVirtualPeerId> >& peers_to_remove) ;
/// Main routing function /// Main routing function
int handleIncoming(); int handleIncoming();

View File

@ -8,7 +8,7 @@
#include <string> #include <string>
#define LIB_VERSION "0.5.0 alpha 1" #define LIB_VERSION "0.5.0 alpha 1"
#define SVN_REVISION "svn : 2213 date : 21:41:59 02.06.10" #define SVN_REVISION "Revision: 2519 date : 20:36:48 03.12.10"
namespace RsUtil { namespace RsUtil {

View File

@ -1210,6 +1210,7 @@ void SearchDialog::copysearchLink()
RetroShareLink link(fname, fsize, fhash); RetroShareLink link(fname, fsize, fhash);
std::cerr << "new link added to clipboard: " << link.toString().toStdString() << std::endl ;
if(link.valid()) if(link.valid())
urls.push_back(link.toUrl()) ; urls.push_back(link.toUrl()) ;
} }

View File

@ -1,5 +1,5 @@
Retroshare Gui version : Retroshare Gui version :
Svn version : Revision: 2398 Svn version : Revision: 2519
Tue Feb 23 16:33:19 GMT 2010 Fri Mar 12 20:36:59 CET 2010

View File

@ -22,7 +22,7 @@
#define GUI_VERSION "0.5.0 alpha 1" #define GUI_VERSION "0.5.0 alpha 1"
#define GUI_REVISION "Revision: 2268 date : 18:57:43 02.09.10" #define GUI_REVISION "Revision: 2519 date : 20:36:59 03.12.10"
#include <QString> #include <QString>

View File

@ -10,7 +10,7 @@ linux-g++ {
LIBS += ../../../../lib/linux-g++/libminiupnpc.a LIBS += ../../../../lib/linux-g++/libminiupnpc.a
LIBS += ../../../../lib/linux-g++/libssl.a LIBS += ../../../../lib/linux-g++/libssl.a
LIBS += ../../../../lib/linux-g++/libcrypto.a LIBS += ../../../../lib/linux-g++/libcrypto.a
LIBS += -lz LIBS += -lpthread -lz
} }
linux-g++-64 { linux-g++-64 {
OBJECTS_DIR = temp/linux-g++-64/obj OBJECTS_DIR = temp/linux-g++-64/obj