Hello community,

here is the log from the commit of package libstorage for openSUSE:Factory 
checked in at 2012-06-25 12:35:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage/libstorage.changes    2012-06-13 
22:48:08.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libstorage.new/libstorage.changes       
2012-06-25 12:35:37.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Jun 18 14:21:12 CEST 2012 - [email protected]
+
+- 2.22.6
+- check for existence of all used binaries
+
+-------------------------------------------------------------------

Old:
----
  libstorage-2.22.5.tar.bz2

New:
----
  libstorage-2.22.6.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libstorage.spec ++++++
--- /var/tmp/diff_new_pack.LPQfHN/_old  2012-06-25 12:35:39.000000000 +0200
+++ /var/tmp/diff_new_pack.LPQfHN/_new  2012-06-25 12:35:39.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           libstorage
-Version:        2.22.5
+Version:        2.22.6
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source:         libstorage-%{version}.tar.bz2

++++++ libstorage-2.22.5.tar.bz2 -> libstorage-2.22.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/VERSION 
new/libstorage-2.22.6/VERSION
--- old/libstorage-2.22.5/VERSION       2012-06-12 11:08:14.000000000 +0200
+++ new/libstorage-2.22.6/VERSION       2012-06-19 11:07:17.000000000 +0200
@@ -1 +1 @@
-2.22.5
+2.22.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/AppUtil.cc 
new/libstorage-2.22.6/storage/AppUtil.cc
--- old/libstorage-2.22.5/storage/AppUtil.cc    2012-06-13 11:14:03.000000000 
+0200
+++ new/libstorage-2.22.6/storage/AppUtil.cc    2012-06-19 12:08:57.000000000 
+0200
@@ -36,6 +36,7 @@
 #include "storage/AsciiFile.h"
 #include "storage/Storage.h"
 #include "storage/StorageTmpl.h"
+#include "storage/StorageDefines.h"
 #include "storage/AppUtil.h"
 #include "storage/StorageTypes.h"
 
@@ -367,6 +368,17 @@
         pfc( level, component, file, line, func, stream->str() );
     delete stream;
     }
+
+static FILE* logf = NULL;
+
+static void close_logf()
+    {
+    if( logf )
+        {
+        fclose(logf);
+        logf=NULL;
+        }
+    }
     
 void defaultLogDo( int level, const string& comp, const char* file,
                    int line, const char* fct, const string& content )
@@ -377,22 +389,25 @@
         << "(" << fct << "):" << line;
     string prefix = pfx.str();
 
-    FILE* f = fopen(filename.c_str(), "a");
+    if( !logf )
+        {
+        logf = fopen(filename.c_str(), "a");
+        setlinebuf(logf);
+        atexit( close_logf );
+        }
 
     string::size_type pos1 = 0;
 
-    while( true && f )
+    while( true && logf )
         {
         string::size_type pos2 = content.find('\n', pos1);;
         if (pos2 != string::npos || pos1 != content.length())
-            fprintf(f, "%s - %s\n", prefix.c_str(), 
+            fprintf(logf, "%s - %s\n", prefix.c_str(), 
                     content.substr(pos1, pos2 - pos1).c_str());
         if (pos2 == string::npos)
             break;
         pos1 = pos2 + 1;
         }
-    if(f)
-        fclose(f);
     }
 
 
@@ -667,6 +682,34 @@
        return s << fixed << double(tv.tv_sec) + (double)(tv.tv_usec) / 
1000000.0 << "s";
     }
 
+void checkBinPaths( const string& arch, bool instsys )
+    {
+    y2mil( "Arch:" << arch << " Instsys:" << instsys );
+    list<string> ign;
+    list<string> s390;
+    const char* pathes[] = { 
+#include "./gen_pathlist.cc"
+                           };
+    ign.push_back( PORTMAPBIN );
+    if( !boost::starts_with(arch,"s390") )
+        {
+        ign.push_back( FDASDBIN );
+        ign.push_back( DASDVIEWBIN );
+        ign.push_back( DASDFMTBIN );
+        }
+    y2mil( "ign:" << ign );
+    LogLevel level = instsys?storage::ERROR:storage::MILESTONE;
+    for( unsigned i=0; i<lengthof(pathes); i++ )
+        {
+        if( !contains( ign, pathes[i] ))
+            {
+            if( access( pathes[i], X_OK )!=0 )
+                y2log_op( level, __FILE__, __LINE__, __FUNCTION__,
+                          "error accessing:" << pathes[i] );
+            }
+        }
+    }
+
 
 const string app_ws = " \t\n";
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/AppUtil.h 
new/libstorage-2.22.6/storage/AppUtil.h
--- old/libstorage-2.22.5/storage/AppUtil.h     2012-06-12 14:04:59.000000000 
+0200
+++ new/libstorage-2.22.6/storage/AppUtil.h     2012-06-19 12:04:01.000000000 
+0200
@@ -43,6 +43,7 @@
 void createPath(const string& Path_Cv);
 bool checkNormalFile(const string& Path_Cv);
 bool checkDir(const string& Path_Cv);
