Explorar el Código

* merged some more missing bits

Michael Vogt hace 19 años
padre
commit
468126e303
Se han modificado 2 ficheros con 8 adiciones y 1 borrados
  1. 7 1
      apt-pkg/depcache.cc
  2. 1 0
      cmdline/apt-mark

+ 7 - 1
apt-pkg/depcache.cc

@@ -23,6 +23,8 @@
 #include <sstream>    
 #include <set>
 
+#include <sys/stat.h>
+
 #include <apti18n.h>    
 
 pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) :
@@ -238,6 +240,9 @@ bool pkgDepCache::writeStateFile(OpProgress *prog)
 	       std::clog << "Skipping already written " << pkg.Name() << std::endl;
 	    continue;
 	 }
+         // skip not installed ones if requested
+         if(InstalledOnly && pkg->CurrentVer == 0)
+            continue;
 	 if(_config->FindB("Debug::pkgAutoRemove",false))
 	    std::clog << "Writing new AutoInstall: " 
 		      << pkg.Name() << std::endl;
@@ -250,8 +255,9 @@ bool pkgDepCache::writeStateFile(OpProgress *prog)
    }
    fclose(OutFile);
 
-   // move the outfile over the real file
+   // move the outfile over the real file and set permissions
    rename(outfile.c_str(), state.c_str());
+   chmod(state.c_str(), 0644);
 
    return true;
 }

+ 1 - 0
cmdline/apt-mark

@@ -62,3 +62,4 @@ if __name__ == "__main__":
         # all done, rename the tmpfile
         os.chmod(outfile.name, 0644)
         os.rename(outfile.name, STATE_FILE)
+        os.chmod(outfile.name, 0644)