Changeset 2932

Show
Ignore:
Timestamp:
10/22/08 10:40:56 (17 months ago)
Author:
kris
Message:

Fixed a bug in the pbidelete tool, which would cause the program to finish, before the actual /Programs/<PBI> directory
was completely removed. This causes other programs to fail, such as the SystemUpdater?, which depended upon an old PBI
being removed completely before starting the install of the new PBI.

Location:
pcbsd
Files:
2 removed
4 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/branches/7.0/PBIdelete/PBIdelete.pro

    r2800 r2932  
    88SOURCES += main.cpp 
    99 
    10 FORMS   = PBIdelete.ui 
     10//FORMS = PBIdelete.ui 
    1111 
    1212 
  • pcbsd/branches/7.0/PBIdelete/main.cpp

    r2261 r2932  
    1 #include <iostream.h> 
     1#include <iostream> 
    22#include <qvariant.h> 
    33#include <qapplication.h> 
     
    77#include <qobject.h> 
    88#include <qtextstream.h> 
     9using namespace std; 
    910 
    1011QString ProgName[5000]; 
     
    261262{ 
    262263    QString ProgDirName = RemovePBI; 
     264    QString command; 
    263265     
    264266    QString Binary; 
     
    266268    int i = 0; 
    267269  
    268     cout << "Removing Directory\n"; 
     270    cout << "Removing Directory: /Programs/" << ProgDirName.toStdString() << "\n"; 
    269271 
    270272    
     
    273275    { 
    274276        // Remove the hidden file 
    275         RemoveFile = new Q3Process(); 
    276         RemoveFile->addArgument( "rm" ); 
    277         RemoveFile->addArgument( "/usr/local/share/applnk/.hidden/" + MimeFile[RemNum][i] + ".desktop" );  
     277        command = "rm '/usr/local/share/applnk/.hidden/" + MimeFile[RemNum][i] + ".desktop' >/dev/null 2>/dev/null"; 
     278        getLineFromCommandOutput(command); 
    278279          
    279         if ( !RemoveFile->start() ) { 
    280                
    281         } 
    282          
    283280        // Remove the application file 
    284         RemoveFile = new Q3Process(); 
    285         RemoveFile->addArgument( "rm" ); 
    286         RemoveFile->addArgument( "/usr/local/share/mimelnk/application/" + MimeFile[RemNum][i] + ".desktop" );  
    287           
    288         if ( !RemoveFile->start() ) { 
    289                
    290         } 
     281        command = "rm '/usr/local/share/mimelnk/application/" + MimeFile[RemNum][i] + ".desktop' >/dev/null 2>/dev/null"; 
     282        getLineFromCommandOutput(command); 
    291283         
    292284        i++; 
     
    313305         
    314306        // Remove the script 
    315         RemoveFile = new Q3Process(); 
    316         RemoveFile->addArgument( "rm" ); 
    317         RemoveFile->addArgument( "/Programs/.sbin/" + Binary );  
     307        command = "rm '/Programs/.sbin/" + Binary + "' >/dev/null 2>/dev/null"; 
     308        getLineFromCommandOutput(command); 
    318309                    
    319         if ( !RemoveFile->start() ) { 
    320                
    321         } 
    322          
    323310 
    324311        // Remove the Desktop item 
    325         RemoveFile = new Q3Process(); 
    326         RemoveFile->addArgument( "/Programs/.bin/RemoveDesktopLink.sh" ); 
    327         RemoveFile->addArgument( Binary + ".desktop" );  
    328         RemoveFile->addArgument( ProgName[RemNum] );        
    329         if ( !RemoveFile->start() ) { 
    330                
    331         } 
     312        command = "/Programs/.bin/RemoveDesktopLink.sh '" + Binary + ".desktop' '" + ProgName[RemNum] + "' >/dev/null 2>/dev/null" ; 
     313        getLineFromCommandOutput(command); 
    332314 
    333315 
     
    336318     } 
    337319     
    338      
    339      
    340      
     320        // Remove the old start menu items 
     321        command = "rm -rf '/usr/local/share/applnk/My Programs/" + ProgName[RemNum] + "' >/dev/null 2>/dev/null"; 
     322        getLineFromCommandOutput(command); 
     323                    
    341324        // Remove the start menu item 
    342         RemoveFile = new Q3Process(); 
    343         RemoveFile->addArgument( "rm" ); 
    344         RemoveFile->addArgument( "-r" ); 
    345         RemoveFile->addArgument( "/usr/local/share/applnk/My Programs/" + ProgName[RemNum] );  
    346          
     325        command = "rm -rf '/usr/local/share/applnk/" + ProgName[RemNum] + "' >/dev/null 2>/dev/null"; 
     326        getLineFromCommandOutput(command); 
    347327 
    348328                    
    349         if ( !RemoveFile->start() ) { 
    350                
    351         } 
    352          
    353  
    354         // Remove the start menu item 
    355         RemoveFile = new Q3Process(); 
    356         RemoveFile->addArgument( "rm" ); 
    357         RemoveFile->addArgument( "-r" ); 
    358         RemoveFile->addArgument( "/usr/local/share/applnk/" + ProgName[RemNum] );  
    359          
    360  
    361                     
    362         if ( !RemoveFile->start() ) { 
    363                
    364         } 
    365  
    366  
    367329        // Remove the program folder 
    368         RemoveFile = new Q3Process(); 
    369         RemoveFile->addArgument( "rm" ); 
    370         RemoveFile->addArgument( "-r" ); 
    371         RemoveFile->addArgument( "/Programs/" + ProgDirName );  
    372          
    373                     
    374         if ( !RemoveFile->start() ) { 
    375                
    376         } 
     330        command = "rm -r '/Programs/" + ProgDirName + "' >/dev/null 2>/dev/null"; 
     331        getLineFromCommandOutput(command); 
     332 
    377333} 
    378334 
     
    382338{ 
    383339 
    384   cout << "PBIdelete Version 1.0\n--------\n" << " PBIdelete -remove <pbi> \t- Removes a PBI file\n PBIdelete -list \t\t- Lists all PBI's installed\n\n";  
     340  cout << "PBIdelete Version 1.1\n--------\n" << " PBIdelete -remove <pbi> \t- Removes a PBI file\n PBIdelete -list \t\t- Lists all PBI's installed\n\n";  
    385341 
    386342} 
  • pcbsd/trunk/PBIdelete/PBIdelete.pro

    r2798 r2932  
    88SOURCES += main.cpp 
    99 
    10 FORMS   = PBIdelete.ui 
     10//FORMS = PBIdelete.ui 
    1111 
    1212 
  • pcbsd/trunk/PBIdelete/main.cpp

    r2261 r2932  
    1 #include <iostream.h> 
     1#include <iostream> 
    22#include <qvariant.h> 
    33#include <qapplication.h> 
     
    77#include <qobject.h> 
    88#include <qtextstream.h> 
     9using namespace std; 
    910 
    1011QString ProgName[5000]; 
     
    261262{ 
    262263    QString ProgDirName = RemovePBI; 
     264    QString command; 
    263265     
    264266    QString Binary; 
     
    266268    int i = 0; 
    267269  
    268     cout << "Removing Directory\n"; 
     270    cout << "Removing Directory: /Programs/" << ProgDirName.toStdString() << "\n"; 
    269271 
    270272    
     
    273275    { 
    274276        // Remove the hidden file 
    275         RemoveFile = new Q3Process(); 
    276         RemoveFile->addArgument( "rm" ); 
    277         RemoveFile->addArgument( "/usr/local/share/applnk/.hidden/" + MimeFile[RemNum][i] + ".desktop" );  
     277        command = "rm '/usr/local/share/applnk/.hidden/" + MimeFile[RemNum][i] + ".desktop' >/dev/null 2>/dev/null"; 
     278        getLineFromCommandOutput(command); 
    278279          
    279         if ( !RemoveFile->start() ) { 
    280                
    281         } 
    282          
    283280        // Remove the application file 
    284         RemoveFile = new Q3Process(); 
    285         RemoveFile->addArgument( "rm" ); 
    286         RemoveFile->addArgument( "/usr/local/share/mimelnk/application/" + MimeFile[RemNum][i] + ".desktop" );  
    287           
    288         if ( !RemoveFile->start() ) { 
    289                
    290         } 
     281        command = "rm '/usr/local/share/mimelnk/application/" + MimeFile[RemNum][i] + ".desktop' >/dev/null 2>/dev/null"; 
     282        getLineFromCommandOutput(command); 
    291283         
    292284        i++; 
     
    313305         
    314306        // Remove the script 
    315         RemoveFile = new Q3Process(); 
    316         RemoveFile->addArgument( "rm" ); 
    317         RemoveFile->addArgument( "/Programs/.sbin/" + Binary );  
     307        command = "rm '/Programs/.sbin/" + Binary + "' >/dev/null 2>/dev/null"; 
     308        getLineFromCommandOutput(command); 
    318309                    
    319         if ( !RemoveFile->start() ) { 
    320                
    321         } 
    322          
    323310 
    324311        // Remove the Desktop item 
    325         RemoveFile = new Q3Process(); 
    326         RemoveFile->addArgument( "/Programs/.bin/RemoveDesktopLink.sh" ); 
    327         RemoveFile->addArgument( Binary + ".desktop" );  
    328         RemoveFile->addArgument( ProgName[RemNum] );        
    329         if ( !RemoveFile->start() ) { 
    330                
    331         } 
     312        command = "/Programs/.bin/RemoveDesktopLink.sh '" + Binary + ".desktop' '" + ProgName[RemNum] + "' >/dev/null 2>/dev/null" ; 
     313        getLineFromCommandOutput(command); 
    332314 
    333315 
     
    336318     } 
    337319     
    338      
    339      
    340      
     320        // Remove the old start menu items 
     321        command = "rm -rf '/usr/local/share/applnk/My Programs/" + ProgName[RemNum] + "' >/dev/null 2>/dev/null"; 
     322        getLineFromCommandOutput(command); 
     323                    
    341324        // Remove the start menu item 
    342         RemoveFile = new Q3Process(); 
    343         RemoveFile->addArgument( "rm" ); 
    344         RemoveFile->addArgument( "-r" ); 
    345         RemoveFile->addArgument( "/usr/local/share/applnk/My Programs/" + ProgName[RemNum] );  
    346          
     325        command = "rm -rf '/usr/local/share/applnk/" + ProgName[RemNum] + "' >/dev/null 2>/dev/null"; 
     326        getLineFromCommandOutput(command); 
    347327 
    348328                    
    349         if ( !RemoveFile->start() ) { 
    350                
    351         } 
    352          
    353  
    354         // Remove the start menu item 
    355         RemoveFile = new Q3Process(); 
    356         RemoveFile->addArgument( "rm" ); 
    357         RemoveFile->addArgument( "-r" ); 
    358         RemoveFile->addArgument( "/usr/local/share/applnk/" + ProgName[RemNum] );  
    359          
    360  
    361                     
    362         if ( !RemoveFile->start() ) { 
    363                
    364         } 
    365  
    366  
    367329        // Remove the program folder 
    368         RemoveFile = new Q3Process(); 
    369         RemoveFile->addArgument( "rm" ); 
    370         RemoveFile->addArgument( "-r" ); 
    371         RemoveFile->addArgument( "/Programs/" + ProgDirName );  
    372          
    373                     
    374         if ( !RemoveFile->start() ) { 
    375                
    376         } 
     330        command = "rm -r '/Programs/" + ProgDirName + "' >/dev/null 2>/dev/null"; 
     331        getLineFromCommandOutput(command); 
     332 
    377333} 
    378334 
     
    382338{ 
    383339 
    384   cout << "PBIdelete Version 1.0\n--------\n" << " PBIdelete -remove <pbi> \t- Removes a PBI file\n PBIdelete -list \t\t- Lists all PBI's installed\n\n";  
     340  cout << "PBIdelete Version 1.1\n--------\n" << " PBIdelete -remove <pbi> \t- Removes a PBI file\n PBIdelete -list \t\t- Lists all PBI's installed\n\n";  
    385341 
    386342}