initial checkin. not part of tinderbox. r=dbragg
git-svn-id: svn://10.0.0.236/trunk@54190 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a51e13d781
commit
89257ed01f
35
mozilla/xpinstall/packager/common/share.t
Normal file
35
mozilla/xpinstall/packager/common/share.t
Normal file
@ -0,0 +1,35 @@
|
||||
// this function verifies disk space in kilobytes
|
||||
function verifyDiskSpace(dirPath, spaceRequired)
|
||||
{
|
||||
var spaceAvailable;
|
||||
|
||||
// Get the available disk space on the given path
|
||||
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
|
||||
|
||||
// Convert the available disk space into kilobytes
|
||||
spaceAvailable = parseInt(spaceAvailable / 1024);
|
||||
|
||||
// do the verification
|
||||
if(spaceAvailable < spaceRequired)
|
||||
{
|
||||
logComment("Insufficient disk space: " + dirPath);
|
||||
logComment(" required : " + spaceRequired + " K");
|
||||
logComment(" available: " + spaceAvailable + " K");
|
||||
abortInstall(INSUFFICIENT_DISK_SPACE);
|
||||
return(false);
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
function checkError(errorValue)
|
||||
{
|
||||
if((errorValue != SUCCESS) && (errorValue != REBOOT_NEEDED))
|
||||
{
|
||||
abortInstall(errorValue);
|
||||
return(true);
|
||||
}
|
||||
|
||||
return(false);
|
||||
} // end checkError()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user