Browse Source

support arch:all data e.g. in separate Packages file

Based on a discussion with Niels Thykier who asked for Contents-all this
implements apt trying for all architecture dependent files to get a file
for the architecture all, which is treated internally now as an official
architecture which is always around (like native). This way arch:all
data can be shared instead of duplicated for each architecture requiring
the user to download the same information again and again.

There is one problem however: In Debian there is already a binary-all/
Packages file, but the binary-any files still include arch:all packages,
so that downloading this file now would be a waste of time, bandwidth
and diskspace. We therefore need a way to decide if it makes sense to
download the all file for Packages in Debian or not. The obvious answer
would be a special flag in the Release file indicating this, which would
need to default to 'no' and every reasonable repository would override
it to 'yes' in a few years time, but the flag would be there "forever".

Looking closer at a Release file we see the field "Architectures", which
doesn't include 'all' at the moment. With the idea outlined above that
'all' is a "proper" architecture now, we interpret this field as being
authoritative in declaring which architectures are supported by this
repository. If it says 'all', apt will try to get all, if not it will be
skipped. This gives us another interesting feature: If I configure a
source to download armel and mips, but it declares it supports only
armel apt will now print a notice saying as much. Previously this was a
very cryptic failure. If on the other hand the repository supports mips,
too, but for some reason doesn't ship mips packages at the moment, this
'missing' file is silently ignored (= that is the same as the repository
including an empty file).

The Architectures field isn't mandatory through, so if it isn't there,
we assume that every architecture is supported by this repository, which
skips the arch:all if not listed in the release file.
tags/debian/1.1_exp15
David Kalnischkies 5 years ago
parent
commit
1dd2036848
41 changed files with 473 additions and 180 deletions
  1. +26
    -0
      apt-pkg/acquire-item.cc
  2. +0
    -3
      apt-pkg/cdrom.cc
  3. +27
    -1
      apt-pkg/deb/debmetaindex.cc
  4. +1
    -0
      apt-pkg/deb/debmetaindex.h
  5. +11
    -0
      apt-pkg/metaindex.cc
  6. +3
    -0
      apt-pkg/metaindex.h
  7. +8
    -4
      doc/apt-ftparchive.1.xml
  8. +28
    -16
      ftparchive/apt-ftparchive.cc
  9. +33
    -30
      ftparchive/writer.cc
  10. +6
    -3
      ftparchive/writer.h
  11. +15
    -7
      test/integration/framework
  12. +71
    -0
      test/integration/test-acquire-binary-all
  13. +8
    -8
      test/integration/test-acquire-same-repository-multiple-times
  14. +40
    -13
      test/integration/test-apt-acquire-additional-files
  15. +16
    -1
      test/integration/test-apt-acquire-additional-files-duplicates
  16. +4
    -0
      test/integration/test-apt-by-hash-update
  17. +1
    -2
      test/integration/test-apt-cache
  18. +4
    -4
      test/integration/test-apt-cdrom
  19. +1
    -1
      test/integration/test-apt-cli-show
  20. +21
    -9
      test/integration/test-apt-get-update-unauth-warning
  21. +18
    -4
      test/integration/test-apt-sources-deb822
  22. +1
    -1
      test/integration/test-apt-translation-has-no-packages
  23. +2
    -2
      test/integration/test-apt-update-expected-size
  24. +15
    -5
      test/integration/test-apt-update-failure-propagation
  25. +4
    -4
      test/integration/test-apt-update-file
  26. +12
    -4
      test/integration/test-apt-update-ims
  27. +1
    -1
      test/integration/test-apt-update-not-modified
  28. +2
    -2
      test/integration/test-apt-update-stale
  29. +4
    -4
      test/integration/test-apt-update-transactions
  30. +2
    -2
      test/integration/test-apt-update-unauth
  31. +5
    -5
      test/integration/test-bug-543966-downgrade-below-1000-pin
  32. +0
    -1
      test/integration/test-bug-683786-build-dep-on-virtual-packages
  33. +8
    -4
      test/integration/test-compressed-indexes
  34. +2
    -2
      test/integration/test-cve-2013-1051-InRelease-parsing
  35. +28
    -2
      test/integration/test-external-dependency-solver-protocol
  36. +2
    -1
      test/integration/test-handle-redirect-as-used-mirror-change
  37. +3
    -3
      test/integration/test-policy-pinning
  38. +1
    -1
      test/integration/test-security-no-remote-status
  39. +29
    -23
      test/integration/test-sourceslist-arch-plusminus-options
  40. +2
    -1
      test/integration/test-sourceslist-lang-plusminus-options
  41. +8
    -6
      test/libapt/cdromfindpackages_test.cc

+ 26
- 0
apt-pkg/acquire-item.cc View File

@@ -1050,6 +1050,16 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/
Target != IndexTargets.end();
++Target)
{
// all is an implementation detail. Users shouldn't use this as arch
// We need this support trickery here as e.g. Debian has binary-all files already,
// but arch:all packages are still in the arch:any files, so we would waste precious
// download time, bandwidth and diskspace for nothing, BUT Debian doesn't feature all
// in the set of supported architectures, so we can filter based on this property rather
// than invent an entirely new flag we would need to carry for all of eternity.
if (Target->Option(IndexTarget::ARCHITECTURE) == "all" &&
TransactionManager->MetaIndexParser->IsArchitectureSupported("all") == false)
continue;

bool trypdiff = Target->OptionBool(IndexTarget::PDIFFS);
if (verify == true)
{
@@ -1059,6 +1069,22 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/
if (Target->IsOptional)
continue;

std::string const &arch = Target->Option(IndexTarget::ARCHITECTURE);
if (arch.empty() == false)
{
if (TransactionManager->MetaIndexParser->IsArchitectureSupported(arch) == false)
{
_error->Notice(_("Skipping acquire of configured file '%s' as repository '%s' doesn't support architecture '%s'"),
Target->MetaKey.c_str(), TransactionManager->Target.Description.c_str(), arch.c_str());
continue;
}
// if the architecture is officially supported but currently no packages for it available,
// ignore silently as this is pretty much the same as just shipping an empty file.
// if we don't know which architectures are supported, we do NOT ignore it to notify user about this
if (TransactionManager->MetaIndexParser->IsArchitectureSupported("*undefined*") == false)
continue;
}

Status = StatAuthError;
strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), Target->MetaKey.c_str());
return;


+ 0
- 3
apt-pkg/cdrom.cc View File

@@ -156,10 +156,7 @@ bool pkgCdrom::FindPackages(string CD,
// Skip some files..
if (strcmp(Dir->d_name,".") == 0 ||
strcmp(Dir->d_name,"..") == 0 ||
//strcmp(Dir->d_name,"source") == 0 ||
strcmp(Dir->d_name,".disk") == 0 ||
strcmp(Dir->d_name,"experimental") == 0 ||
strcmp(Dir->d_name,"binary-all") == 0 ||
strcmp(Dir->d_name,"debian-installer") == 0)
continue;



+ 27
- 1
apt-pkg/deb/debmetaindex.cc View File

@@ -49,6 +49,8 @@ class APT_HIDDEN debReleaseIndexPrivate /*{{{*/
time_t ValidUntilMin;
time_t ValidUntilMax;

std::vector<std::string> Architectures;

debReleaseIndexPrivate() : CheckValidUntil(metaIndex::TRI_UNSET), ValidUntilMin(0), ValidUntilMax(0) {}
};
/*}}}*/
@@ -252,12 +254,20 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI,
Options.insert(std::make_pair("COMPRESSIONTYPES", CompressionTypes));
Options.insert(std::make_pair("SOURCESENTRY", E->sourcesEntry));

bool IsOpt = IsOptional;
if (IsOpt == false)
{
auto const arch = Options.find("ARCHITECTURE");
if (arch != Options.end() && arch->second == "all")
IsOpt = true;
}

IndexTarget Target(
MetaKey,
ShortDesc,
LongDesc,
Options.find("BASE_URI")->second + MetaKey,
IsOptional,
IsOpt,
KeepCompressed,
Options
);
@@ -331,6 +341,11 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro

Suite = Section.FindS("Suite");
Codename = Section.FindS("Codename");
{
std::string const archs = Section.FindS("Architectures");
if (archs.empty() == false)
d->Architectures = VectorizeString(archs, ' ');
}

