Fixed to make the command portable on BSD/Solaris.
This commit is contained in:
@@ -43,10 +43,10 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
|
||||
public function getRepositorySize()
|
||||
{
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
|
||||
.escapeshellarg($this->repo);
|
||||
$out = split(' ', shell_exec($cmd), 2);
|
||||
return (int) $out[0];
|
||||
return (int) $out[0]*1024;
|
||||
}
|
||||
|
||||
public function isAvailable()
|
||||
|
@@ -35,10 +35,10 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
|
||||
public function getRepositorySize()
|
||||
{
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
|
||||
.escapeshellarg($this->repo);
|
||||
$out = split(' ', shell_exec($cmd), 2);
|
||||
return (int) $out[0];
|
||||
return (int) $out[0]*1024;
|
||||
}
|
||||
|
||||
public static function factory($project)
|
||||
|
@@ -56,10 +56,10 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
if (strpos($this->repo, 'file://') !== 0) {
|
||||
return -1;
|
||||
}
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
|
||||
.escapeshellarg(substr($this->repo, 7));
|
||||
$out = split(' ', shell_exec($cmd), 2);
|
||||
return (int) $out[0];
|
||||
return (int) $out[0]*1024;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user