Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/sequenceParser/ItemStat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ void ItemStat::setPermissions( const mode_t& protection )
otherCanExecute = protection & S_IXOTH;
}

void ItemStat::setUserName()
void ItemStat::updateUserName()
{
passwd* user = getpwuid(userId);
if(user && user->pw_name)
userName = std::string(user->pw_name);
}

void ItemStat::setGroupName()
void ItemStat::updateGroupName()
{
group* group = getgrgid(groupId);
if(group && group->gr_name)
Expand Down Expand Up @@ -126,8 +126,8 @@ void ItemStat::statLink( const boost::filesystem::path& path )
// size on hard-drive (takes hardlinks into account)
sizeOnDisk = (statInfos.st_blocks / nbHardLinks) * statInfos.st_blksize;
setPermissions(statInfos.st_mode);
setUserName();
setGroupName();
updateUserName();
updateGroupName();
#else
fullNbHardLinks = nbHardLinks = 1;
#endif
Expand Down Expand Up @@ -161,8 +161,8 @@ void ItemStat::statFolder( const boost::filesystem::path& path )
maxSize = size;
sizeOnDisk = statInfos.st_blocks * statInfos.st_blksize;
setPermissions(statInfos.st_mode);
setUserName();
setGroupName();
updateUserName();
updateGroupName();
#endif

// size (takes hardlinks into account)
Expand Down Expand Up @@ -197,8 +197,8 @@ void ItemStat::statFile( const boost::filesystem::path& path )
// size on hard-drive (takes hardlinks into account)
sizeOnDisk = (statInfos.st_blocks / nbHardLinks) * statInfos.st_blksize;
setPermissions(statInfos.st_mode);
setUserName();
setGroupName();
updateUserName();
updateGroupName();
#endif

// size (takes hardlinks into account)
Expand All @@ -219,8 +219,8 @@ void ItemStat::statSequence( const Item& item, const bool approximative )
groupId = statInfos.st_gid;
accessTime = statInfos.st_atime;
setPermissions(statInfos.st_mode);
setUserName();
setGroupName();
updateUserName();
updateGroupName();
#endif

modificationTime = 0;
Expand Down
6 changes: 4 additions & 2 deletions src/sequenceParser/ItemStat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class ItemStat
void statLink( const boost::filesystem::path& path );
#ifdef __UNIX__
void setPermissions( const mode_t& protection );
void setUserName();
void setGroupName();
/// @brief Update user name from filesystem
void updateUserName();
/// @brief Update group name from filesystem
void updateGroupName();
#endif

public:
Expand Down
2 changes: 1 addition & 1 deletion src/sequenceParser/detail/analyze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ std::vector<Sequence> buildSequences( const boost::filesystem::path& directory,

std::size_t decomposeFilename( const std::string& filename, FileStrings& stringParts, FileNumbers& numberParts, const EDetection& options )
{
static const std::size_t max = std::numeric_limits<std::size_t>::digits10;
static const std::size_t max = std::numeric_limits<Time>::digits10;
std::string regex;
if( options & eDetectionNegative )
{
Expand Down
2 changes: 2 additions & 0 deletions test/java/StatLibraryTestMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ private static void displayFolderContent(ItemStat itemStat) {
System.out.println("Full Hard links : " + itemStat.getFullNbHardLinks());
System.out.println("Hardlinks : " + itemStat.getNbHardLinks());
System.out.println("Device : " + itemStat.getDeviceId());
System.out.println("Group : " + itemStat.getGroupName());
System.out.println("User : " + itemStat.getUserName());
}
}

Expand Down
28 changes: 0 additions & 28 deletions tools/docker/centos6/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions tools/docker/centos6/build.sh

This file was deleted.

29 changes: 29 additions & 0 deletions tools/docker/centos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM centos:7

#Install dependencies
RUN yum install -y wget cmake tar gcc gcc-c++ pcre-devel python-devel make zlib-devel bzip2-devel

#Install boost
RUN cd /opt/ && \
wget https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz && \
tar xzf boost_1_55_0.tar.gz && \
cd boost_1_55_0 && \
./bootstrap.sh && \
./b2 install --with=all && \
rm -rf boost_1_55_0.tar.gz && \
rm -rf boost_1_55_0.tar



#Install JAVA
RUN yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel

#Install Swig 2.0.11

RUN cd /opt/ && \
wget -O swig-2.0.11.tar.gz https://sourceforge.net/projects/swig/files/swig/swig-2.0.11/swig-2.0.11.tar.gz/download && \
tar xzf swig-2.0.11.tar.gz && \
cd swig-2.0.11 && \
./configure && \
make && make install && \
cd /opt/ && rm -rf swig-2.0.11*
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### How to compile with docker
```Shell
docker build -t sequenceparser:centos6 .
docker run -v <path to sequenceparser>:/opt/sequenceparser sequenceparser:centos6 /opt/sequenceparser/docker/centos6/build.sh
docker build -t sequenceparser:centos7 .
docker run -v <path to sequenceparser>:/opt/sequenceparser sequenceparser:centos7 /opt/sequenceparser/tools/docker/centos7/build.sh
```
The compiled libraries is installed into centos6 folder at root folder of sequenceparser repository
6 changes: 6 additions & 0 deletions tools/docker/centos7/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

cd /opt/sequenceparser
cmake . -DCMAKE_INSTALL_PREFIX=/opt/sequenceparser/install -DBOOST_ROOT=/usr/local/include/boost/
make
make install