From d8cb4aa44573aca621110fda47d72bd682c0e3f4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 3 Jul 2007 21:38:32 +0200 Subject: * first (raw and ineffient) implementation --- cmdline/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/makefile b/cmdline/makefile index 49035be44..5820c2e0f 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -14,7 +14,7 @@ include $(PROGRAM_H) # The apt-get program PROGRAM=apt-get -SLIBS = -lapt-pkg +SLIBS = -lapt-pkg -lutil LIB_MAKES = apt-pkg/makefile SOURCE = apt-get.cc acqprogress.cc include $(PROGRAM_H) -- cgit v1.2.3 From 394eadc8e13784162fee87c8059bcc214275f4b5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 18 Jul 2007 12:33:36 +0100 Subject: - support task removal too: apt-get remove taskname^ (thanks to Matt Zimmerman reporting this problem) --- cmdline/apt-get.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 95600ff6d..df0414076 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1507,7 +1507,8 @@ bool DoUpgrade(CommandLine &CmdL) bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, bool BrokenFix, unsigned int& ExpectedInst, - const char *taskname) + const char *taskname, + bool Remove) { const char *start, *end; pkgCache::PkgIterator Pkg; @@ -1536,7 +1537,7 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, buf[end-start] = 0x0; if (regexec(&Pattern,buf,0,0,0) != 0) continue; - res &= TryToInstall(Pkg,Cache,Fix,false,true,ExpectedInst); + res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); found = true; } @@ -1604,7 +1605,7 @@ bool DoInstall(CommandLine &CmdL) // tasks must always be confirmed ExpectedInst += 1000; // see if we can install it - TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S); + TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S, Remove); continue; } -- cgit v1.2.3 From 495e5cb25443e6606c0d02891e1f6610983e88cd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 26 Jul 2007 19:18:11 +0200 Subject: * implement sha256/sha1/md5 checking with proper backward compatibility and fallback --- 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 df0414076..fb1bb248e 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -918,7 +918,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); I++) cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << - I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl; + I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl; return true; } @@ -1359,7 +1359,7 @@ bool DoUpdate(CommandLine &CmdL) pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); I++) cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << - I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl; + I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl; return true; } @@ -2211,7 +2211,7 @@ bool DoSource(CommandLine &CmdL) pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); I++) cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << - I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl; + I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl; return true; } -- cgit v1.2.3 From 5b28c8040795b53a4df54f33e57976720558ed32 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 1 Aug 2007 19:51:20 -0300 Subject: * Applied patch from Aurelien Jarno to fix wrong directory downloading on non-linux architectures (closes: #435597) --- cmdline/apt-cache.cc | 4 ++-- cmdline/apt-cdrom.cc | 4 ++-- cmdline/apt-config.cc | 4 ++-- cmdline/apt-extracttemplates.cc | 4 ++-- cmdline/apt-get.cc | 4 ++-- cmdline/apt-sortpkgs.cc | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index cc4c1559e..c0655da40 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1711,8 +1711,8 @@ bool GenCaches(CommandLine &Cmd) /* */ bool ShowHelp(CommandLine &Cmd) { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return true; diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 7434a7225..379a433ea 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -135,8 +135,8 @@ bool DoIdent(CommandLine &) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 34365dc2e..63fa0867c 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -67,8 +67,8 @@ bool DoDump(CommandLine &CmdL) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index c87b436ba..6d580cc28 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -222,8 +222,8 @@ bool DebFile::ParseInfo() /* */ int ShowHelp(void) { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index df0414076..b216204d2 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2582,8 +2582,8 @@ bool DoMoo(CommandLine &CmdL) /* */ bool ShowHelp(CommandLine &CmdL) { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) { diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index 8909c3826..7b2a74aed 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -141,8 +141,8 @@ bool DoIt(string InFile) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; -- cgit v1.2.3 From bf6d5b428e247dd28fb593cc3677da4e5eee0a54 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 12 Sep 2007 17:05:19 -0300 Subject: * Add support to apt-key to export keys to stdout. Thanks to "Dwayne C. Litzenberger" for the patch (closes: #441942) --- cmdline/apt-key | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-key b/cmdline/apt-key index 90ecae2cf..3bd1a92d9 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -39,6 +39,8 @@ usage() { echo echo " apt-key add - add the key contained in ('-' for stdin)" echo " apt-key del - remove the key " + echo " apt-key export - output the key " + echo " apt-key exportall - output all trusted keys" echo " apt-key update - update keys using the keyring package" echo " apt-key list - list keys" echo @@ -75,6 +77,12 @@ case "$command" in finger*) $GPG --batch --fingerprint ;; + export) + $GPG --armor --export "$1" + ;; + exportall) + $GPG --armor --export + ;; adv*) echo "Executing: $GPG $*" $GPG $* -- cgit v1.2.3 From 9efa2e916d134e5960351cc3b67f4556ec4b2126 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 14 Sep 2007 14:04:23 +0200 Subject: * fix "purge" commandline argument, closes: #133421 (thanks to Julien Danjou for the patch) --- cmdline/apt-get.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index c9ec481aa..a52a34979 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2752,6 +2752,7 @@ int main(int argc,const char *argv[]) {"install",&DoInstall}, {"remove",&DoInstall}, {"autoremove",&DoInstall}, + {"purge",&DoInstall}, {"dist-upgrade",&DoDistUpgrade}, {"dselect-upgrade",&DoDSelectUpgrade}, {"build-dep",&DoBuildDep}, -- cgit v1.2.3 From 085bedacb04be4f805b0fb9d3b2a611d5d475d62 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 14 Sep 2007 16:11:56 +0200 Subject: * cmdline/apt-get.cc: - do not change the auto-installed information if a package is reinstalled --- cmdline/apt-get.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a52a34979..e214691f8 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1708,7 +1708,8 @@ bool DoInstall(CommandLine &CmdL) // 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"), Pkg.Name()); @@ -2471,6 +2472,7 @@ bool DoBuildDep(CommandLine &CmdL) break; } if (CV.end() == true) + { if (hasAlternatives) { continue; @@ -2483,6 +2485,7 @@ bool DoBuildDep(CommandLine &CmdL) Last->BuildDepType((*D).Type),Src.c_str(), (*D).Package.c_str()); } + } } else { -- cgit v1.2.3 From 526d43695b00573dcd8d323348a6b30d5215540b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 25 Sep 2007 11:17:18 +0200 Subject: * cmdline/apt-mark: - Fix chmoding after have renamed the extended-states file (LP: #140019) (thanks to Laurent Bigonville) --- cmdline/apt-mark | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-mark b/cmdline/apt-mark index fdc3e1856..f6e749eb5 100755 --- a/cmdline/apt-mark +++ b/cmdline/apt-mark @@ -40,7 +40,7 @@ if __name__ == "__main__": if not options.filename: STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states" else: - STATE_FILE=options.state_file + STATE_FILE=options.filename # open the statefile if os.path.exists(STATE_FILE): @@ -62,4 +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) + os.chmod(STATE_FILE, 0644) -- cgit v1.2.3 From 70e6f24e3b39f7cc72cecab181b10c1f79474182 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 2 Oct 2007 09:39:05 -0300 Subject: - cmdline/apt-extracttemplates.cc: likewise; --- cmdline/apt-extracttemplates.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 6d580cc28..de22386b9 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -249,7 +249,7 @@ string WriteFile(const char *package, const char *prefix, const char *data) { char fn[512]; static int i; - char *tempdir = NULL; + const char *tempdir = NULL; tempdir = getenv("TMPDIR"); if (tempdir == NULL) -- cgit v1.2.3 From 5edb74a357b6b167bc7d9848b302942b9865307b Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 6 Oct 2007 18:24:27 -0300 Subject: * cmdline/apt-get.cc: adds 'autoremove' as a valid comment to usage statement of apt-get (closes: #445468). --- cmdline/apt-get.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index e214691f8..8bf279456 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2644,6 +2644,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" + " 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" -- cgit v1.2.3 From 3272872427693b9e4f0fabca48ed27ea7ace02ea Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 6 Oct 2007 18:38:51 -0300 Subject: Fix indentation --- 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 8bf279456..079b1473f 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2644,7 +2644,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" - " autoremove - Remove all automatic unused 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" -- cgit v1.2.3 From 24401c09f0a826ec0074f46dfe70efe3aaf79f25 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 6 Oct 2007 18:54:11 -0300 Subject: * cmdline/apt-get.cc: really applies Julien Danjou patch to add 'purge' command line argument (closes: #133421). --- cmdline/apt-get.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 079b1473f..efb618cb0 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2755,6 +2755,7 @@ int main(int argc,const char *argv[]) {"upgrade",&DoUpgrade}, {"install",&DoInstall}, {"remove",&DoInstall}, + {"purge",&DoInstall}, {"autoremove",&DoInstall}, {"purge",&DoInstall}, {"dist-upgrade",&DoDistUpgrade}, -- cgit v1.2.3