bool FoundHashSum = false;
for (int i=0;HashString::SupportedHashes()[i] != NULL; i++)
@@ -591,6 +606,13 @@ bool debReleaseIndex::IsTrusted() const
return FileExists(MetaIndexFile("InRelease"));
}
/*}}}*/
bool debReleaseIndex::IsArchitectureSupported(std::string const &arch) const/*{{{*/
{
if (d->Architectures.empty())
return true;
return std::find(d->Architectures.begin(), d->Architectures.end(), arch) != d->Architectures.end();
}
/*}}}*/
std::vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() /*{{{*/
{
if (Indexes != NULL)
@@ -729,6 +751,10 @@ static std::vector<std::string> parsePlusMinusOptions(std::string const &Name, /
else
Values = defaultValues;

// all is a very special architecture users shouldn't be concerned with explicitly
if (Name == "arch" && std::find(Values.begin(), Values.end(), "all") == Values.end())
Values.push_back("all");

if ((val = Options.find(Name + "+")) != Options.end())
{
std::vector<std::string> const plus = VectorizeString(val->second, ',');


+ 1
- 0
apt-pkg/deb/debmetaindex.h View File

@@ -58,6 +58,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex
bool SetSignedBy(std::string const &SignedBy);

virtual bool IsTrusted() const APT_OVERRIDE;
bool IsArchitectureSupported(std::string const &arch) const;

void AddComponent(std::string const &sourcesEntry,
bool const isSrc, std::string const &Name,


+ 11
- 0
apt-pkg/metaindex.cc View File

@@ -3,6 +3,8 @@
#include <apt-pkg/indexfile.h>
#include <apt-pkg/metaindex.h>

#include <apt-pkg/debmetaindex.h>

#include <string>
#include <vector>
/*}}}*/
@@ -100,3 +102,12 @@ void metaIndex::swapLoad(metaIndex * const OldMetaIndex) /*{{{*/
std::swap(LoadedSuccessfully, OldMetaIndex->LoadedSuccessfully);
}
/*}}}*/

bool metaIndex::IsArchitectureSupported(std::string const &arch) const /*{{{*/
{
debReleaseIndex const * const deb = dynamic_cast<debReleaseIndex const *>(this);
if (deb != NULL)
return deb->IsArchitectureSupported(arch);
return true;
}
/*}}}*/

+ 3
- 0
apt-pkg/metaindex.h View File

@@ -107,6 +107,9 @@ public:
metaIndex(std::string const &URI, std::string const &Dist,
char const * const Type);
virtual ~metaIndex();

// FIXME: make virtual on next abi break
bool IsArchitectureSupported(std::string const &arch) const;
};

#endif

+ 8
- 4
doc/apt-ftparchive.1.xml View File

@@ -368,9 +368,13 @@ for i in Sections do
<varlistentry><term><option>Architectures</option></term>
<listitem><para>
This is a space separated list of all the
architectures that appear under search section. The special architecture
'source' is used to indicate that this tree has a source archive.</para></listitem>
This is a space separated list of all the architectures that appear under
search section. The special architecture 'source' is used to indicate
that this tree has a source archive. The architecture 'all' signals that
architecture specific files like <filename>Packages</filename> should not
include information about architecture <literal>all</literal> packages in
all files as they will be available in a dedicated file.
</para></listitem>
</varlistentry>

<varlistentry><term><option>LongDescription</option></term>
@@ -589,7 +593,7 @@ for i in Sections do
</varlistentry>

&apt-commonoptions;
</variablelist>
</refsect1>



+ 28
- 16
ftparchive/apt-ftparchive.cc View File

@@ -68,6 +68,7 @@ struct PackageMap

// We generate for this given arch
string Arch;
bool IncludeArchAll;
// Stuff for the Source File
string SrcFile;
@@ -122,9 +123,9 @@ struct PackageMap
vector<PackageMap>::iterator End,
unsigned long &Left);
PackageMap() : LongDesc(true), TransWriter(NULL), DeLinkLimit(0), Permissions(1),
ContentsDone(false), PkgDone(false), SrcDone(false),
ContentsMTime(0) {};
PackageMap() : IncludeArchAll(true), LongDesc(true), TransWriter(NULL),
DeLinkLimit(0), Permissions(1), ContentsDone(false),
PkgDone(false), SrcDone(false), ContentsMTime(0) {};
};
/*}}}*/

