Skip to content

Commit

Permalink
Fixed various versioning bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tux-mind committed Nov 1, 2014
1 parent 5822ee5 commit 085fe3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
15 changes: 5 additions & 10 deletions dSploit/src/it/evilsocket/dsploit/core/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,9 @@ private static String readFirstLine(String filePath) {
* @return the installed version of ruby
*/
public static String getLocalRubyVersion() {
if(mLocalRubyVersion!=null)
return mLocalRubyVersion;
String line = readFirstLine(getRubyPath() + "/VERSION");
if(line!=null)
return (mLocalRubyVersion = line);
return null;
if(mLocalRubyVersion==null)
mLocalRubyVersion = readFirstLine(getRubyPath() + "/VERSION");
return mLocalRubyVersion;
}

public static void updateLocalRubyVersion() {
Expand All @@ -716,10 +713,8 @@ public static void updateLocalRubyVersion() {
* @return the version of installed MetaSploit Framework
*/
public static String getLocalMsfVersion() {
if(mLocalMsfVersion!=null)
return mLocalMsfVersion;

mLocalMsfVersion = readFirstLine(getMsfPath() + "/VERSION");
if(mLocalMsfVersion==null)
mLocalMsfVersion = readFirstLine(getMsfPath() + "/VERSION");

return mLocalMsfVersion;
}
Expand Down
4 changes: 2 additions & 2 deletions dSploit/src/it/evilsocket/dsploit/core/UpdateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public static void setMsfBranch(String branch) {
mMsfRepoParser.setBranch(branch);
}
} catch (Exception e) {
Logger.error(e.getMessage());
Logger.error(e.getClass().getName() + ": " + e.getMessage());
}
}

Expand Down Expand Up @@ -376,7 +376,7 @@ public static boolean isMsfUpdateAvailable() {

exitForError = false;

if (!mMsfInfo.version.equals(localVersion))
if (localVersion == null || !localVersion.equals(mMsfInfo.versionString))
return true;
}
} catch (Exception e) {
Expand Down

0 comments on commit 085fe3d

Please sign in to comment.