summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-06-09 01:34:26 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-06-09 01:34:26 +0200
commit468126e3030ac3db47e4c7d361badf99c338fdf4 (patch)
treed4e74209ab84acadc0d79b9b3729da27dbd9ce47
parent5a68ea79e4828bb5615b1d490fe811c18d04a8e1 (diff)
parent8a3a2e994e0e49fb5b610dba0f810b67f0ab229e (diff)
* merged some more missing bits
-rw-r--r--apt-pkg/depcache.cc8
-rwxr-xr-xcmdline/apt-mark1
2 files changed, 8 insertions, 1 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index ac667d51d..af2fd54c7 100644
--- a/apt-pkg/depcache.cc
+++ b/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;
}
diff --git a/cmdline/apt-mark b/cmdline/apt-mark
index dadc01366..fdc3e1856 100755
--- a/cmdline/apt-mark
+++ b/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)