From 99921bf936f050c77f424f85a658fcdbef98326e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 8 Dec 2008 09:33:43 -0800 Subject: - fix "apt-get source pkg=ver" if binary name != source name (LP: #202219) * doc/makefile: - add examples/apt-https-method-example.conf --- cmdline/apt-get.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index eda37a31e..40ae02400 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1295,9 +1295,9 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { string Ver = Parse->Version(); - // Skip name mismatches - if (IsMatch == true && Parse->Package() != Src) - continue; + // show name mismatches + if (IsMatch == true && Parse->Package() != Src) + ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package(), Src); if (VerTag.empty() == false) { -- cgit v1.2.3 From f23153d046f014f96d442fca5b9ef6ede7fcf546 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Dec 2008 14:38:10 -0800 Subject: * methods/gpgv.cc: - fix compiler warning * cmdline/apt-get.cc: - fix "apt-get source pkg=ver" if binary name != source name and show a message (LP: #202219) * apt-pkg/deb/debsystem.cc: - make strings i18n able --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 40ae02400..2ef32a615 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1297,7 +1297,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, // show name mismatches if (IsMatch == true && Parse->Package() != Src) - ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package(), Src); + ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package().c_str(), Src.c_str()); if (VerTag.empty() == false) { -- cgit v1.2.3 From 73fc19d055b20178e5efae08013fe24663f6d89c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 16 Dec 2008 07:37:02 +0100 Subject: Clarify the --help for 'purge' (LP: #243948) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 4dbc4873f..06fa41017 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2632,7 +2632,7 @@ bool ShowHelp(CommandLine &CmdL) " install - Install new packages (pkg is libc6 not libc6.deb)\n" " remove - Remove packages\n" " autoremove - Remove automatically all unused packages\n" - " purge - Remove and purge packages\n" + " purge - Remove packages and config files\n" " source - Download source archives\n" " build-dep - Configure build-dependencies for source packages\n" " dist-upgrade - Distribution upgrade, see apt-get(8)\n" -- cgit v1.2.3 From 89ad8e7c1ad4aa6a90732ea5802a58c799ead189 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 9 Mar 2009 16:11:29 +0100 Subject: fix "apt-get source pkg" if there is a binary package and a source package of the same name but from different packages (LP: #330103) --- cmdline/apt-get.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 06fa41017..1c2c11689 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1272,16 +1272,23 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, } } } - - // No source package name.. - if (Src.empty() == true) - Src = TmpSrc; - + // The best hit pkgSrcRecords::Parser *Last = 0; unsigned long Offset = 0; string Version; bool IsMatch = false; + bool MatchSrcOnly = false; + + // No source package name.. + if (Src.empty() == true) + Src = TmpSrc; + else + // if we have a source pkg name, make sure to only search + // for srcpkg names, otherwise apt gets confused if there + // is a binary package "pkg1" and a source package "pkg1" + // with the same name but that comes from different packages + MatchSrcOnly = true; // If we are matching by version then we need exact matches to be happy if (VerTag.empty() == false) @@ -1291,13 +1298,13 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, binary packages in the search */ pkgSrcRecords::Parser *Parse; SrcRecs.Restart(); - while ((Parse = SrcRecs.Find(Src.c_str(),false)) != 0) + while ((Parse = SrcRecs.Find(Src.c_str(), MarchSrcOnly)) != 0) { string Ver = Parse->Version(); // show name mismatches if (IsMatch == true && Parse->Package() != Src) - ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package().c_str(), Src.c_str()); + ioprintf(c1out, _("No source package '%s' picking '%s' instead\n"), Parse->Package().c_str(), Src.c_str()); if (VerTag.empty() == false) { -- cgit v1.2.3 From c53cb75d7405f2def6751c3bfc5ca0418287a169 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 9 Mar 2009 16:18:38 +0100 Subject: cmdline/apt-get.cc: fix typo --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 1c2c11689..27e16d3f3 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1298,7 +1298,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, binary packages in the search */ pkgSrcRecords::Parser *Parse; SrcRecs.Restart(); - while ((Parse = SrcRecs.Find(Src.c_str(), MarchSrcOnly)) != 0) + while ((Parse = SrcRecs.Find(Src.c_str(), MatchSrcOnly)) != 0) { string Ver = Parse->Version(); -- cgit v1.2.3 From 8a9e5ffdb6d0f1744f56bcb6522b134cfdae4a19 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 27 Mar 2009 22:45:07 +0100 Subject: * cmdline/acqprogress.cc: - Call pkgAcquireStatus::Pulse even if quiet, so that we still get dlstatus messages on the status-fd (LP: #290234). --- cmdline/acqprogress.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index a5fee1db5..b3ded4142 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -145,11 +145,11 @@ void AcqTextStatus::Stop() bandwidth and ETA indicator. */ bool AcqTextStatus::Pulse(pkgAcquire *Owner) { + pkgAcquireStatus::Pulse(Owner); + if (Quiet > 0) return true; - pkgAcquireStatus::Pulse(Owner); - enum {Long = 0,Medium,Short} Mode = Long; char Buffer[sizeof(BlankLine)]; -- cgit v1.2.3 From a9b5e24b6bb392c4de88d965c33120d4a7fcb4f6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 3 Jun 2009 12:05:20 +0200 Subject: * cmdline/apt-mark: - add "showauto" option to show automatically installed packages --- cmdline/apt-mark | 72 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 27 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-mark b/cmdline/apt-mark index f6e749eb5..226d2079b 100755 --- a/cmdline/apt-mark +++ b/cmdline/apt-mark @@ -14,34 +14,21 @@ actions = { "markauto" : 1, "unmarkauto": 0 } -if __name__ == "__main__": - apt_pkg.init() - - # option parsing - parser = OptionParser() - parser.usage = "%prog [options] {markauto|unmarkauto} packages..." - parser.add_option("-f", "--file", action="store", type="string", - dest="filename", - help="read/write a different file") - parser.add_option("-v", "--verbose", - action="store_true", dest="verbose", default=False, - help="print verbose status messages to stdout") - (options, args) = parser.parse_args() - if len(args) < 2: - parser.error("not enough argument") - - # get pkgs to change - if args[0] not in actions.keys(): - parser.error("first argument must be 'markauto' or 'unmarkauto'") - pkgs = args[1:] - action = actions[args[0]] - - # get the state-file - if not options.filename: - STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states" - else: - STATE_FILE=options.filename +def show_automatic(filename): + if not os.path.exists(STATE_FILE): + return + auto = set() + tagfile = apt_pkg.ParseTagFile(open(STATE_FILE)) + while tagfile.Step(): + pkgname = tagfile.Section.get("Package") + autoInst = tagfile.Section.get("Auto-Installed") + if int(autoInst): + auto.add(pkgname) + print "\n".join(sorted(auto)) + +def mark_unmark_automatic(filename, action, pkgs): + " mark or unmark automatic flag" # open the statefile if os.path.exists(STATE_FILE): tagfile = apt_pkg.ParseTagFile(open(STATE_FILE)) @@ -63,3 +50,34 @@ if __name__ == "__main__": os.chmod(outfile.name, 0644) os.rename(outfile.name, STATE_FILE) os.chmod(STATE_FILE, 0644) + + +if __name__ == "__main__": + apt_pkg.init() + + # option parsing + parser = OptionParser() + parser.usage = "%prog [options] {markauto|unmarkauto} packages..." + parser.add_option("-f", "--file", action="store", type="string", + dest="filename", + help="read/write a different file") + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose", default=False, + help="print verbose status messages to stdout") + (options, args) = parser.parse_args() + + # get the state-file + if not options.filename: + STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states" + else: + STATE_FILE=options.filename + + if args[0] == "showauto": + show_automatic(STATE_FILE) + else: + # get pkgs to change + if args[0] not in actions.keys(): + parser.error("first argument must be 'markauto', 'unmarkauto' or 'showauto'") + pkgs = args[1:] + action = actions[args[0]] + mark_unmark_automatic(STATE_FILE, action, pkgs) -- cgit v1.2.3 From 55a5a46c235a30bf024fb2301066553953701cc5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 29 Jun 2009 16:55:49 +0200 Subject: support running "--simulate" as user --- cmdline/apt-get.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 028f371b5..faad2ed6b 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2788,7 +2788,18 @@ int main(int argc,const char *argv[]) ShowHelp(CmdL); return 0; } - + + // simulate user-friendly if apt-get has no root privileges + if (getuid() != 0 && _config->FindB("APT::Get::Simulate") == true) + { + cout << _("NOTE: This is only a simulation!\n" + " apt-get needs root privileges for real execution.\n" + " Keep also in mind that locking is deactivated,\n" + " so don't depend on the relevance to the real current situation!" + ) << std::endl; + _config->Set("Debug::NoLocking",true); + } + // Deal with stdout not being a tty if (!isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1) _config->Set("quiet","1"); -- cgit v1.2.3 From 9964a721855b74b4f6008d30ebc637198776ca04 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 29 Jun 2009 18:13:23 +0200 Subject: do not write state file in simulate mode (closes: #433007) --- cmdline/apt-get.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index faad2ed6b..93b3a83dc 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1870,7 +1870,8 @@ bool DoInstall(CommandLine &CmdL) // cache.commit() if (AutoMarkChanged > 0 && Cache->DelCount() == 0 && Cache->InstCount() == 0 && - Cache->BadCount() == 0) + Cache->BadCount() == 0 && + _config->FindB("APT::Get::Simulate",false) == false) Cache->writeStateFile(NULL); // See if we need to prompt -- cgit v1.2.3 From 7a9f09bd66d51b92bb68f07e7fbc111df6206c93 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 30 Jun 2009 14:11:31 +0200 Subject: merged r1811..1815 from lp:~donkult/apt/experimental --- cmdline/apt-get.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 93b3a83dc..f5642c04d 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -111,6 +111,9 @@ class CacheFile : public pkgCacheFile return Open(true); } CacheFile() : List(0) {}; + ~CacheFile() { + delete[] List; + } }; /*}}}*/ -- cgit v1.2.3 From 92fcbfc16396d9a2fbde0edb0902d4ebe7ff0090 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Jun 2009 21:37:30 +0200 Subject: add the various foldmarkers in apt-pkg & cmdline (no code change) --- cmdline/apt-cache.cc | 19 +++++++------------ cmdline/apt-cdrom.cc | 10 +++------- cmdline/apt-config.cc | 4 ++-- cmdline/apt-extracttemplates.cc | 4 ++-- cmdline/apt-get.cc | 18 ++++++++---------- cmdline/apt-sortpkgs.cc | 8 ++++---- 6 files changed, 26 insertions(+), 37 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 4431fd4f9..93558fa88 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -622,7 +622,7 @@ bool Depends(CommandLine &CmdL) return true; } - + /*}}}*/ // RDepends - Print out a reverse dependency tree - mbc /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -710,10 +710,7 @@ bool RDepends(CommandLine &CmdL) return true; } - /*}}}*/ - - // xvcg - Generate a graph for xvcg /*{{{*/ // --------------------------------------------------------------------- // Code contributed from Junichi Uekawa on 20 June 2002. @@ -933,8 +930,6 @@ bool XVcg(CommandLine &CmdL) return true; } /*}}}*/ - - // Dotty - Generate a graph for Dotty /*{{{*/ // --------------------------------------------------------------------- /* Dotty is the graphvis program for generating graphs. It is a fairly @@ -1270,15 +1265,16 @@ bool DisplayRecord(pkgCache::VerIterator V) return true; } /*}}}*/ -// Search - Perform a search /*{{{*/ -// --------------------------------------------------------------------- -/* This searches the package names and package descriptions for a pattern */ + struct ExDescFile { pkgCache::DescFile *Df; bool NameMatch; }; +// Search - Perform a search /*{{{*/ +// --------------------------------------------------------------------- +/* This searches the package names and package descriptions for a pattern */ bool Search(CommandLine &CmdL) { pkgCache &Cache = *GCache; @@ -1691,7 +1687,6 @@ bool Madison(CommandLine &CmdL) return true; } - /*}}}*/ // GenCaches - Call the main cache generator /*{{{*/ // --------------------------------------------------------------------- @@ -1765,8 +1760,7 @@ void CacheInitialize() _config->Set("help",false); } /*}}}*/ - -int main(int argc,const char *argv[]) +int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@ -1873,3 +1867,4 @@ int main(int argc,const char *argv[]) return 0; } + /*}}}*/ diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 379a433ea..342b6314a 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -40,8 +40,7 @@ using namespace std; - /*{{{*/ -class pkgCdromTextStatus : public pkgCdromStatus +class pkgCdromTextStatus : public pkgCdromStatus /*{{{*/ { protected: OpTextProgress Progress; @@ -98,9 +97,7 @@ OpProgress* pkgCdromTextStatus::GetOpProgress() { return &Progress; }; - /*}}}*/ - // DoAdd - Add a new CDROM /*{{{*/ // --------------------------------------------------------------------- /* This does the main add bit.. We show some status and things. The @@ -129,7 +126,6 @@ bool DoIdent(CommandLine &) return cdrom.Ident(ident, &log); } /*}}}*/ - // ShowHelp - Show the help screen /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -164,8 +160,7 @@ int ShowHelp() return 0; } /*}}}*/ - -int main(int argc,const char *argv[]) +int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@ -222,3 +217,4 @@ int main(int argc,const char *argv[]) return 0; } + /*}}}*/ diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 63fa0867c..9919a9c94 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -88,8 +88,7 @@ int ShowHelp() return 0; } /*}}}*/ - -int main(int argc,const char *argv[]) +int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@ -133,3 +132,4 @@ int main(int argc,const char *argv[]) return 0; } + /*}}}*/ diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index de22386b9..21ef1a050 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -348,8 +348,7 @@ bool Go(CommandLine &CmdL) return !_error->PendingError(); } /*}}}*/ - -int main(int argc, const char **argv) +int main(int argc, const char **argv) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@ -391,3 +390,4 @@ int main(int argc, const char **argv) return 0; } + /*}}}*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index f5642c04d..97c83c9b0 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -597,7 +597,6 @@ void Stats(ostream &out,pkgDepCache &Dep) Dep.BadCount()); } /*}}}*/ - // CacheFile::NameComp - QSort compare by name /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -690,7 +689,10 @@ bool CacheFile::CheckDeps(bool AllowBroken) return true; } - + /*}}}*/ +// CheckAuth - check if each download comes form a trusted source /*{{{*/ +// --------------------------------------------------------------------- +/* */ static bool CheckAuth(pkgAcquire& Fetcher) { string UntrustedList; @@ -731,10 +733,7 @@ static bool CheckAuth(pkgAcquire& Fetcher) return _error->Error(_("There are problems and -y was used without --force-yes")); } - - /*}}}*/ - // InstallPackages - Actually download and install the packages /*{{{*/ // --------------------------------------------------------------------- /* This displays the informative messages describing what is going to @@ -1338,7 +1337,6 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, return Last; } /*}}}*/ - // DoUpdate - Update the package lists /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -1460,7 +1458,7 @@ bool DoAutomaticRemove(CacheFile &Cache) } return true; } - + /*}}}*/ // DoUpgrade - Upgrade all packages /*{{{*/ // --------------------------------------------------------------------- /* Upgrade all packages without installing new packages or erasing old @@ -1535,7 +1533,7 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, regfree(&Pattern); return res; } - + /*}}}*/ // DoInstall - Install packages from the command line /*{{{*/ // --------------------------------------------------------------------- /* Install named packages */ @@ -2702,8 +2700,7 @@ void SigWinch(int) #endif } /*}}}*/ - -int main(int argc,const char *argv[]) +int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@ -2835,3 +2832,4 @@ int main(int argc,const char *argv[]) return 0; } + /*}}}*/ diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index 7b2a74aed..171b0ba13 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -31,7 +31,7 @@ using namespace std; -struct PkgName +struct PkgName /*{{{*/ { string Name; string Ver; @@ -55,7 +55,7 @@ struct PkgName bool operator >(const PkgName &x) const {return Compare3(x) > 0;}; bool operator ==(const PkgName &x) const {return Compare3(x) == 0;}; }; - + /*}}}*/ // DoIt - Sort a single file /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -161,8 +161,7 @@ int ShowHelp() return 0; } /*}}}*/ - -int main(int argc,const char *argv[]) +int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@ -206,3 +205,4 @@ int main(int argc,const char *argv[]) return 0; } + /*}}}*/ -- cgit v1.2.3 From e68ca100711326895126dc1fca86a2124a8e8d63 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 6 Jul 2009 15:46:54 +0200 Subject: Support /etc/apt/preferences.d (Closes: #535512) --- cmdline/apt-cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 4431fd4f9..acef8dc5e 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -401,7 +401,7 @@ bool DumpAvail(CommandLine &Cmd) pkgCache &Cache = *GCache; pkgPolicy Plcy(&Cache); - if (ReadPinFile(Plcy) == false) + if (ReadPinFile(Plcy) == false || ReadPinDir(Plcy) == false) return false; unsigned long Count = Cache.HeaderP->PackageCount+1; @@ -1515,7 +1515,7 @@ bool Policy(CommandLine &CmdL) pkgCache &Cache = *GCache; pkgPolicy Plcy(&Cache); - if (ReadPinFile(Plcy) == false) + if (ReadPinFile(Plcy) == false || ReadPinDir(Plcy) == false) return false; // Print out all of the package files -- cgit v1.2.3 From ecf59bfcf3ca573aa15a44086a7852d1308ff1ad Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 7 Jul 2009 19:23:04 +0200 Subject: [apt-get] add possibility to hide the user simulation note --- cmdline/apt-get.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 97c83c9b0..2ca0855b6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2793,11 +2793,12 @@ int main(int argc,const char *argv[]) /*{{{*/ // simulate user-friendly if apt-get has no root privileges if (getuid() != 0 && _config->FindB("APT::Get::Simulate") == true) { - cout << _("NOTE: This is only a simulation!\n" - " apt-get needs root privileges for real execution.\n" - " Keep also in mind that locking is deactivated,\n" - " so don't depend on the relevance to the real current situation!" - ) << std::endl; + if (_config->FindB("APT::Get::Show-User-Simulation-Note",true) == true) + cout << _("NOTE: This is only a simulation!\n" + " apt-get needs root privileges for real execution.\n" + " Keep also in mind that locking is deactivated,\n" + " so don't depend on the relevance to the real current situation!" + ) << std::endl; _config->Set("Debug::NoLocking",true); } -- cgit v1.2.3