+void checkBinPaths( const string& arch, bool instsys );
 bool getStatMode(const string& Path_Cv, mode_t& val );
 bool setStatMode(const string& Path_Cv, mode_t val );
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/Disk.cc 
new/libstorage-2.22.6/storage/Disk.cc
--- old/libstorage-2.22.5/storage/Disk.cc       2012-06-12 13:37:04.000000000 
+0200
+++ new/libstorage-2.22.6/storage/Disk.cc       2012-06-19 11:07:17.000000000 
+0200
@@ -431,23 +431,18 @@
     }
 
 int
-Disk::execCheckFailed( const string& cmd_line, bool stop_hald )
+Disk::execCheckFailed( const string& cmd_line )
     {
     static SystemCmd cmd;
-    return( execCheckFailed( cmd, cmd_line, stop_hald ) );
+    return( execCheckFailed( cmd, cmd_line ) );
     }
 
-int Disk::execCheckFailed( SystemCmd& cmd, const string& cmd_line, 
-                           bool stop_hald )
+int Disk::execCheckFailed( SystemCmd& cmd, const string& cmd_line )
     {
-    if( stop_hald )
-       getStorage()->handleHald(true);
     cmd.execute( cmd_line );
     int ret = checkSystemError( cmd_line, cmd );
     if( ret!=0 )
        setExtError( cmd );
-    if( stop_hald )
-       getStorage()->handleHald(false);
     return( ret );
     }
 
@@ -1918,7 +1913,6 @@
                cmd_line << "ext2 ";
                }
            }
