projects
/
apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* apt-pkg/contrib/configuration.cc:
[apt.git]
/
cmdline
/
apt-get.cc
diff --git
a/cmdline/apt-get.cc
b/cmdline/apt-get.cc
index c9ec481aaa59ac9a8508515856273af522a0d666..486e995cc8343a7e93e6d0ab28f001bfa0699308 100644
(file)
--- a/
cmdline/apt-get.cc
+++ b/
cmdline/apt-get.cc
@@
-53,6
+53,7
@@
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/statfs.h>
#include <sys/statvfs.h>
#include <signal.h>
#include <unistd.h>
#include <sys/statvfs.h>
#include <signal.h>
#include <unistd.h>
@@
-63,6
+64,8
@@
#include <sstream>
/*}}}*/
#include <sstream>
/*}}}*/
+#define RAMFS_MAGIC 0x858458f6
+
using namespace std;
ostream c0out(0);
using namespace std;
ostream c0out(0);
@@
-861,8
+864,13
@@
bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
- return _error->Error(_("You don't have enough free space in %s."),
- OutputDir.c_str());
+ {
+ struct statfs Stat;
+ if (statfs(OutputDir.c_str(),&Stat) != 0 ||
+ unsigned(Stat.f_type) != RAMFS_MAGIC)
+ return _error->Error(_("You don't have enough free space in %s."),
+ OutputDir.c_str());
+ }
}
// Fail safe check
}
// Fail safe check
@@
-1708,9
+1716,10
@@
bool DoInstall(CommandLine &CmdL)
// where foo is marked automatic
if(!Remove &&
Cache[Pkg].Install() == false &&
// where foo is marked automatic
if(!Remove &&
Cache[Pkg].Install() == false &&
- (Cache[Pkg].Flags & pkgCache::Flag::Auto))
+ (Cache[Pkg].Flags & pkgCache::Flag::Auto) &&
+ _config->FindB("APT::Get::ReInstall",false) == false)
{
{
- ioprintf(c1out,_("%s set to manual installed.\n"),
+ ioprintf(c1out,_("%s set to manual
ly
installed.\n"),
Pkg.Name());
Cache->MarkAuto(Pkg,false);
AutoMarkChanged++;
Pkg.Name());
Cache->MarkAuto(Pkg,false);
AutoMarkChanged++;
@@
-2187,8
+2196,13
@@
bool DoSource(CommandLine &CmdL)
return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
- return _error->Error(_("You don't have enough free space in %s"),
- OutputDir.c_str());
+ {
+ struct statfs Stat;
+ if (statfs(OutputDir.c_str(),&Stat) != 0 ||
+ unsigned(Stat.f_type) != RAMFS_MAGIC)
+ return _error->Error(_("You don't have enough free space in %s"),
+ OutputDir.c_str());
+ }
// Number of bytes
if (DebBytes != FetchBytes)
// Number of bytes
if (DebBytes != FetchBytes)
@@
-2471,6
+2485,7
@@
bool DoBuildDep(CommandLine &CmdL)
break;
}
if (CV.end() == true)
break;
}
if (CV.end() == true)
+ {
if (hasAlternatives)
{
continue;
if (hasAlternatives)
{
continue;
@@
-2483,6
+2498,7
@@
bool DoBuildDep(CommandLine &CmdL)
Last->BuildDepType((*D).Type),Src.c_str(),
(*D).Package.c_str());
}
Last->BuildDepType((*D).Type),Src.c_str(),
(*D).Package.c_str());
}
+ }
}
else
{
}
else
{
@@
-2641,6
+2657,7
@@
bool ShowHelp(CommandLine &CmdL)
" upgrade - Perform an upgrade\n"
" install - Install new packages (pkg is libc6 not libc6.deb)\n"
" remove - Remove packages\n"
" upgrade - Perform an upgrade\n"
" install - Install new packages (pkg is libc6 not libc6.deb)\n"
" remove - Remove packages\n"
+ " autoremove - Remove all automatic unused packages\n"
" purge - Remove and purge packages\n"
" source - Download source archives\n"
" build-dep - Configure build-dependencies for source packages\n"
" purge - Remove and purge packages\n"
" source - Download source archives\n"
" build-dep - Configure build-dependencies for source packages\n"
@@
-2751,7
+2768,9
@@
int main(int argc,const char *argv[])
{"upgrade",&DoUpgrade},
{"install",&DoInstall},
{"remove",&DoInstall},
{"upgrade",&DoUpgrade},
{"install",&DoInstall},
{"remove",&DoInstall},
+ {"purge",&DoInstall},
{"autoremove",&DoInstall},
{"autoremove",&DoInstall},
+ {"purge",&DoInstall},
{"dist-upgrade",&DoDistUpgrade},
{"dselect-upgrade",&DoDSelectUpgrade},
{"build-dep",&DoBuildDep},
{"dist-upgrade",&DoDistUpgrade},
{"dselect-upgrade",&DoDSelectUpgrade},
{"build-dep",&DoBuildDep},