changed statusmessage, fixed issue with exit_status and tested/confirmed
* src/ext2.cc, src/ext3.cc, src/fat16.cc, src/fat32.cc, src/jfs.cc, src/ntfs.cc, src/reiser4.cc, src/reiserfs.cc, src/xfs.cc: changed statusmessage, fixed issue with exit_status and tested/confirmed succesfull usage of Partition::get_path() in Set_Used_Sectors() of all filesystems.
This commit is contained in:
parent
1906a3ece8
commit
cb8ff87462
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2006-03-16 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
|
||||
* src/ext2.cc,
|
||||
src/ext3.cc,
|
||||
src/fat16.cc,
|
||||
src/fat32.cc,
|
||||
src/jfs.cc,
|
||||
src/ntfs.cc,
|
||||
src/reiser4.cc,
|
||||
src/reiserfs.cc,
|
||||
src/xfs.cc: changed statusmessage, fixed issue with exit_status and
|
||||
tested/confirmed succesfull usage of Partition::get_path() in
|
||||
Set_Used_Sectors() of all filesystems.
|
||||
|
||||
2006-03-15 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
|
||||
* include/Device.h,
|
||||
|
|
|
@ -136,10 +136,13 @@ bool ext2::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool ext2::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
if ( 1 >= execute_command( "e2fsck -f -y -v " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) >= 0 )
|
||||
exit_status = execute_command( "e2fsck -f -y -v " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) ;
|
||||
if ( exit_status == 0 || exit_status == 1 )
|
||||
{
|
||||
operation_details .back() .status = OperationDetails::SUCCES ;
|
||||
return true ;
|
||||
|
|
10
src/ext3.cc
10
src/ext3.cc
|
@ -137,11 +137,13 @@ bool ext3::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool ext3::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
//FIXME: i still need to check if the 1 >= x >= 0 structure actually works!
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
if ( 1 >= execute_command( "e2fsck -f -y -v " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) >= 0 )
|
||||
exit_status = execute_command( "e2fsck -f -y -v " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) ;
|
||||
if ( exit_status == 0 || exit_status == 1 )
|
||||
{
|
||||
operation_details .back() .status = OperationDetails::SUCCES ;
|
||||
return true ;
|
||||
|
|
|
@ -54,8 +54,7 @@ void fat16::Set_Used_Sectors( Partition & partition )
|
|||
{
|
||||
exit_status = Utils::execute_command( "dosfsck -a -v " + partition .get_path(), output, error, true ) ;
|
||||
if ( exit_status == 0 || exit_status == 1 )
|
||||
{//FIXME: does the output of these commands always display the path we've used for the input?
|
||||
//if not, we need to check for all paths in the output..
|
||||
{
|
||||
//free clusters
|
||||
index = output .find( ",", output .find( partition .get_path() ) + partition .get_path() .length() ) +1 ;
|
||||
if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%Ld/%Ld", &S, &N ) == 2 )
|
||||
|
@ -123,7 +122,9 @@ bool fat16::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool fat16::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
exit_status = execute_command( "dosfsck -a -w -v " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) ;
|
||||
|
|
|
@ -121,7 +121,9 @@ bool fat32::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool fat32::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
exit_status = execute_command( "dosfsck -a -w -v " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) ;
|
||||
|
|
|
@ -220,7 +220,9 @@ bool jfs::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool jfs::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
exit_status = execute_command( "jfs_fsck -f " + partition .get_path(), operation_details .back() .sub_details ) ;
|
||||
if ( exit_status == 0 || exit_status == 1 )
|
||||
|
|
|
@ -155,7 +155,9 @@ bool ntfs::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool ntfs::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
if ( ! execute_command( "ntfsresize -P -i -f -v " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) )
|
||||
|
|
|
@ -98,7 +98,9 @@ bool reiser4::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool reiser4::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
if ( ! execute_command( "fsck.reiser4 --yes --fix " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) )
|
||||
|
|
|
@ -143,8 +143,9 @@ bool reiserfs::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool reiserfs::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
//FIXME: change this description to 'check filesystem on /dev/blabla for er.. etc..'
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
exit_status = execute_command( "reiserfsck --y --fix-fixable " + partition .get_path(),
|
||||
operation_details .back() .sub_details ) ;
|
||||
|
|
|
@ -355,9 +355,11 @@ bool xfs::Copy( const Glib::ustring & src_part_path,
|
|||
|
||||
bool xfs::Check_Repair( const Partition & partition, std::vector<OperationDetails> & operation_details )
|
||||
{
|
||||
operation_details .push_back( OperationDetails( _("check filesystem for errors and (if possible) fix them") ) ) ;
|
||||
operation_details .push_back( OperationDetails(
|
||||
String::ucompose( _("check filesystem on %1 for errors and (if possible) fix them"),
|
||||
partition .get_path() ) ) ) ;
|
||||
|
||||
if ( ! execute_command ( "xfs_repair -v " + partition .get_path(), operation_details .back() .sub_details ) )
|
||||
if ( ! execute_command( "xfs_repair -v " + partition .get_path(), operation_details .back() .sub_details ) )
|
||||
{
|
||||
operation_details .back() .status = OperationDetails::SUCCES ;
|
||||
return true ;
|
||||
|
|
Loading…
Reference in New Issue