-       getStorage()->handleHald(true);
        if( ret==0 )
            {
            unsigned long start = p->cylStart();
@@ -1964,13 +1958,13 @@
            string save = cmd_line.str();
            y2mil( "end:" << end << " cylinders:" << cylinders() );
            string tmp = save + decString(start) + ' ' + decString(end);
-           if( execCheckFailed( tmp, false ) )
+           if( execCheckFailed( tmp ) )
                {
                tmp = save + decString(start+1) + ' ' + decString(end+1);
-               if( execCheckFailed( tmp, false ))
+               if( execCheckFailed( tmp ))
                    {
                    tmp = save + decString(start) + ' ' + decString(end-1);
-                   if( execCheckFailed( tmp, false ) )
+                   if( execCheckFailed( tmp ) )
                        {
                        ret = DISK_CREATE_PARTITION_PARTED_FAILED;
                        }
@@ -1983,7 +1977,6 @@
            if( !getPartedValues( p ))
                ret = DISK_PARTITION_NOT_FOUND;
            }
-       getStorage()->handleHald(false);
        if( ret==0 && !dmp_slave )
            {
            if( p->type()!=EXTENDED )
@@ -2054,15 +2047,13 @@
            std::ostringstream cmd_line;
            classic(cmd_line);
            cmd_line << PARTEDCMD << quote(device()) << " rm " << p->OrigNr();
-           getStorage()->handleHald(true);
-           if( execCheckFailed( cmd_line.str(), false ) )
+           if( execCheckFailed( cmd_line.str() ) )
                {
                ret = DISK_REMOVE_PARTITION_PARTED_FAILED;
                }
            ProcParts parts;
            if( parts.findDevice(getPartName(p->OrigNr())) )
                callDelpart( p->OrigNr() );
-           getStorage()->handleHald(false);
            }
        if( ret==0 )
            {
@@ -2329,8 +2320,7 @@
            cmd_line << "YAST_IS_RUNNING=1 " << PARTEDCMD << quote(device())
                     << " unit s resize " << p->nr() << " "
                     << start_sect << " " << end_sect;
-           getStorage()->handleHald(true);
-           if( execCheckFailed( cmd_line.str(), false ) )
+           if( execCheckFailed( cmd_line.str() ) )
                {
                ret = DISK_RESIZE_PARTITION_PARTED_FAILED;
                }
@@ -2339,7 +2329,6 @@
                if( ret==0 )
                    ret = DISK_PARTITION_NOT_FOUND;
                }
-           getStorage()->handleHald(false);
            if( ret==0 && !dmp_slave )
                Storage::waitForDevice(p->device());
            y2mil("after resize size:" << p->sizeK() << " resize:" << 
(p->needShrink()||p->needExtend()));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/Disk.h 
new/libstorage-2.22.6/storage/Disk.h
--- old/libstorage-2.22.5/storage/Disk.h        2011-12-22 12:04:49.000000000 
+0100
+++ new/libstorage-2.22.6/storage/Disk.h        2012-06-19 11:07:17.000000000 
+0200
@@ -232,9 +232,8 @@
        virtual bool detectPartitions(SystemInfo& systeminfo);
        bool getSysfsInfo();
        int checkSystemError( const string& cmd_line, const SystemCmd& cmd ) 
const;
-       int execCheckFailed( const string& cmd_line, bool stop_hald=true );
-       int execCheckFailed( SystemCmd& cmd, const string& cmd_line,
-                            bool stop_hald=true );
+       int execCheckFailed( const string& cmd_line );
+       int execCheckFailed( SystemCmd& cmd, const string& cmd_line );
        bool checkPartedOutput(SystemInfo& systeminfo);
        list<string> partitionsKernelKnowns(const ProcParts& parts) const;
        bool checkPartedValid(SystemInfo& systeminfo, list<Partition*>& pl,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/FreeInfo.cc 
new/libstorage-2.22.6/storage/FreeInfo.cc
--- old/libstorage-2.22.5/storage/FreeInfo.cc   2011-10-31 18:18:22.000000000 
+0100
+++ new/libstorage-2.22.6/storage/FreeInfo.cc   2012-06-19 11:07:17.000000000 
+0200
@@ -23,6 +23,7 @@
 #include <glob.h>
 
 #include "storage/FreeInfo.h"
+#include "storage/StorageDefines.h"
 #include "storage/Volume.h"
 #include "storage/SystemCmd.h"
 
@@ -190,7 +191,7 @@
 
        if (ret && vol.getFs() == NTFS)
        {
-           SystemCmd c("/usr/sbin/ntfsresize -f -i " + quote(vol.device()));
+           SystemCmd c( NTFSRESIZEBIN " -f -i " + quote(vol.device()));
            string fstr = " might resize at ";
            string::size_type pos;
            string stdout = boost::join(c.stdout(), "\n");
@@ -240,7 +241,7 @@
        if( content_info.homes==0 && 
            (vol.getFs()==EXT2 || vol.getFs()==EXT3 || vol.getFs()==EXT4 ))
            {
-           SystemCmd c( "/sbin/tune2fs -l " + vol.mountDevice() + " | grep 
'^Last mounted on:'" );
+           SystemCmd c( TUNE2FSBIN " -l " + vol.mountDevice() + " | " GREPBIN 
" '^Last mounted on:'" );
            if( c.retcode()==0 && c.numLines()>0 )
                {
                string line = c.getLine(0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/Makefile.am 
new/libstorage-2.22.6/storage/Makefile.am
--- old/libstorage-2.22.5/storage/Makefile.am   2012-06-11 12:27:02.000000000 
+0200
+++ new/libstorage-2.22.6/storage/Makefile.am   2012-06-19 11:07:17.000000000 
+0200
@@ -68,6 +68,11 @@
 libstorage_la_LDFLAGS = -version-info @LIBVERSION_INFO@
 libstorage_la_LIBADD = -lxml2
 
+$(srcdir)/gen_pathlist.cc: StorageDefines.h
+       grep BIN $< | sed -e "/PARTEDCMD/d" -e "s/^[^ ]*[ ]\+//" -e "s/ .*/,/" 
>$@
+
+BUILT_SOURCES = gen_pathlist.cc
+
 pkgincludedir = $(includedir)/storage
 
 pkginclude_HEADERS =                   \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/Makefile.in 
new/libstorage-2.22.6/storage/Makefile.in
--- old/libstorage-2.22.5/storage/Makefile.in   2012-06-13 14:26:51.000000000 
+0200
+++ new/libstorage-2.22.6/storage/Makefile.in   2012-06-19 11:09:34.000000000 
+0200
@@ -345,13 +345,15 @@
 
 libstorage_la_LDFLAGS = -version-info @LIBVERSION_INFO@
 libstorage_la_LIBADD = -lxml2
+BUILT_SOURCES = gen_pathlist.cc
 pkginclude_HEADERS = \
        StorageVersion.h                \
        StorageInterface.h              \
        HumanString.h                   \
        Graph.h
 
-all: all-am
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
 .SUFFIXES: .cc .lo .o .obj
@@ -616,13 +618,15 @@
          fi; \
        done
 check-am: all-am
-check: check-am
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs:
        for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -647,6 +651,7 @@
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 clean: clean-am
 
 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
@@ -718,7 +723,7 @@
 
 uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS
 
-.MAKE: install-am install-strip
+.MAKE: all check install install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
        clean-libLTLIBRARIES clean-libtool ctags distclean \
@@ -736,6 +741,9 @@
        uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS
 
 
+$(srcdir)/gen_pathlist.cc: StorageDefines.h
+       grep BIN $< | sed -e "/PARTEDCMD/d" -e "s/^[^ ]*[ ]\+//" -e "s/ .*/,/" 
>$@
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/Storage.cc 
new/libstorage-2.22.6/storage/Storage.cc
--- old/libstorage-2.22.5/storage/Storage.cc    2012-06-11 17:01:37.000000000 
+0200
+++ new/libstorage-2.22.6/storage/Storage.cc    2012-06-19 12:04:13.000000000 
+0200
@@ -105,8 +105,6 @@
     y2mil("constructed Storage with " << env);
     y2mil("libstorage version " VERSION);
 
-    hald_pid = 0;
-
     max_log_num = 5;
     const char* tenv = getenv("Y2MAXLOGNUM");
     if (tenv)
@@ -220,6 +218,9 @@
        y2mil(archinfo);
     }
 
+    if( !testmode() )
+        checkBinPaths( archinfo.arch, instsys() );
+
     if (instsys())
     {
        decideMultipath();
@@ -4366,14 +4367,14 @@
     if( instsys() )
        {
        SystemCmd c;
-       string prog_name = "/sbin/rpcbind";
+       string prog_name = RPCBINDBIN;
 
        //We don't have rpcbind (#423026, #427428) ...
        if ( !checkNormalFile(prog_name) )
        {
            //... so let's try portmap instead
            y2mil("No rpcbind found, trying portmap instead ...");
-           prog_name = "/sbin/portmap";
+           prog_name = PORTMAPBIN;
        }
 
        c.execute( prog_name );
@@ -4977,33 +4978,6 @@
     y2mil(b.str());
     }
 
-void Storage::handleHald( bool stop )
-    {
-    y2mil( "stop:" << stop );
-    int ret;
-    if( stop )
-       {
-       hald_pid = 0;
-       SystemCmd c( "ps ax | grep -w /usr/sbin/hald | grep -v grep" );
-       if( c.numLines()>0 )
-           {
-           extractNthWord( 0, c.getLine(0) ) >> hald_pid;
-           y2mil( "hald_pid:" << hald_pid );
-           }
-       if( hald_pid>0 )
-           {
-           ret = kill( hald_pid, SIGSTOP );
-           y2mil( "ret kill:" << ret << " pid:" << hald_pid );
-           }
-       }
-    else if( !stop && hald_pid>0 )
-       {
-       ret = kill( hald_pid, SIGCONT );
-       y2mil( "ret kill:" << ret << " pid:" << hald_pid );
-       }
-    }
-
-
 static bool notLoop( const Container& c ) { return( c.type()!=LOOP ); }
 static bool fstabAdded( const Volume& v ) { return( v.fstabAdded()); }
 
@@ -5834,7 +5808,7 @@
 void Storage::removeDmTableTo( unsigned long mjr, unsigned long mnr )
     {
     y2mil( "mjr:" << mjr << " mnr:" << mnr );
-    string cmd = DMSETUPBIN " table | grep -w ";
+    string cmd = DMSETUPBIN " table | " GREPBIN " -w ";
     cmd += decString(mjr) + ":" + decString(mnr);
     cmd += " | sed s/:.*// | uniq";
     SystemCmd c( cmd );
@@ -5884,7 +5858,7 @@
        c.execute(DMSETUPBIN " remove " + quote(table));
        waitForDevice();
        ret = c.retcode()==0;
-       c.execute(DMSETUPBIN " table | grep " + quote(table));
+       c.execute(DMSETUPBIN " table | " GREPBIN " " + quote(table));
        logProcData();
        }
     y2mil("ret:" << ret);
@@ -7508,7 +7482,7 @@
 void
 Storage::waitForDevice()
 { 
-    string cmd(UDEVADM " settle --timeout=20");
+    string cmd(UDEVADMBIN " settle --timeout=20");
     y2mil("calling prog:" << cmd);
     SystemCmd c(cmd);
     y2mil("returned prog:" << cmd << " retcode:" << c.retcode());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/Storage.h 
new/libstorage-2.22.6/storage/Storage.h
--- old/libstorage-2.22.5/storage/Storage.h     2012-06-11 17:51:25.000000000 
+0200
+++ new/libstorage-2.22.6/storage/Storage.h     2012-06-19 11:07:17.000000000 
+0200
@@ -579,8 +579,6 @@
 
        string getErrorString(int error) const;
 
-       void handleHald( bool stop );
-
        void activateHld(bool val = true);
        void activateMultipath(bool val = true);
 
@@ -2125,7 +2123,6 @@
        bool root_mounted;
        string tempdir;
        string rootprefix;
-       unsigned hald_pid;
 
        ArchInfo archinfo;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/StorageDefines.h 
new/libstorage-2.22.6/storage/StorageDefines.h
--- old/libstorage-2.22.5/storage/StorageDefines.h      2012-03-12 
17:07:20.000000000 +0100
+++ new/libstorage-2.22.6/storage/StorageDefines.h      2012-06-19 
11:07:17.000000000 +0200
@@ -79,9 +79,39 @@
 #define DASDVIEWBIN "/sbin/dasdview"
 #define FDASDBIN "/sbin/fdasd"
 
-#define UDEVADM "/sbin/udevadm"
+#define UDEVADMBIN "/sbin/udevadm"
 
 #define MODPROBEBIN "/sbin/modprobe"
+#define PSBIN          "/bin/ps"
+#define GREPBIN        "/usr/bin/grep"
+#define PORTMAPBIN     "/sbin/portmap"
+#define RPCBINDBIN     "/sbin/rpcbind"
 
+#define NTFSRESIZEBIN "/usr/sbin/ntfsresize"
+#define XFSGROWFSBIN  "/usr/sbin/xfs_growfs"
+#define REISERRESBIN  "/sbin/resize_reiserfs"
+#define EXT2RESIZEBIN "/sbin/resize2fs"
+
+#define TUNE2FSBIN     "/sbin/tune2fs"
+#define TUNEREISERBIN  "/sbin/reiserfstune"
+#define TUNEJFSBIN     "/sbin/jfs_tune"
+#define XFSADMINBIN    "/usr/sbin/xfs_admin"
+
+#define FSCKBIN        "/sbin/fsck"
+#define FSCKEXT2BIN    "/sbin/fsck.ext2"
+#define FSCKEXT3BIN    "/sbin/fsck.ext3"
+#define FSCKEXT4BIN    "/sbin/fsck.ext4"
+#define FSCKJFSBIN     "/sbin/fsck.jfs"
+#define FSCKXFSBIN     "/usr/sbin/xfs_check"
+#define FSCKREISERBIN  "/sbin/reiserfsck"
+
+#define MKSWAPBIN      "/sbin/mkswap"
+#define HFORMATBIN     "/usr/bin/hformat"
+#define MKFSXFSBIN     "/sbin/mkfs.xfs"
+#define MKFSFATBIN     "/sbin/mkdosfs"
+#define MKFSJFSBIN     "/sbin/mkfs.jfs"
+#define MKFSREISERBIN  "/sbin/mkreiserfs"
+#define MKFSEXT2BIN    "/sbin/mke2fs"
+#define MKFSBTRFSBIN   "/sbin/mkfs.btrfs"
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.5/storage/Volume.cc 
new/libstorage-2.22.6/storage/Volume.cc
--- old/libstorage-2.22.5/storage/Volume.cc     2012-06-11 12:31:33.000000000 
+0200
+++ new/libstorage-2.22.6/storage/Volume.cc     2012-06-19 11:07:17.000000000 
+0200
@@ -836,7 +836,7 @@
     int ret = 0;
     SystemCmd c;
     string defvol = getStorage()->getDefaultSubvolName();
-    string cmd = "/sbin/mkfs.btrfs " + quote(mountDevice());
+    string cmd = MKFSBTRFSBIN " " + quote(mountDevice());
     c.execute( cmd );
     if( c.retcode()!=0 )
        {
@@ -969,44 +969,44 @@
        switch( fs )
            {
            case EXT2:  
-               cmd = "/sbin/mke2fs";
+               cmd = MKFSEXT2BIN;
                params = "-t ext2 -v";
                progressbar = new Mke2fsProgressBar( cb );
                break;
            case EXT3:
-               cmd = "/sbin/mke2fs";
+               cmd = MKFSEXT2BIN;
                params = "-t ext3 -v";
                progressbar = new Mke2fsProgressBar( cb );
                break;
            case EXT4:
-               cmd = "/sbin/mke2fs";
+               cmd = MKFSEXT2BIN;
                params = "-t ext4 -v";
                progressbar = new Mke2fsProgressBar( cb );
                break;
            case REISERFS:
-               cmd = "/sbin/mkreiserfs";
+               cmd = MKFSREISERBIN;
                params = "-f -f";
                progressbar = new ReiserProgressBar( cb );
                break;
            case VFAT:
-               cmd = "/sbin/mkdosfs";
+               cmd = MKFSFATBIN;
                break;
            case JFS:
-               cmd = "/sbin/mkfs.jfs";
+               cmd = MKFSJFSBIN;
                params = "-q";
                break;
            case HFS:
-               cmd = "/usr/bin/hformat";
+               cmd = HFORMATBIN;
                break;
            case HFSPLUS:
                ret = VOLUME_FORMAT_NOT_IMPLEMENTED;
                break;
            case XFS:
-               cmd = "/sbin/mkfs.xfs";
+               cmd = MKFSXFSBIN;
                params = "-q -f";
                break;
            case SWAP:
-               cmd = "/sbin/mkswap";
+               cmd = MKSWAPBIN;
                params = "-f";
                break;
            default:
@@ -1048,7 +1048,7 @@
            {
                if (!tunefs_opt.empty())
                {
-                   string cmd = "/sbin/tune2fs " + tunefs_opt + " " + 
quote(mountDevice());
+                   string cmd = TUNE2FSBIN " " + tunefs_opt + " " + 
quote(mountDevice());
                    SystemCmd c( cmd );
                    if( c.retcode()!=0 )
                        ret = VOLUME_TUNE2FS_FAILED;
@@ -1058,7 +1058,7 @@
                    (fstab_opt.find( "data=writeback" )!=string::npos ||
                     fstab_opt.find( "data=journal" )!=string::npos) )
                {
-                   string cmd = "/sbin/tune2fs -o ";
+                   string cmd = TUNE2FSBIN " -o ";
                    if( fstab_opt.find( "data=writeback" )!=string::npos )
                        cmd += "journal_data_writeback ";
                    else
@@ -1075,7 +1075,7 @@
            {
                if (!tunefs_opt.empty())
                {
-                   string cmd = "/sbin/reiserfstune " + tunefs_opt + " " + 
quote(mountDevice());
+                   string cmd = TUNEREISERBIN " " + tunefs_opt + " " + 
quote(mountDevice());
                    SystemCmd c( cmd );
                    if( c.retcode()!=0 )
                        ret = VOLUME_TUNEREISERFS_FAILED;
@@ -1510,7 +1510,7 @@
        switch( fs )
            {
            case SWAP:
-               cmd = "/sbin/mkswap";
+               cmd = MKSWAPBIN;
                if (!label.empty())
                    cmd += " -L " + quote(label);
                if (!uuid.empty())
@@ -1521,7 +1521,7 @@
                    ret = VOLUME_RESIZE_FAILED;
                break;
            case REISERFS:
-               cmd = "/sbin/resize_reiserfs -f ";
+               cmd = REISERRESBIN " -f ";
                if( needShrink() )
                    {
                    cmd = "echo y | " + cmd;
@@ -1536,7 +1536,7 @@
                    }
                break;
            case NTFS:
-               cmd = "echo y | /usr/sbin/ntfsresize -f ";
+               cmd = "echo y | " NTFSRESIZEBIN " -f ";
                if( needShrink() )
                    cmd += "-s " + decString(size_k) + "k ";
                cmd += quote(mountDevice());
@@ -1552,7 +1552,7 @@
            case EXT2:
            case EXT3:
            case EXT4:
-               cmd = "/sbin/resize2fs -f " + quote(mountDevice());
+               cmd = EXT2RESIZEBIN " -f " + quote(mountDevice());
                if( needShrink() )
                    cmd += " " + decString(size_k) + "K";
                c.execute( cmd );
@@ -1578,7 +1578,7 @@
                    }
                if( ret==0 )
                    {
-                   cmd = "/usr/sbin/xfs_growfs " + quote(mpoint);
+                   cmd = XFSGROWFSBIN " " + quote(mpoint);
                    c.execute( cmd );
                    if( c.retcode()!=0 )
                        {
@@ -2087,25 +2087,25 @@
                switch( detected_fs )
                    {
                    case EXT2:
-                       cmd = "/sbin/fsck.ext2 -n -f " + quote(use_dev);
+                       cmd = FSCKEXT2BIN " -n -f " + quote(use_dev);
                        break;
                    case EXT3:
-                       cmd = "/sbin/fsck.ext3 -n -f " + quote(use_dev);
+                       cmd = FSCKEXT3BIN " -n -f " + quote(use_dev);
                        break;
                    case EXT4:
-                       cmd = "/sbin/fsck.ext4 -n -f " + quote(use_dev);
+                       cmd = FSCKEXT4BIN " -n -f " + quote(use_dev);
                        break;
                    case REISERFS:
-                       cmd = "reiserfsck --yes --check -q " + quote(use_dev);
+                       cmd = FSCKREISERBIN " --yes --check -q " + 
quote(use_dev);
                        break;
                    case XFS:
-                       cmd = "xfs_check " + quote(use_dev);
+                       cmd = FSCKXFSBIN " " + quote(use_dev);
                        break;
                    case JFS:
-                       cmd = "fsck.jfs -n " + quote(use_dev);
+                       cmd = FSCKJFSBIN " -n " + quote(use_dev);
                        break;
                    default:
-                       cmd = "fsck -n -t " + toString(detected_fs) + " " + 
quote(use_dev);
+                       cmd = FSCKBIN " -n -t " + toString(detected_fs) + " " + 
quote(use_dev);
                        break;
                    }
                bool excTime, excLines;
@@ -2317,7 +2317,7 @@
                    if( cmd.retcode()!=0 )
                        ret = VOLUME_CRYPTFORMAT_FAILED;
                    if( ret==0 && mp=="swap" && crypt_pwd.empty() && !format )
-                       cmd.execute("/sbin/mkswap " + quote(dmcrypt_dev));
+                       cmd.execute( MKSWAPBIN " " + quote(dmcrypt_dev));
                    }
                }
            if( ret==0 && (!isTmpCryptMp(mp)||!crypt_pwd.empty()) )
@@ -2465,24 +2465,24 @@
            case EXT2:
            case EXT3:
            case EXT4:
-               cmd = "/sbin/tune2fs -L " + quote(label) + " " + 
quote(mountDevice());
+               cmd = TUNE2FSBIN " -L " + quote(label) + " " + 
quote(mountDevice());
                break;
            case REISERFS:
-               cmd = "/sbin/reiserfstune -l " + quote(label) + " " + 
quote(mountDevice());
+               cmd = TUNEREISERBIN " -l " + quote(label) + " " + 
quote(mountDevice());
                break;
            case JFS:
-               cmd = "/sbin/jfs_tune -L " + quote(label) + " " + 
quote(mountDevice());
+               cmd = TUNEJFSBIN " -L " + quote(label) + " " + 
quote(mountDevice());
                break;
            case XFS:
                {
                string tlabel = label;
                if( label.empty() )
                    tlabel = "--";
-               cmd = "/usr/sbin/xfs_admin -L " + quote(tlabel) + " " + 
quote(mountDevice());
+               cmd = XFSADMINBIN " -L " + quote(tlabel) + " " + 
quote(mountDevice());
                }
                break;
            case SWAP:
-               cmd = "/sbin/mkswap -L " + quote(label);
+               cmd = MKSWAPBIN " -L " + quote(label);
                if (!uuid.empty())
                    cmd += " -U " + quote(uuid);
                cmd += " " + quote(mountDevice());

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to