@@ -184,7 +185,7 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats)
PackagesWriter Packages(&Comp.Input, TransWriter, flCombine(CacheDir,BinCacheDB),
flCombine(OverrideDir,BinOverride),
flCombine(OverrideDir,ExtraOverride),
Arch);
Arch, IncludeArchAll);
if (PkgExt.empty() == false && Packages.SetExts(PkgExt) == false)
return _error->Error(_("Package extension list is too long"));
if (_error->PendingError() == true)
@@ -364,7 +365,7 @@ bool PackageMap::GenContents(Configuration &Setup,
MultiCompress Comp(flCombine(ArchiveDir,this->Contents),
CntCompress,Permissions);
Comp.UpdateMTime = Setup.FindI("Default::ContentsAge",10)*24*60*60;
ContentsWriter Contents(&Comp.Input, "", Arch);
ContentsWriter Contents(&Comp.Input, "", Arch, IncludeArchAll);
if (PkgExt.empty() == false && Contents.SetExts(PkgExt) == false)
return _error->Error(_("Package extension list is too long"));
if (_error->PendingError() == true)
@@ -487,6 +488,8 @@ static void LoadTree(vector<PackageMap> &PkgList, std::vector<TranslationWriter*
bool const LongDescription = Setup.FindB("Default::LongDescription",
_config->FindB("APT::FTPArchive::LongDescription", true));
string const TranslationCompress = Setup.Find("Default::Translation::Compress",". gzip").c_str();
bool const ConfIncludeArchAllExists = _config->Exists("APT::FTPArchive::IncludeArchitectureAll");
bool const ConfIncludeArchAll = _config->FindB("APT::FTPArchive::IncludeArchitectureAll", true);

// Process 'tree' type sections
const Configuration::Item *Top = Setup.Tree("tree");
@@ -501,25 +504,32 @@ static void LoadTree(vector<PackageMap> &PkgList, std::vector<TranslationWriter*
string Section;
while (ParseQuoteWord(Sections,Section) == true)
{
string Arch;
struct SubstVar const Vars[] = {{"$(DIST)",&Dist},
struct SubstVar Vars[] = {{"$(DIST)",&Dist},
{"$(SECTION)",&Section},
{"$(ARCH)",&Arch},
{NULL, NULL}};
{"$(ARCH)",nullptr},
{nullptr, nullptr}};
mode_t const Perms = Block.FindI("FileMode", Permissions);
bool const LongDesc = Block.FindB("LongDescription", LongDescription);
TranslationWriter *TransWriter = NULL;

string const Tmp2 = Block.Find("Architectures");
const char *Archs = Tmp2.c_str();
while (ParseQuoteWord(Archs,Arch) == true)
TranslationWriter *TransWriter = nullptr;

std::string Tmp2 = Block.Find("Architectures");
std::transform(Tmp2.begin(), Tmp2.end(), Tmp2.begin(), ::tolower);
std::vector<std::string> const Archs = VectorizeString(Tmp2, ' ');
bool IncludeArchAll;
if (ConfIncludeArchAllExists == true)
IncludeArchAll = ConfIncludeArchAll;
else
IncludeArchAll = std::find(Archs.begin(), Archs.end(), "all") == Archs.end();
for (auto const& Arch: Archs)
{
if (Arch.empty()) continue;
Vars[2].Contents = &Arch;
PackageMap Itm;
Itm.Permissions = Perms;
Itm.BinOverride = SubstVar(Block.Find("BinOverride"),Vars);
Itm.InternalPrefix = SubstVar(Block.Find("InternalPrefix",DIPrfx.c_str()),Vars);

if (stringcasecmp(Arch,"source") == 0)
if (Arch == "source")
{
Itm.SrcOverride = SubstVar(Block.Find("SrcOverride"),Vars);
Itm.BaseDir = SubstVar(Block.Find("SrcDirectory",DSDir.c_str()),Vars);
@@ -536,6 +546,7 @@ static void LoadTree(vector<PackageMap> &PkgList, std::vector<TranslationWriter*
Itm.PkgFile = SubstVar(Block.Find("Packages",DPkg.c_str()),Vars);
Itm.Tag = SubstVar("$(DIST)/$(SECTION)/$(ARCH)",Vars);
Itm.Arch = Arch;
Itm.IncludeArchAll = IncludeArchAll;
Itm.LongDesc = LongDesc;
if (TransWriter == NULL && DTrans.empty() == false && LongDesc == false && DTrans != "/dev/null")
{
@@ -662,7 +673,8 @@ static bool SimpleGenPackages(CommandLine &CmdL)
// Create a package writer object.
PackagesWriter Packages(NULL, NULL, _config->Find("APT::FTPArchive::DB"),
Override, "", _config->Find("APT::FTPArchive::Architecture"));
Override, "", _config->Find("APT::FTPArchive::Architecture"),
_config->FindB("APT::FTPArchive::IncludeArchitectureAll", true));
if (_error->PendingError() == true)
return false;


+ 33
- 30
ftparchive/writer.cc View File

@@ -71,7 +71,8 @@ static void ConfigToDoHashes(unsigned int &DoHashes, std::string const &Conf)
/*}}}*/

// FTWScanner::FTWScanner - Constructor /*{{{*/
FTWScanner::FTWScanner(FileFd * const GivenOutput, string const &Arch): Arch(Arch), DoHashes(~0)
FTWScanner::FTWScanner(FileFd * const GivenOutput, string const &Arch, bool const IncludeArchAll)
: Arch(Arch), IncludeArchAll(IncludeArchAll), DoHashes(~0)
{
if (GivenOutput == NULL)
{
@@ -326,6 +327,32 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
FileName = OriginalPath;
}
return true;
}
/*}}}*/
// FTWScanner::SetExts - Set extensions to support /*{{{*/
// ---------------------------------------------------------------------
/* */
bool FTWScanner::SetExts(string const &Vals)
{
ClearPatterns();
string::size_type Start = 0;
while (Start <= Vals.length()-1)
{
string::size_type const Space = Vals.find(' ',Start);
string::size_type const Length = ((Space == string::npos) ? Vals.length() : Space) - Start;
if ( Arch.empty() == false )
{
AddPattern(string("*_") + Arch + Vals.substr(Start, Length));
if (IncludeArchAll == true && Arch != "all")
AddPattern(string("*_all") + Vals.substr(Start, Length));
}
else
AddPattern(string("*") + Vals.substr(Start, Length));

Start += Length + 1;
}

return true;
}
/*}}}*/
@@ -335,8 +362,8 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
/* */
PackagesWriter::PackagesWriter(FileFd * const GivenOutput, TranslationWriter * const transWriter,
string const &DB,string const &Overrides,string const &ExtOverrides,
string const &Arch) :
FTWScanner(GivenOutput, Arch), Db(DB), Stats(Db.Stats), TransWriter(transWriter)
string const &Arch, bool const IncludeArchAll) :
FTWScanner(GivenOutput, Arch, IncludeArchAll), Db(DB), Stats(Db.Stats), TransWriter(transWriter)
{
SetExts(".deb .udeb");
DeLinkLimit = 0;
@@ -363,31 +390,6 @@ PackagesWriter::PackagesWriter(FileFd * const GivenOutput, TranslationWriter * c
_error->DumpErrors();
}
/*}}}*/
// FTWScanner::SetExts - Set extensions to support /*{{{*/
// ---------------------------------------------------------------------
/* */
bool FTWScanner::SetExts(string const &Vals)
{
ClearPatterns();
string::size_type Start = 0;
while (Start <= Vals.length()-1)
{
string::size_type const Space = Vals.find(' ',Start);
string::size_type const Length = ((Space == string::npos) ? Vals.length() : Space) - Start;
if ( Arch.empty() == false )
{
AddPattern(string("*_") + Arch + Vals.substr(Start, Length));
AddPattern(string("*_all") + Vals.substr(Start, Length));
}
else
AddPattern(string("*") + Vals.substr(Start, Length));

Start += Length + 1;
}

return true;
}
/*}}}*/
// PackagesWriter::DoPackage - Process a single package /*{{{*/
// ---------------------------------------------------------------------
/* This method takes a package and gets its control information and
@@ -879,8 +881,9 @@ bool SourcesWriter::DoPackage(string FileName)
// ContentsWriter::ContentsWriter - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
ContentsWriter::ContentsWriter(FileFd * const GivenOutput, string const &DB, string const &Arch) :
FTWScanner(GivenOutput, Arch), Db(DB), Stats(Db.Stats)
ContentsWriter::ContentsWriter(FileFd * const GivenOutput, string const &DB,
string const &Arch, bool const IncludeArchAll) :
FTWScanner(GivenOutput, Arch, IncludeArchAll), Db(DB), Stats(Db.Stats)

{
SetExts(".deb");


+ 6
- 3
ftparchive/writer.h View File

@@ -40,6 +40,7 @@ class FTWScanner
protected:
vector<string> Patterns;
string Arch;
bool IncludeArchAll;
const char *OriginalPath;
bool ErrorPrinted;

@@ -79,7 +80,7 @@ class FTWScanner
void AddPatterns(std::vector<std::string> const &patterns) { Patterns.insert(Patterns.end(), patterns.begin(), patterns.end()); };
bool SetExts(string const &Vals);

FTWScanner(FileFd * const Output, string const &Arch = string());
FTWScanner(FileFd * const Output, string const &Arch = string(), bool const IncludeArchAll = true);
virtual ~FTWScanner();
};

@@ -125,7 +126,8 @@ class PackagesWriter : public FTWScanner
PackagesWriter(FileFd * const Output, TranslationWriter * const TransWriter, string const &DB,
string const &Overrides,
string const &ExtOverrides = "",
string const &Arch = "");
string const &Arch = "",
bool const IncludeArchAll = true);
virtual ~PackagesWriter();
};

@@ -149,7 +151,8 @@ class ContentsWriter : public FTWScanner
void Finish() {Gen.Print(*Output);};
inline bool ReadyDB(string const &DB) {return Db.ReadyDB(DB);};

ContentsWriter(FileFd * const Output, string const &DB, string const &Arch = string());
ContentsWriter(FileFd * const Output, string const &DB, string const &Arch = string(),
bool const IncludeArchAll = true);
virtual ~ContentsWriter() {};
};



+ 15
- 7
test/integration/framework View File

@@ -774,7 +774,7 @@ EOF
for DIST in $(find ./pool/ -maxdepth 1 -name '*.pkglist' -type f | cut -d'/' -f 3 | cut -d'.' -f 1 | sort | uniq); do
cat <<EOF
tree "dists/$DIST" {
Architectures "$ARCHS source";
Architectures "$ARCHS all source";
FileList "${DIST}.\$(SECTION).pkglist";
SourceFileList "${DIST}.\$(SECTION).srclist";
Sections "$(find ./pool/ -maxdepth 1 -name "${DIST}.*.pkglist" -type f | cut -d'/' -f 3 | cut -d'.' -f 2 | sort | uniq | tr '\n' ' ')";
@@ -816,7 +816,7 @@ insertpackage() {
continue
fi
for arch in $(getarchitecturesfromcommalist "$ARCH"); do
if [ "$arch" = 'all' -o "$arch" = 'none' ]; then
if [ "$arch" = 'none' ]; then
ARCHS="$(getarchitectures)"
else
ARCHS="$arch"
@@ -962,6 +962,7 @@ getcodenamefromsuite() {
getreleaseversionfromsuite() { true; }
getlabelfromsuite() { true; }
getoriginfromsuite() { true; }
getarchitecturesfromreleasefile() { echo "all $(getarchitectures)"; }

aptftparchiverelease() {
aptftparchive -qq release "$@" | sed -e '/0 Release$/ d' # remove the self reference
@@ -969,9 +970,12 @@ aptftparchiverelease() {
generatereleasefiles() {
# $1 is the Date header and $2 is the ValidUntil header to be set
# both should be given in notation date/touch can understand
local DATE="$1"
local VALIDUNTIL="$2"
msgninfo "\tGenerate Release files… "
if [ -e aptarchive/dists ]; then
for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do
local ARCHITECTURES="$(getarchitecturesfromreleasefile "$dir")"
local SUITE="$(echo "$dir" | cut -d'/' -f 4)"
local CODENAME="$(getcodenamefromsuite $SUITE)"
local VERSION="$(getreleaseversionfromsuite $SUITE)"
@@ -986,9 +990,13 @@ generatereleasefiles() {
if [ -n "$ORIGIN" ]; then
ORIGIN="-o APT::FTPArchive::Release::Origin=${ORIGIN}"
fi
if [ -n "$ARCHITECTURES" ]; then
ARCHITECTURES="-o APT::FTPArchive::Release::Architectures=${ARCHITECTURES}"
fi
aptftparchiverelease "$dir" \
-o APT::FTPArchive::Release::Suite="${SUITE}" \
-o APT::FTPArchive::Release::Codename="${CODENAME}" \
${ARCHITECTURES} \
${LABEL} \
${ORIGIN} \
${VERSION} \
@@ -1001,15 +1009,15 @@ NotAutomatic: yes' "$dir/Release"
else
aptftparchiverelease ./aptarchive > aptarchive/Release
fi
if [ -n "$1" -a "$1" != "now" ]; then
if [ -n "$DATE" -a "$DATE" != "now" ]; then
for release in $(find ./aptarchive -name 'Release'); do
sed -i "s/^Date: .*$/Date: $(date -d "$1" '+%a, %d %b %Y %H:%M:%S %Z')/" "$release"
touch -d "$1" "$release"
sed -i "s/^Date: .*$/Date: $(date -d "$DATE" '+%a, %d %b %Y %H:%M:%S %Z')/" "$release"
touch -d "$DATE" "$release"
done
fi
if [ -n "$2" ]; then
if [ -n "$VALIDUNTIL" ]; then
sed -i "/^Date: / a\
Valid-Until: $(date -d "$2" '+%a, %d %b %Y %H:%M:%S %Z')" $(find ./aptarchive -name 'Release')
Valid-Until: $(date -d "$VALIDUNTIL" '+%a, %d %b %Y %H:%M:%S %Z')" $(find ./aptarchive -name 'Release')
fi
msgdone "info"
}


+ 71
- 0
test/integration/test-acquire-binary-all View File

@@ -0,0 +1,71 @@
#!/bin/sh
set -e

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'amd64'

buildsimplenativepackage 'foo-1' 'all' '2' 'unstable'
buildsimplenativepackage 'foo-2' 'amd64' '2' 'unstable'
setupaptarchive --no-update

msgmsg 'Releasefile with Architectures field and all included'
testsuccess apt update
cp rootdir/tmp/testsuccess.output aptupdate.output
testsuccess grep '^Get.* all Packages ' aptupdate.output
testequal 'foo-1
foo-2' aptcache pkgnames foo-

listcurrentlistsdirectory > lists.before
testsuccess grep '_binary-all_Packages' lists.before

configarchitecture 'amd64' 'i386'
testsuccessequal "All packages are up to date.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:$(readlink -f ./aptarchive) unstable InRelease' doesn't support architecture 'i386'" apt update -q=0 -o quiet::NoProgress=1
testfileequal lists.before "$(listcurrentlistsdirectory)"
testequal 'foo-1
foo-2' aptcache pkgnames foo-

rm -rf rootdir/var/lib/apt/lists
msgmsg 'Releasefile with Architectures field but without all'
getarchitecturesfromreleasefile() { echo "$(getarchitectures)"; }
generatereleasefiles
signreleasefiles
testsuccessequal "All packages are up to date.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:$(readlink -f ./aptarchive) unstable InRelease' doesn't support architecture 'i386'" apt update -q=0 -o quiet::NoProgress=1
cp rootdir/tmp/testsuccess.output aptupdate.output
testfailure grep '^Get.* all Packages ' aptupdate.output
testequal 'foo-2' aptcache pkgnames foo-

configarchitecture 'amd64'
testsuccess apt update
cp rootdir/tmp/testsuccess.output aptupdate.output
testfailure grep '^Get.* all Packages ' aptupdate.output
testequal 'foo-2' aptcache pkgnames foo-

rm -rf rootdir/var/lib/apt/lists
msgmsg 'Releasefile without Architectures field'
getarchitecturesfromreleasefile() { echo -n ''; }
generatereleasefiles
signreleasefiles
testsuccess apt update
cp rootdir/tmp/testsuccess.output aptupdate.output
testsuccess grep '^Get.* all Packages ' aptupdate.output
testequal 'foo-1
foo-2' aptcache pkgnames foo-

# apt doesn't know supported archs, so missing a configured arch is a failure
configarchitecture 'amd64' 'i386'
testfailure apt update -q=0
testequal 'foo-1
foo-2' aptcache pkgnames foo-

msgmsg 'No Releasefile'
rm -rf rootdir/var/lib/apt/lists
find aptarchive -name '*Release*' -delete
configarchitecture 'amd64'
testfailure apt update
testwarning apt update --allow-insecure-repositories
testequal 'foo-1
foo-2' aptcache pkgnames foo-

+ 8
- 8
test/integration/test-acquire-same-repository-multiple-times View File

@@ -55,17 +55,17 @@ tworepos() {
Candidate: 1.0
Version table:
1.0 500
500 $1:$2 jessie/main amd64 Packages
500 $1:$2 stable/main amd64 Packages" aptcache policy foo
500 $1:$2 jessie/main all Packages
500 $1:$2 stable/main all Packages" aptcache policy foo
testfailure aptcache show foo/unstable
testsuccess aptcache show foo/stable
testsuccess aptcache show foo/jessie
}

tworepos 'file' "$APTARCHIVE" 'no partial'
testequal '12' grep -c '200%20URI%20Start' ./download.log
testequal '12' grep -c '201%20URI%20Done' ./download.log
testequal '6' grep -c '^ @ Queue: Action combined' ./download.log
testequal '14' grep -c '200%20URI%20Start' ./download.log
testequal '14' grep -c '201%20URI%20Done' ./download.log
testequal '8' grep -c '^ @ Queue: Action combined' ./download.log
tworepos 'file' "$APTARCHIVE" 'hit'
testequal '6' grep -c '200%20URI%20Start' ./download.log
testequal '6' grep -c '201%20URI%20Done' ./download.log
@@ -75,9 +75,9 @@ rm -rf rootdir/var/lib/apt/lists
changetowebserver

tworepos 'http' "//localhost:${APTHTTPPORT}" 'no partial'
testequal '10' grep -c '200%20URI%20Start' ./download.log
testequal '10' grep -c '201%20URI%20Done' ./download.log
testequal '6' grep -c '^ @ Queue: Action combined' ./download.log
testequal '12' grep -c '200%20URI%20Start' ./download.log
testequal '12' grep -c '201%20URI%20Done' ./download.log
testequal '8' grep -c '^ @ Queue: Action combined' ./download.log
tworepos 'http' "//localhost:${APTHTTPPORT}" 'hit'
testequal '2' grep -c '200%20URI%20Start' ./download.log
testequal '4' grep -c '201%20URI%20Done' ./download.log


+ 40
- 13
test/integration/test-apt-acquire-additional-files View File

@@ -19,12 +19,14 @@ changetowebserver
testequal "'http://localhost:${APTHTTPPORT}/dists/unstable/InRelease' localhost:${APTHTTPPORT}_dists_unstable_InRelease 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/source/Sources.xz' localhost:${APTHTTPPORT}_dists_unstable_main_source_Sources 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-amd64/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-amd64_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-all_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.xz' localhost:${APTHTTPPORT}_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris

testsuccessequal "Get:1 http://localhost:${APTHTTPPORT} unstable InRelease [$(stat -c%s aptarchive/dists/unstable/InRelease) B]
Get:2 http://localhost:${APTHTTPPORT} unstable/main Sources [$(stat -c%s aptarchive/dists/unstable/main/source/Sources.gz) B]
Get:3 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages [$(stat -c%s aptarchive/dists/unstable/main/binary-amd64/Packages.gz) B]
Get:4 http://localhost:${APTHTTPPORT} unstable/main Translation-en [$(stat -c%s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
Get:4 http://localhost:${APTHTTPPORT} unstable/main all Packages [$(stat -c%s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
Get:5 http://localhost:${APTHTTPPORT} unstable/main Translation-en [$(stat -c%s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
Reading package lists..." aptget update

testempty find rootdir/var/lib/apt/lists -name '*Contents*'
@@ -37,40 +39,59 @@ Acquire::IndexTargets::deb::Contents {
};
EOF

testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64)" aptget indextargets --no-release-info --format '$(FILENAME)' 'Created-By: Contents'
readfile() {
while [ -n "$1" ]; do
readlink -f "./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_${1}"
shift
done
}

testequal "$(readfile Contents-amd64 Contents-all)" aptget indextargets --no-release-info --format '$(FILENAME)' 'Created-By: Contents'
testempty aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
# lets fake the existence of a compressed Contents file
touch ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz
testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
touch "./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz"
testequal "$(readfile Contents-amd64.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
touch "./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all.gz"
testequal "$(readfile Contents-amd64.gz Contents-all.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'

testequal "'http://localhost:${APTHTTPPORT}/dists/unstable/InRelease' localhost:${APTHTTPPORT}_dists_unstable_InRelease 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/source/Sources.xz' localhost:${APTHTTPPORT}_dists_unstable_main_source_Sources 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-amd64/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-amd64_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-all_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.xz' localhost:${APTHTTPPORT}_dists_unstable_main_i18n_Translation-en 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/Contents-amd64.xz' localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64 0 " aptget update --print-uris
'http://localhost:${APTHTTPPORT}/dists/unstable/main/Contents-amd64.xz' localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/Contents-all.xz' localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all 0 " aptget update --print-uris

testsuccessequal "Hit:1 http://localhost:${APTHTTPPORT} unstable InRelease
Get:2 http://localhost:${APTHTTPPORT} unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B]
Get:3 http://localhost:${APTHTTPPORT} unstable/main all Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-all.gz) B]
Reading package lists..." aptget update

testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64" find rootdir/var/lib/apt/lists -name '*Contents*'
testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64" find rootdir/var/lib/apt/lists -name '*Contents-amd64*'
testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all" find rootdir/var/lib/apt/lists -name '*Contents-all*'
testequal "$(readfile Contents-amd64 Contents-all)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
testsuccess cmp "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64" 'aptarchive/dists/unstable/main/Contents-amd64'
testsuccess cmp "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all" 'aptarchive/dists/unstable/main/Contents-all'

rm ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64
rm ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64 \
./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all
testempty aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'

# if we asked for keeping it compressed, keep it
echo 'Acquire::IndexTargets::deb::Contents::KeepCompressed "true";' >> rootdir/etc/apt/apt.conf.d/content-target.conf
testsuccessequal "Hit:1 http://localhost:${APTHTTPPORT} unstable InRelease
Get:2 http://localhost:${APTHTTPPORT} unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B]
Get:3 http://localhost:${APTHTTPPORT} unstable/main all Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-all.gz) B]
Reading package lists..." aptget update

testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz" find rootdir/var/lib/apt/lists -name '*Contents*'
testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz" find rootdir/var/lib/apt/lists -name '*Contents-amd64*'
testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all.gz" find rootdir/var/lib/apt/lists -name '*Contents-all*'
testequal "$(readfile Contents-amd64.gz Contents-all.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
testsuccess cmp "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz" 'aptarchive/dists/unstable/main/Contents-amd64.gz'
testsuccess cmp "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all.gz" 'aptarchive/dists/unstable/main/Contents-all.gz'

rm ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz
rm ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all.gz
testempty aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'

# and no automatic uncompress based on the name please,
@@ -87,22 +108,28 @@ EOF
testequal "'http://localhost:${APTHTTPPORT}/dists/unstable/InRelease' localhost:${APTHTTPPORT}_dists_unstable_InRelease 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/source/Sources.xz' localhost:${APTHTTPPORT}_dists_unstable_main_source_Sources 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-amd64/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-amd64_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-all_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.xz' localhost:${APTHTTPPORT}_dists_unstable_main_i18n_Translation-en 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/Contents-amd64.gz.xz' localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz 0 " aptget update --print-uris
'http://localhost:${APTHTTPPORT}/dists/unstable/main/Contents-amd64.gz.xz' localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/Contents-all.gz.xz' localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all.gz 0 " aptget update --print-uris

testsuccessequal "Hit:1 http://localhost:${APTHTTPPORT} unstable InRelease
Get:2 http://localhost:${APTHTTPPORT} unstable/main amd64 Contents.gz [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B]
Get:3 http://localhost:${APTHTTPPORT} unstable/main all Contents.gz [$(stat -c%s aptarchive/dists/unstable/main/Contents-all.gz) B]
Reading package lists..." aptget update

testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz" find rootdir/var/lib/apt/lists -name '*Contents*'
testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz" find rootdir/var/lib/apt/lists -name '*Contents-amd64*'
testequal "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all.gz" find rootdir/var/lib/apt/lists -name '*Contents-all*'
testequal "$(readfile Contents-amd64.gz Contents-all.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents'
testsuccess cmp "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-amd64.gz" 'aptarchive/dists/unstable/main/Contents-amd64.gz'
testsuccess cmp "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_Contents-all.gz" 'aptarchive/dists/unstable/main/Contents-all.gz'

rm -f rootdir/etc/apt/apt.conf.d/content-target.conf

testequal "'http://localhost:${APTHTTPPORT}/dists/unstable/InRelease' localhost:${APTHTTPPORT}_dists_unstable_InRelease 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/source/Sources.xz' localhost:${APTHTTPPORT}_dists_unstable_main_source_Sources 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-amd64/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-amd64_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.xz' localhost:${APTHTTPPORT}_dists_unstable_main_binary-all_Packages 0
'http://localhost:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.xz' localhost:${APTHTTPPORT}_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris

testsuccessequal "Hit:1 http://localhost:${APTHTTPPORT} unstable InRelease


+ 16
- 1
test/integration/test-apt-acquire-additional-files-duplicates View File

@@ -38,9 +38,11 @@ testsuccessequal "${APTLISTS}/example.org_debian_dists_stable_main_source_Source
${APTLISTS}/example.org_debian_dists_stable_rocks_source_Sources
${APTLISTS}/example.org_debian_dists_stable_main_binary-amd64_Packages
${APTLISTS}/example.org_debian_dists_stable_main_binary-i386_Packages
${APTLISTS}/example.org_debian_dists_stable_main_binary-all_Packages
${APTLISTS}/example.org_debian_dists_stable_main_i18n_Translation-en
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-amd64_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-i386_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-all_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_i18n_Translation-en" aptget indextargets --no-release-info --format '$(FILENAME)'

cat >> rootdir/etc/apt/sources.list <<EOF
@@ -50,15 +52,19 @@ testwarningequal "${APTLISTS}/example.org_debian_dists_stable_main_source_Source
${APTLISTS}/example.org_debian_dists_stable_rocks_source_Sources
${APTLISTS}/example.org_debian_dists_stable_main_binary-amd64_Packages
${APTLISTS}/example.org_debian_dists_stable_main_binary-i386_Packages
${APTLISTS}/example.org_debian_dists_stable_main_binary-all_Packages
${APTLISTS}/example.org_debian_dists_stable_main_i18n_Translation-en
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-amd64_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-i386_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-all_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_i18n_Translation-en
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (rocks/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (rocks/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (rocks/binary-all/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Translations (rocks/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3" aptget indextargets --no-release-info --format '$(FILENAME)'

cat >> rootdir/etc/apt/sources.list <<EOF
@@ -69,18 +75,27 @@ testwarningequal "${APTLISTS}/example.org_debian_dists_stable_main_source_Source
${APTLISTS}/example.org_debian_dists_stable_rocks_source_Sources
${APTLISTS}/example.org_debian_dists_stable_main_binary-amd64_Packages
${APTLISTS}/example.org_debian_dists_stable_main_binary-i386_Packages
${APTLISTS}/example.org_debian_dists_stable_main_binary-all_Packages
${APTLISTS}/example.org_debian_dists_stable_main_i18n_Translation-en
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-amd64_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-i386_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_binary-all_Packages
${APTLISTS}/example.org_debian_dists_stable_rocks_i18n_Translation-en
${APTLISTS}/example.org_debian_dists_stable_main_Contents-amd64
${APTLISTS}/example.org_debian_dists_stable_main_Contents-all
${APTLISTS}/example.org_debian_dists_stable_Contents-amd64
${APTLISTS}/example.org_debian_dists_stable_Contents-all
${APTLISTS}/example.org_debian_dists_stable_rocks_Contents-amd64
${APTLISTS}/example.org_debian_dists_stable_rocks_Contents-all
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (rocks/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (rocks/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Packages (rocks/binary-all/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Translations (rocks/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3
W: Target Contents2 wants to acquire the same file (main/Contents-amd64) as Contents1 from source ${APTETC}/sources.list:4
W: Target Contents2 wants to acquire the same file (rocks/Contents-amd64) as Contents1 from source ${APTETC}/sources.list:4" aptget indextargets --no-release-info --format '$(FILENAME)'
W: Target Contents2 wants to acquire the same file (main/Contents-all) as Contents1 from source ${APTETC}/sources.list:4
W: Target Contents2 wants to acquire the same file (rocks/Contents-amd64) as Contents1 from source ${APTETC}/sources.list:4
W: Target Contents2 wants to acquire the same file (rocks/Contents-all) as Contents1 from source ${APTETC}/sources.list:4" aptget indextargets --no-release-info --format '$(FILENAME)'

+ 4
- 0
test/integration/test-apt-by-hash-update View File

@@ -10,6 +10,7 @@ confighashes 'SHA512'
configcompression '.' 'gz'

insertpackage 'unstable' 'foo' 'all' '1.0'
insertpackage 'unstable' 'bar' 'i386' '1.0'

setupaptarchive --no-update

@@ -22,6 +23,7 @@ makebyhashonly() {
ln -s "${BYHASH}/${2}.gz" "${BYHASH}/$(sha512sum "${BYHASH}/${2}.gz" | cut -f1 -d' ')"
}
makebyhashonly 'binary-i386' 'Packages'
makebyhashonly 'binary-all' 'Packages'
makebyhashonly 'source' 'Sources'

ensureitsbroken() {
@@ -46,6 +48,8 @@ ensureitworks() {
testsuccess grep '^Ign' rootdir/tmp/aptupdate.output
testsuccessequal "Inst foo (1.0 unstable [all])
Conf foo (1.0 unstable [all])" aptget install -qq -s foo
testsuccessequal "Inst bar (1.0 unstable [i386])
Conf bar (1.0 unstable [i386])" aptget install -qq -s bar
}
msgmsg 'Test by-hash via' 'config option'
ensureitworks -o Acquire::By-Hash=force


+ 1
- 2
test/integration/test-apt-cache View File

@@ -55,8 +55,7 @@ testsuccessequal 'bar' aptcache pkgnames bar
testsuccessequal 'fancy
foo' aptcache pkgnames f

testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages
foo | 1 | file:$(readlink -f .)/aptarchive unstable/main i386 Packages" aptcache madison foo
testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main all Packages" aptcache madison foo

### depends



+ 4
- 4
test/integration/test-apt-cdrom View File

@@ -51,7 +51,7 @@ Unmounting CD-ROM...
Repeat this process for the rest of the CDs in your set."

testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
Found 3 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
Found label 'Debian APT Testdisk 0.8.15'
$CDROM_POST" aptcdromlog add

@@ -116,18 +116,18 @@ testcdromusage

# check Idempotence of apt-cdrom (and disabling of Translation dropping)
testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
Found 3 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
$CDROM_POST" aptcdromlog add -o APT::CDROM::DropTranslation=0

# take Translations from previous runs as needed
testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
Found 3 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
$CDROM_POST" aptcdromlog add
msgtest 'Test for the german description translation of' 'testing'
aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
rm -rf rootdir/var/lib/apt/lists
testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
Found 3 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
$CDROM_POST" aptcdromlog add
msgtest 'Test for the english description translation of' 'testing'
aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail


+ 1
- 1
test/integration/test-apt-cli-show View File

@@ -32,7 +32,7 @@ Maintainer: Joe Sixpack <joe@example.org>
Installed-Size: 43.0 kB
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: file:$APTARCHIVE unstable/main i386 Packages
APT-Sources: file:$APTARCHIVE unstable/main all Packages
Description: Some description
That has multiple lines
" apt show foo


+ 21
- 9
test/integration/test-apt-get-update-unauth-warning View File

@@ -37,7 +37,9 @@ testequal 'lock
partial' ls rootdir/var/lib/apt/lists

filesize() {
stat -c%s "$(aptget indextargets --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz"
local CREATEDBY="$1"
shift
stat -c%s "$(aptget indextargets --no-release-info --format '$(URI)' "Created-By: $CREATEDBY" "$@" | cut -d'/' -f 3- ).gz"
}
# allow override
#aptget update --allow-insecure-repositories -o Debug::pkgAcquire::worker=1
@@ -54,8 +56,11 @@ Ign:3 file:$APTARCHIVE unstable/main Sources
Get:4 file:$APTARCHIVE unstable/main i386 Packages
Ign:4 file:$APTARCHIVE unstable/main i386 Packages
File not found
Get:5 file:$APTARCHIVE unstable/main Translation-en
Ign:5 file:$APTARCHIVE unstable/main Translation-en
Get:5 file:$APTARCHIVE unstable/main all Packages
Ign:5 file:$APTARCHIVE unstable/main all Packages
File not found
Get:6 file:$APTARCHIVE unstable/main Translation-en
Ign:6 file:$APTARCHIVE unstable/main Translation-en
File not found
Get:3 file:$APTARCHIVE unstable/main Sources
Ign:3 file:$APTARCHIVE unstable/main Sources
@@ -63,8 +68,11 @@ Ign:3 file:$APTARCHIVE unstable/main Sources
Get:4 file:$APTARCHIVE unstable/main i386 Packages
Ign:4 file:$APTARCHIVE unstable/main i386 Packages
File not found
Get:5 file:$APTARCHIVE unstable/main Translation-en
Ign:5 file:$APTARCHIVE unstable/main Translation-en
Get:5 file:$APTARCHIVE unstable/main all Packages
Ign:5 file:$APTARCHIVE unstable/main all Packages
File not found
Get:6 file:$APTARCHIVE unstable/main Translation-en
Ign:6 file:$APTARCHIVE unstable/main Translation-en
File not found
Get:3 file:$APTARCHIVE unstable/main Sources
Ign:3 file:$APTARCHIVE unstable/main Sources
@@ -72,12 +80,16 @@ Ign:3 file:$APTARCHIVE unstable/main Sources
Get:4 file:$APTARCHIVE unstable/main i386 Packages
Ign:4 file:$APTARCHIVE unstable/main i386 Packages
File not found
Get:5 file:$APTARCHIVE unstable/main Translation-en
Ign:5 file:$APTARCHIVE unstable/main Translation-en
Get:5 file:$APTARCHIVE unstable/main all Packages
Ign:5 file:$APTARCHIVE unstable/main all Packages
File not found
Get:6 file:$APTARCHIVE unstable/main Translation-en
Ign:6 file:$APTARCHIVE unstable/main Translation-en
File not found
Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B]
Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B]
Get:5 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B]
Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages' 'Architecture: i386') B]
Get:5 file:$APTARCHIVE unstable/main all Packages [$(filesize 'Packages' 'Architecture: all') B]
Get:6 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B]
Reading package lists...
W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file.
N: Data from such a repository can not be authenticated and is therefore potentially dangerous to use.


+ 18
- 4
test/integration/test-apt-sources-deb822 View File

@@ -30,38 +30,41 @@ msgcleantest 'Test sources.list' 'old style'
echo "deb http://ftp.debian.org/debian stable main" > $LISTS
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

msgcleantest 'Test sources.list' 'old style with tabs'
echo "deb http://ftp.debian.org/debian stable main" > $LISTS
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

msgcleantest 'Test sources.list' 'old style with forgotten end for options'
echo "deb [trusted=yes arch+=armel,powerpc http://ftp.debian.org/debian stable main" > $LISTS
testfailureequal "E: Malformed entry 1 in list file $ABSLISTS ([option] not assignment)
testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] not assignment)
E: The list of sources could not be read." aptget update --print-uris

msgcleantest 'Test sources.list' 'old style with stray ] instead of options'
echo "deb ] http://ftp.debian.org/debian stable main" > $LISTS
testfailureequal "E: Malformed entry 1 in list file $ABSLISTS (URI parse)
testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS (URI parse)
E: The list of sources could not be read." aptget update --print-uris

msgcleantest 'Test sources.list' 'old style options no key'
echo "deb [=test] http://ftp.debian.org/debian stable main" > $LISTS
testfailureequal "E: Malformed entry 1 in list file $ABSLISTS ([option] no key)
testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] no key)
E: The list of sources could not be read." aptget update --print-uris

msgcleantest 'Test sources.list' 'old style options no value'
echo "deb [test=] http://ftp.debian.org/debian stable main" > $LISTS
testfailureequal "E: Malformed entry 1 in list file $ABSLISTS ([option] no value)
testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] no value)
E: The list of sources could not be read." aptget update --print-uris

msgcleantest 'Test sources.list' 'old style with options'
echo "deb [trusted=yes arch+=armel,powerpc] http://ftp.debian.org/debian stable main" > $LISTS
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-powerpc/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-powerpc_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
@@ -70,18 +73,21 @@ msgcleantest 'Test sources.list' 'old style with comments'
echo "deb http://ftp.debian.org/debian stable main # non-free" > $LISTS
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

msgcleantest 'Test sources.list' 'old style with option comments'
echo "deb [trusted=yes#yeahreally] http://ftp.debian.org/debian stable main # non-free" > $LISTS
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

msgcleantest 'Test sources.list' 'simple deb822'
echo "$BASE" > $SOURCES
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

msgcleantest 'Test deb822 with' 'two entries'
@@ -91,9 +97,11 @@ echo "" >> $SOURCES
echo "$BASE" | sed s/stable/unstable/ >> $SOURCES
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0
'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/unstable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris

# two suite entries
@@ -101,9 +109,11 @@ msgcleantest 'Test deb822 with' 'two Suite entries'
echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0
'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/unstable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris

msgcleantest 'Test deb822' 'architecture option'
@@ -112,6 +122,7 @@ echo "Architectures: amd64 armel" >> $SOURCES
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

msgcleantest 'Test old-style' 'suite arch variable'
@@ -150,9 +161,11 @@ msgcleantest 'Test deb822 sources.list file which has' 'Multiple URIs work'
echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES
testsuccessequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0
'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.de.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.de.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.de.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

# multiple Type in one field
@@ -161,6 +174,7 @@ echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES
testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/source/Sources.xz' ftp.debian.org_debian_dists_stable_main_source_Sources 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris

# a Suite


+ 1
- 1
test/integration/test-apt-translation-has-no-packages View File

@@ -38,4 +38,4 @@ testsuccessequal "foo:
Candidate: 1.0
Version table:
1.0 500
500 file:$APTARCHIVE unstable/main amd64 Packages" aptcache policy foo
500 file:$APTARCHIVE unstable/main all Packages" aptcache policy foo

+ 2
- 2
test/integration/test-apt-update-expected-size View File

@@ -7,7 +7,7 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture "i386"

insertpackage 'unstable' 'apt' 'all' '1.0'
insertpackage 'unstable' 'apt' 'i386' '1.0'

setupaptarchive --no-update
cp -a aptarchive/dists aptarchive/dists.good
@@ -26,7 +26,7 @@ test_inreleasetoobig() {
}

test_packagestoobig() {
insertpackage 'unstable' 'foo' 'all' '1.0'
insertpackage 'unstable' 'foo' 'i386' '1.0'
buildaptarchivefromfiles '+1 hour'
signreleasefiles
# append junk at the end of the Packages.gz/Packages


+ 15
- 5
test/integration/test-apt-update-failure-propagation View File

@@ -37,14 +37,15 @@ testsuccessequal "foo:
Candidate: 2
Version table:
2 500
500 http://localhost:${APTHTTPPORT} sid/main amd64 Packages
500 http://localhost:${APTHTTPPORT} sid/main all Packages
1 500
500 https://localhost:${APTHTTPSPORT} stable/main amd64 Packages" aptcache policy foo
500 https://localhost:${APTHTTPSPORT} stable/main all Packages" aptcache policy foo

pretest
mv aptarchive/dists/stable aptarchive/dists/stable.good
testfailuremsg "E: The repository 'https://localhost:${APTHTTPSPORT} stable Release' does not have a Release file." apt update
testfailureequal "Hit:1 http://localhost:${APTHTTPPORT} sid InRelease
testfailure aptget update -q=0 --no-allow-insecure-repositories
testequalor2 "Hit:1 http://localhost:${APTHTTPPORT} sid InRelease
Ign:2 https://localhost:${APTHTTPSPORT} stable InRelease
404 Not Found
Err:3 https://localhost:${APTHTTPSPORT} stable Release
@@ -52,7 +53,16 @@ Err:3 https://localhost:${APTHTTPSPORT} stable Release
Reading package lists...
E: The repository 'https://localhost:${APTHTTPSPORT} stable Release' does not have a Release file.
N: Updating such a repository securily is impossible and therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details." aptget update -q=0 --no-allow-insecure-repositories
N: See apt-secure(8) manpage for repository creation and user configuration details." "Ign:1 https://localhost:${APTHTTPSPORT} stable InRelease
404 Not Found
Err:2 https://localhost:${APTHTTPSPORT} stable Release
404 Not Found
Hit:3 http://localhost:${APTHTTPPORT} sid InRelease
Reading package lists...
E: The repository 'https://localhost:${APTHTTPSPORT} stable Release' does not have a Release file.
N: Updating such a repository securily is impossible and therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details." cat rootdir/tmp/testfailure.output

mv aptarchive/dists/stable.good aptarchive/dists/stable
posttest() {
testsuccessequal "foo:
@@ -60,7 +70,7 @@ posttest() {
Candidate: 2
Version table:
2 500
500 http://localhost:${APTHTTPPORT} sid/main amd64 Packages" aptcache policy foo
500 http://localhost:${APTHTTPPORT} sid/main all Packages" aptcache policy foo
}
posttest



+ 4
- 4
test/integration/test-apt-update-file View File

@@ -19,8 +19,8 @@ insertsource 'unstable' 'foo' 'all' '1'
setupaptarchive --no-update

# ensure the archive is not writable
addtrap 'prefix' 'chmod 750 aptarchive/dists/unstable/main/binary-amd64;'
chmod 550 aptarchive/dists/unstable/main/binary-amd64
addtrap 'prefix' 'chmod 750 aptarchive/dists/unstable/main/binary-all;'
chmod 550 aptarchive/dists/unstable/main/binary-all

testsuccess aptget update

@@ -31,7 +31,7 @@ redatereleasefiles '+1 hour'
testsuccess aptget update -o Debug::pkgAcquire::Auth=1
# file:/ isn't shown in the log, so see if it was downloaded anyhow
cp -a rootdir/tmp/testsuccess.output rootdir/tmp/update.output
canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')"
canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-all/Packages.bz2 | sha512sum |cut -f1 -d' ')"
testfailure grep -- "$canary" rootdir/tmp/update.output

testfoo() {
@@ -49,7 +49,7 @@ find rootdir/var/lib/apt/lists -name '*_Packages*' -delete
testsuccess aptget update -o Debug::pkgAcquire::Auth=1
# file:/ isn't shown in the log, so see if it was downloaded anyhow
cp -a rootdir/tmp/testsuccess.output rootdir/tmp/update.output
canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')"
canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-all/Packages.bz2 | sha512sum |cut -f1 -d' ')"
testsuccess grep -- "$canary" rootdir/tmp/update.output

testfoo

+ 12
- 4
test/integration/test-apt-update-ims View File

@@ -7,6 +7,7 @@ setupenvironment
configarchitecture 'amd64'

insertpackage 'unstable' 'unrelated' 'all' '0.5~squeeze1'
insertpackage 'unstable' 'unrelated2' 'amd64' '0.5~squeeze1'
insertsource 'unstable' 'unrelated' 'all' '0.5~squeeze1'

setupaptarchive --no-update
@@ -146,23 +147,30 @@ Ign:3 http://localhost:${APTHTTPPORT} unstable/main Sources
404 Not Found
Ign:4 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
404 Not Found
Ign:5 http://localhost:${APTHTTPPORT} unstable/main Translation-en
Ign:5 http://localhost:${APTHTTPPORT} unstable/main all Packages
404 Not Found
Ign:6 http://localhost:${APTHTTPPORT} unstable/main Translation-en
404 Not Found
Ign:3 http://localhost:${APTHTTPPORT} unstable/main Sources
404 Not Found
Ign:4 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
404 Not Found
Ign:5 http://localhost:${APTHTTPPORT} unstable/main Translation-en
Ign:5 http://localhost:${APTHTTPPORT} unstable/main all Packages
404 Not Found
Ign:6 http://localhost:${APTHTTPPORT} unstable/main Translation-en
404 Not Found
Ign:3 http://localhost:${APTHTTPPORT} unstable/main Sources
404 Not Found
Ign:4 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
404 Not Found
Ign:5 http://localhost:${APTHTTPPORT} unstable/main Translation-en
Ign:5 http://localhost:${APTHTTPPORT} unstable/main all Packages
404 Not Found
Ign:6 http://localhost:${APTHTTPPORT} unstable/main Translation-en
404 Not Found
Hit:3 http://localhost:${APTHTTPPORT} unstable/main Sources
Hit:4 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
Hit:5 http://localhost:${APTHTTPPORT} unstable/main Translation-en
Hit:5 http://localhost:${APTHTTPPORT} unstable/main all Packages
Hit:6 http://localhost:${APTHTTPPORT} unstable/main Translation-en
Reading package lists...
W: The repository 'http://localhost:${APTHTTPPORT} unstable Release' does not have a Release file.
N: Data from such a repository can not be authenticated and is therefore potentially dangerous to use.


+ 1
- 1
test/integration/test-apt-update-not-modified View File

@@ -7,7 +7,7 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture 'amd64' 'i386'

insertpackage 'unstable' 'apt' 'all' '1.0'
insertpackage 'unstable' 'apt' 'amd64,i386' '1.0'

setupaptarchive --no-update



+ 2
- 2
test/integration/test-apt-update-stale View File

@@ -12,7 +12,7 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture "i386"

insertpackage 'unstable' 'foo' 'all' '1.0'
insertpackage 'unstable' 'foo' 'i386' '1.0'

setupaptarchive --no-update
changetowebserver
@@ -25,7 +25,7 @@ listcurrentlistsdirectory > lists.before
mkdir aptarchive/dists/unstable/main/binary-i386/saved
cp -p aptarchive/dists/unstable/main/binary-i386/Packages* \
aptarchive/dists/unstable/main/binary-i386/saved
insertpackage 'unstable' 'foo' 'all' '2.0'
insertpackage 'unstable' 'foo' 'i386' '2.0'
touch -d '+1 hour' aptarchive/dists/unstable/main/binary-i386/Packages
compressfile aptarchive/dists/unstable/main/binary-i386/Packages
# ensure that we do not get a I-M-S hit for the Release file


+ 4
- 4
test/integration/test-apt-update-transactions View File

@@ -10,8 +10,8 @@ setupenvironment
configarchitecture 'i386'
configcompression '.' 'gz'

insertpackage 'unstable' 'foo' 'all' '1.0'
insertsource 'unstable' 'foo' 'all' '1.0'
insertpackage 'unstable' 'foo' 'i386' '1.0'
insertsource 'unstable' 'foo' 'i386' '1.0'

setupaptarchive --no-update

@@ -31,8 +31,8 @@ restorefile() {
testrun() {
rm -rf aptarchive/dists.good
cp -a aptarchive/dists aptarchive/dists.good
insertpackage 'unstable' 'bar' 'all' '1.0'
insertsource 'unstable' 'bar' 'all' '1.0'
insertpackage 'unstable' 'bar' 'i386' '1.0'
insertsource 'unstable' 'bar' 'i386' '1.0'
buildaptarchivefromfiles '+1 hour'

# produce an unsigned repository


+ 2
- 2
test/integration/test-apt-update-unauth View File

@@ -13,8 +13,8 @@ umask 022
setupenvironment
configarchitecture "i386"

insertpackage 'unstable' 'foo' 'all' '1.0'
insertsource 'unstable' 'foo' 'all' '1.0'
insertpackage 'unstable' 'foo' 'i386' '1.0'
insertsource 'unstable' 'foo' 'any' '1.0'

setupaptarchive --no-update
changetowebserver


+ 5
- 5
test/integration/test-bug-543966-downgrade-below-1000-pin View File

@@ -22,7 +22,7 @@ testsuccessequal "base-files:
*** 5.0.0-1 100
100 $STATUS
5.0.0 500
500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=0
500 file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=0

writepin() {
echo "Package: $1
@@ -47,7 +47,7 @@ testpinning() {
*** 5.0.0-1 100
100 $STATUS
5.0.0 ${PKGPINPRIO:-99}
${REPPINPRIO:- 99} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=99
${REPPINPRIO:- 99} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=99

writepin "$1" '100'
testsuccessequal "base-files:
@@ -57,7 +57,7 @@ testpinning() {
*** 5.0.0-1 100
100 $STATUS
5.0.0 ${PKGPINPRIO:-100}
${REPPINPRIO:- 100} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=100
${REPPINPRIO:- 100} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=100

writepin "$1" '999'
testsuccessequal "base-files:
@@ -67,7 +67,7 @@ testpinning() {
*** 5.0.0-1 100
100 $STATUS
5.0.0 ${PKGPINPRIO:-999}
${REPPINPRIO:- 999} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=999
${REPPINPRIO:- 999} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=999

writepin "$1" '1000'
testsuccessequal "base-files:
@@ -77,7 +77,7 @@ testpinning() {
*** 5.0.0-1 100
100 $STATUS
5.0.0 ${PKGPINPRIO:-1000}
${REPPINPRIO:-1000} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=1000
${REPPINPRIO:-1000} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=1000
}

msgmsg 'Tests with generic-form pin'


+ 0
- 1
test/integration/test-bug-683786-build-dep-on-virtual-packages View File

@@ -12,7 +12,6 @@ insertpackage 'unstable' 'po-debconf' 'all' '1'
insertsource 'unstable' 'dash' 'any' '1' 'Build-Depends: po-debconf'
insertpackage 'unstable' 'make-po-debconf-pure-virtual' 'armel' '1' 'Depends: po-debconf'

insertpackage 'unstable' 'po-debconf' 'amd64' '1'
insertsource 'unstable' 'diffutils' 'any' '1' 'Build-Depends: texi2html'

insertpackage 'unstable' 'libselinux1-dev' 'amd64' '1' 'Provides: libselinux-dev'


+ 8
- 4
test/integration/test-compressed-indexes View File

@@ -31,10 +31,12 @@ testrun() {
local F
msgtest 'Check if all index files are' "${1:-uncompressed}"
if [ "$1" = 'compressed' ]; then
! test -e rootdir/var/lib/apt/lists/*_Packages || F=1
! test -e rootdir/var/lib/apt/lists/*i386_Packages || F=1
! test -e rootdir/var/lib/apt/lists/*all_Packages || F=1
! test -e rootdir/var/lib/apt/lists/*_Sources || F=1
! test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1
test -e rootdir/var/lib/apt/lists/*_Packages.${COMPRESS} || F=1
test -e rootdir/var/lib/apt/lists/*i386_Packages.${COMPRESS} || F=1
test -e rootdir/var/lib/apt/lists/*all_Packages.${COMPRESS} || F=1
test -e rootdir/var/lib/apt/lists/*_Sources.${COMPRESS} || F=1
test -e rootdir/var/lib/apt/lists/*_Translation-en.${COMPRESS} || F=1
# there is no point in trying pdiff if we have compressed indexes
@@ -43,10 +45,12 @@ testrun() {
else
# clear the faked pdiff indexes so the glob below works
rm -f rootdir/var/lib/apt/lists/*diff_Index
test -e rootdir/var/lib/apt/lists/*_Packages || F=1
test -e rootdir/var/lib/apt/lists/*i386_Packages || F=1
test -e rootdir/var/lib/apt/lists/*all_Packages || F=1
test -e rootdir/var/lib/apt/lists/*_Sources || F=1
test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1
! test -e rootdir/var/lib/apt/lists/*_Packages.* || F=1
! test -e rootdir/var/lib/apt/lists/*i386_Packages.* || F=1
! test -e rootdir/var/lib/apt/lists/*all_Packages.* || F=1
! test -e rootdir/var/lib/apt/lists/*_Sources.* || F=1
! test -e rootdir/var/lib/apt/lists/*_Translation-en.* || F=1
fi


+ 2
- 2
test/integration/test-cve-2013-1051-InRelease-parsing View File

@@ -22,7 +22,7 @@ testsuccessequal "good-pkg:
Candidate: 1.0
Version table:
1.0 500
500 ${ARCHIVE} stable/main i386 Packages" aptcache policy good-pkg
500 ${ARCHIVE} stable/main all Packages" aptcache policy good-pkg

# now exchange to the Packages file, note that this could be
# done via MITM too
@@ -63,4 +63,4 @@ testsuccessequal "good-pkg:
Candidate: 1.0
Version table:
1.0 500
500 ${ARCHIVE} stable/main i386 Packages" aptcache policy good-pkg
500 ${ARCHIVE} stable/main all Packages" aptcache policy good-pkg

+ 28
- 2
test/integration/test-external-dependency-solver-protocol View File

@@ -159,12 +159,38 @@ testsuccess aptinternalsolver scenario
testsuccessequal 'Package: stuff
Source: stuff
Architecture: all
Version: 3
Source-Version: 3
APT-ID: 1
Priority: optional
Section: other
Multi-Arch: foreign
APT-Release:
a=experimental,n=experimental,c=main,b=all
APT-Pin: 1

Package: stuff
Source: stuff
Architecture: all
Version: 2
Source-Version: 2
APT-ID: 3
Priority: optional
Section: other
Multi-Arch: foreign
APT-Release:
a=unstable,n=sid,c=main,b=all
APT-Pin: 500
APT-Candidate: yes

Package: stuff
Source: stuff
Architecture: all
Version: 1
Source-Version: 1
Installed: yes
APT-ID: 2
APT-ID: 8
Priority: optional
Section: other
APT-Pin: 100
APT-Candidate: yes
' aptinternalsolver scenario stuff

+ 2
- 1
test/integration/test-handle-redirect-as-used-mirror-change View File

@@ -17,7 +17,8 @@ rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme"
testsuccessequal "Get:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease [$(stat -c %s aptarchive/dists/unstable/InRelease) B]
Get:2 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main amd64 Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-amd64/Packages.gz) B]
Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
Get:5 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
Reading package lists..." aptget update

testsuccessequal "Hit:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease


+ 3
- 3
test/integration/test-policy-pinning View File

@@ -101,11 +101,11 @@ testequalpolicycoolstuff() {
local BPO2ARCHIVE=""
if [ ! "$7" = "2.0~bpo2" ]; then
BPO1PIN="$AB"
BPO1ARCHIVE=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages"
BPO1ARCHIVE=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main all Packages"
else
BPO2ARCHIVE="
2.0~bpo2 $AB
$(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages"
$(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main all Packages"
SB="$(echo "$SB" | tail -n 1)"
shift
fi
@@ -117,7 +117,7 @@ testequalpolicycoolstuff() {
$IB 2.0~bpo1 $PB
${BPO1ARCHIVE}$SB
$IS 1.0 $AS
$(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} stable/main i386 Packages$SS" \
$(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} stable/main all Packages$SS" \
aptcache policy coolstuff -o Policy=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $*
}



+ 1
- 1
test/integration/test-security-no-remote-status View File

@@ -20,7 +20,7 @@ testequal "pretends-installed:
Candidate: 1
Version table:
1 500
500 file:${TMPDIR}/aptarchive unstable/main amd64 Packages" aptcache policy pretends-installed
500 file:${TMPDIR}/aptarchive unstable/main all Packages" aptcache policy pretends-installed

testequal "really-installed:
Installed: 1


+ 29
- 23
test/integration/test-sourceslist-arch-plusminus-options View File

@@ -18,68 +18,74 @@ testbinaries() {
}

echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'default & native' 'amd64'
testbinaries 'default & native' 'amd64' 'all'
configarchitecture 'amd64' 'i386'
testbinaries 'default & native + foreign' 'amd64' 'i386'
testbinaries 'default & native + foreign' 'amd64' 'i386' 'all'
configarchitecture 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'default & native + many foreigns' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'default & native + many foreigns' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=native' 'amd64'
testbinaries 'arch=native' 'amd64' 'all'

echo 'deb [arch=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=foreign' 'mips'
testbinaries 'arch=foreign' 'mips' 'all'

echo 'deb [arch=kfreebsd-armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=unknown' 'kfreebsd-armel'
testbinaries 'arch=unknown' 'kfreebsd-armel' 'all'

echo 'deb [arch=amd64,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=native,foreign' 'amd64' 'i386'
testbinaries 'arch=native,foreign' 'amd64' 'i386' 'all'

echo 'deb [arch=mips,armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=foreign,foreign' 'mips' 'armhf'
testbinaries 'arch=foreign,foreign' 'mips' 'armhf' 'all'

echo 'deb [arch=kfreebsd-armel,hurd-powerpc,mipsel,armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch=unknown,unknown,foreign,foreign' 'kfreebsd-armel' 'hurd-powerpc' 'mipsel' 'armel'
testbinaries 'arch=unknown,unknown,foreign,foreign' 'kfreebsd-armel' 'hurd-powerpc' 'mipsel' 'armel' 'all'

echo 'deb [arch+=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=native' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'arch+=native' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'arch+=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch+=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=foreign,foreign,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'arch+=foreign,foreign,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch+=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc'
testbinaries 'arch+=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' 'all'

echo 'deb [arch+=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch+=foreign,unknown,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc'
testbinaries 'arch+=foreign,unknown,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' 'all'

echo 'deb [arch-=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=native' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'arch-=native' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mipsel'
testbinaries 'arch-=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mipsel' 'all'

echo 'deb [arch-=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=foreign,foreign,foreign' 'amd64' 'armel' 'mipsel'
testbinaries 'arch-=foreign,foreign,foreign' 'amd64' 'armel' 'mipsel' 'all'

echo 'deb [arch-=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
testbinaries 'arch-=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'

echo 'deb [arch-=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'arch-=foreign,unknown,foreign' 'amd64' 'armel' 'armhf' 'mipsel'
testbinaries 'arch-=foreign,unknown,foreign' 'amd64' 'armel' 'armhf' 'mipsel' 'all'

echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'substract from a arch-set' 'i386'
testbinaries 'substract from a arch-set' 'i386' 'all'

echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'useless subtract from a arch-set' 'i386'
testbinaries 'useless subtract from a arch-set' 'i386' 'all'

echo 'deb [arch=mips,i386 arch+=armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'addition to a arch-set' 'i386' 'mips' 'armhf'
testbinaries 'addition to a arch-set' 'i386' 'mips' 'armhf' 'all'

echo 'deb [arch=mips,i386 arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'useless addition to a arch-set' 'i386' 'mips'
testbinaries 'useless addition to a arch-set' 'i386' 'mips' 'all'

echo 'deb [arch=i386 arch-=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'substract all from arch-set' 'i386'

echo 'deb [arch=i386 arch+=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testbinaries 'useless addition of all' 'i386' 'all'

+ 2
- 1
test/integration/test-sourceslist-lang-plusminus-options View File

@@ -44,7 +44,8 @@ testlangs 'lang=de_DE' 'de_DE'

echo 'deb [lang=none] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testlangs 'lang=none' ''
testequal 'amd64' aptget indextargets --no-release-info 'Created-By: Packages' --format '$(ARCHITECTURE)'
testequal 'amd64
all' aptget indextargets --no-release-info 'Created-By: Packages' --format '$(ARCHITECTURE)'

echo 'deb [lang+=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testlangs 'lang+=pt' 'en,de,de_DE,pt'


+ 8
- 6
test/libapt/cdromfindpackages_test.cc View File

@@ -46,7 +46,7 @@ TEST(CDROMTest,FindPackages)
createDirectory(path, "dists/stable/main/binary-i386");
createDirectory(path, "dists/stable/main/source");
createDirectory(path, "dists/stable/contrib/binary-amd64");
createDirectory(path, "dists/stable/contrib/binary-all");
createDirectory(path, "dists/stable/non-free/binary-all");
createDirectory(path, "dists/unstable/main/binary-i386");
createDirectory(path, "dists/unstable/main/i18n");
createDirectory(path, "dists/unstable/main/source");
@@ -57,7 +57,7 @@ TEST(CDROMTest,FindPackages)
createFile(path, "dists/stable/main/source/Sources.xz");
createFile(path, "dists/stable/contrib/binary-amd64/Packages");
createFile(path, "dists/stable/contrib/binary-amd64/Packages.gz");
createFile(path, "dists/stable/contrib/binary-all/Packages");
createFile(path, "dists/stable/non-free/binary-all/Packages");
createFile(path, "dists/unstable/main/binary-i386/Packages.xz");
createFile(path, "dists/unstable/main/binary-i386/Packages.lzma");
createFile(path, "dists/unstable/main/i18n/Translation-en");
@@ -74,11 +74,12 @@ TEST(CDROMTest,FindPackages)
std::vector<std::string> Packages, Sources, Signatur, Translation;
std::string InfoDir;
EXPECT_TRUE(cd.FindPackages(path, Packages, Sources, Signatur, Translation, InfoDir));
EXPECT_EQ(4, Packages.size());
EXPECT_EQ(5, Packages.size());
EXPECT_EQ(path + "/dists/sid/main/binary-i386/", Packages[0]);
EXPECT_EQ(path + "/dists/stable/contrib/binary-amd64/", Packages[1]);
EXPECT_EQ(path + "/dists/stable/main/binary-i386/", Packages[2]);
EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[3]);
EXPECT_EQ(path + "/dists/stable/non-free/binary-all/", Packages[3]);
EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[4]);
EXPECT_EQ(3, Sources.size());
EXPECT_EQ(path + "/dists/sid/main/source/", Sources[0]);
EXPECT_EQ(path + "/dists/stable/main/source/", Sources[1]);
@@ -103,10 +104,11 @@ TEST(CDROMTest,FindPackages)
_error->DumpErrors();
cd.DropRepeats(Translation, "");

EXPECT_EQ(3, Packages.size());
EXPECT_EQ(4, Packages.size());
EXPECT_EQ(path + "/dists/stable/contrib/binary-amd64/", Packages[0]);
EXPECT_EQ(path + "/dists/stable/main/binary-i386/", Packages[1]);
EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[2]);
EXPECT_EQ(path + "/dists/stable/non-free/binary-all/", Packages[2]);
EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[3]);
EXPECT_EQ(2, Sources.size());
EXPECT_EQ(path + "/dists/stable/main/source/", Sources[0]);
EXPECT_EQ(path + "/dists/unstable/main/source/", Sources[1]);


Loading…
Cancel
Save