From: Michael Vogt Date: Fri, 27 Dec 2013 21:18:00 +0000 (+0100) Subject: Merge branch 'feature/policy-parser-bts732746' into debian/sid X-Git-Tag: 0.9.14.2~3^2~1^2~4 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/7e43ab9d47ad9d4712441968bd3fdf919c912c45?hp=75ab11ae3880530c5354cc90c8d1ff0998f8146b Merge branch 'feature/policy-parser-bts732746' into debian/sid --- diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 7fbe4d604..efbf7aaf4 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1827,3 +1827,20 @@ std::vector Glob(std::string const &pattern, int flags) return result; } /*}}}*/ + +std::string GetTempDir() +{ + const char *tmpdir = getenv("TMPDIR"); + +#ifdef P_tmpdir + if (!tmpdir) + tmpdir = P_tmpdir; +#endif + + // check that tmpdir is set and exists + struct stat st; + if (!tmpdir || strlen(tmpdir) == 0 || stat(tmpdir, &st) != 0) + tmpdir = "/tmp"; + + return string(tmpdir); +} diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index e9a9aab28..e752e9621 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -165,6 +165,8 @@ bool DirectoryExists(std::string const &Path) __attrib_const; bool CreateDirectory(std::string const &Parent, std::string const &Path); time_t GetModificationTime(std::string const &Path); +std::string GetTempDir(); + /** \brief Ensure the existence of the given Path * * \param Parent directory of the Path directory - a trailing diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index f47e7ea48..f57a72d86 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -21,16 +22,9 @@ /*}}}*/ static char * GenerateTemporaryFileTemplate(const char *basename) /*{{{*/ { - const char *tmpdir = getenv("TMPDIR"); -#ifdef P_tmpdir - if (!tmpdir) - tmpdir = P_tmpdir; -#endif - if (!tmpdir) - tmpdir = "/tmp"; - std::string out; - strprintf(out, "%s/%s.XXXXXX", tmpdir, basename); + std::string tmpdir = GetTempDir(); + strprintf(out, "%s/%s.XXXXXX", tmpdir.c_str(), basename); return strdup(out.c_str()); } /*}}}*/ diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index b4bfd1400..0d73733d5 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -44,6 +44,7 @@ #include #include #include +#include #include /*}}}*/ @@ -596,7 +597,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line) errors look like this: 'status: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb : error : trying to overwrite `/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in package krecipes-data and conffile-prompt like this - 'status: conffile-prompt: conffile : 'current-conffile' 'new-conffile' useredited distedited + 'status:/etc/compiz.conf/compiz.conf : conffile-prompt: 'current-conffile' 'new-conffile' useredited distedited */ if (prefix == "status") { @@ -608,7 +609,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line) WriteApportReport(list[1].c_str(), list[3].c_str()); return; } - else if(action == "conffile") + else if(action == "conffile-prompt") { d->progress->ConffilePrompt(list[1], PackagesDone, PackagesTotal, list[3]); @@ -1036,7 +1037,10 @@ void pkgDPkgPM::StartPtyMagic() if (tcgetattr(STDOUT_FILENO, &d->tt) == 0) { ioctl(1, TIOCGWINSZ, (char *)&win); - if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0) + if (_config->FindB("Dpkg::Use-Pty", true) == false) + { + d->master = d->slave = -1; + } else if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0) { _error->Errno("openpty", _("Can not write log (%s)"), _("Is /dev/pts mounted?")); d->master = d->slave = -1; diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index b82b7efde..0caf62b61 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -9,7 +9,7 @@ #include #include #include - +#include namespace APT { namespace Progress { diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 8fe15fdf9..8e1937113 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -47,8 +47,6 @@ using namespace std; -#define TMPDIR "/tmp" - pkgCache *DebFile::Cache = 0; // DebFile::DebFile - Construct the DebFile object /*{{{*/ @@ -253,14 +251,11 @@ string WriteFile(const char *package, const char *prefix, const char *data) { char fn[512]; static int i; - const char *tempdir = NULL; - - tempdir = getenv("TMPDIR"); - if (tempdir == NULL) - tempdir = TMPDIR; + std::string tempdir = GetTempDir(); snprintf(fn, sizeof(fn), "%s/%s.%s.%u%d", - _config->Find("APT::ExtractTemplates::TempDir", tempdir).c_str(), + _config->Find("APT::ExtractTemplates::TempDir", + tempdir.c_str()).c_str(), package, prefix, getpid(), i++); FileFd f; if (data == NULL) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6973901dc..8a0772ce2 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -322,9 +322,12 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, if (Src == "" && ArchTag != "") { - _error->Error(_("Can not find a package '%s' with version '%s' and " - "release '%s'"), Pkg.FullName().c_str(), - VerTag.c_str(), RelTag.c_str()); + if (VerTag != "") + _error->Error(_("Can not find a package '%s' with version '%s'"), + Pkg.FullName().c_str(), VerTag.c_str()); + if (RelTag != "") + _error->Error(_("Can not find a package '%s' with release '%s'"), + Pkg.FullName().c_str(), RelTag.c_str()); Src = Name; return 0; } @@ -1533,14 +1536,12 @@ bool DoChangelog(CommandLine &CmdL) bool const downOnly = _config->FindB("APT::Get::Download-Only", false); char tmpname[100]; - char* tmpdir = NULL; + const char* tmpdir = NULL; if (downOnly == false) { - const char* const tmpDir = getenv("TMPDIR"); - if (tmpDir != NULL && *tmpDir != '\0') - snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", tmpDir); - else - strncpy(tmpname, "/tmp/apt-changelog-XXXXXX", sizeof(tmpname)); + std::string systemTemp = GetTempDir(); + snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", + systemTemp.c_str()); tmpdir = mkdtemp(tmpname); if (tmpdir == NULL) return _error->Errno("mkdtemp", "mkdtemp failed"); diff --git a/configure.ac b/configure.ac index 7db147ba4..05bbeeaad 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) PACKAGE="apt" -PACKAGE_VERSION="0.9.14" +PACKAGE_VERSION="0.9.14.1" PACKAGE_MAIL="APT Development Team " AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"$PACKAGE_VERSION") diff --git a/debian/changelog b/debian/changelog index 4d7d2e963..151be3bec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +apt (0.9.14.2) UNRELEASED; urgency=low + + [ Joe Hansen ] + * Danish translation update. Closes: #732166 + + [ Peter Green ] + * add apt-vendor for raspbian. Closes: #732749 + + [ Michael Vogt ] + * vendor/getinfo: + - fix ubuntu-codename + * vendor/steamos/*: + - add steamos support + + -- Christian Perrier Sun, 15 Dec 2013 08:43:06 +0100 + +apt (0.9.14.1) unstable; urgency=medium + + * fix apt-get source -t dist regression (closes: #731853) + and add testcase + * clarify error message when apt-get source=ver fails + (thans to David Kalnischkies) + * Fix conffile prompt regression (LP: #1260297) + and add testcase + * improve error message for apt-get source pkg:arch{=ver,/release} + + -- Michael Vogt Thu, 12 Dec 2013 18:34:29 +0100 + apt (0.9.14) unstable; urgency=low [ David Kalnischkies ] diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index 11f722fbf..21b62e452 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -219,14 +219,14 @@ "> - + - + + +raspbian-archive-keyring"> +/usr/share/keyrings/raspbian-archive-keyring.gpg"> +/usr/share/keyrings/raspbian-archive-removed-keys.gpg"> + + diff --git a/vendor/raspbian/makefile b/vendor/raspbian/makefile new file mode 100644 index 000000000..ced566c30 --- /dev/null +++ b/vendor/raspbian/makefile @@ -0,0 +1,11 @@ +# -*- make -*- +BASE=../.. +SUBDIR=vendor/raspbian + +# Bring in the default rules +include ../../buildlib/defaults.mak + +doc binary manpages: sources.list + +sources.list: sources.list.in ../../doc/apt-verbatim.ent + sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< > $@ diff --git a/vendor/raspbian/sources.list.in b/vendor/raspbian/sources.list.in new file mode 100644 index 000000000..29ddcc4d6 --- /dev/null +++ b/vendor/raspbian/sources.list.in @@ -0,0 +1,6 @@ +# See sources.list(5) manpage for more information +# Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool. +deb http://mirrordirector.raspbian.org/raspbian &stable-codename; main contrib non-free + +# Uncomment if you want the apt-get source function to work +#deb-src http://mirrordirector.raspbian.org/raspbian &stable-codename; main contrib non-free diff --git a/vendor/steamos/apt-vendor.ent b/vendor/steamos/apt-vendor.ent new file mode 100644 index 000000000..69bb254ef --- /dev/null +++ b/vendor/steamos/apt-vendor.ent @@ -0,0 +1,8 @@ + + +valve-archive-keyring"> +/usr/share/keyrings/valve-archive-keyring.gpg"> +/usr/share/keyrings/valve-archive-removed-keys.gpg"> + + + diff --git a/vendor/steamos/makefile b/vendor/steamos/makefile new file mode 100644 index 000000000..c27494587 --- /dev/null +++ b/vendor/steamos/makefile @@ -0,0 +1,11 @@ +# -*- make -*- +BASE=../.. +SUBDIR=vendor/steamos + +# Bring in the default rules +include ../../buildlib/defaults.mak + +doc binary manpages: sources.list + +sources.list: sources.list.in ../../doc/apt-verbatim.ent + sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< | sed -e 's#&steamos-codename;#$(shell ../getinfo current-distro-codename)#g' > $@ diff --git a/vendor/steamos/sources.list.in b/vendor/steamos/sources.list.in new file mode 100644 index 000000000..f3790c550 --- /dev/null +++ b/vendor/steamos/sources.list.in @@ -0,0 +1,7 @@ +# See sources.list(5) manpage for more information +# Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool. + +deb http://repo.steampowered.com/steamos &steamos-codename; main contrib non-free +deb-src http://repo.steampowered.com/steamos &steamos-codename; main contrib non-free + +deb http://cdn.debian.net/debian &stable-codename; main