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)
{
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;
// 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;
time_t ValidUntilMin;
time_t ValidUntilMax;
+ std::vector<std::string> Architectures;
+
debReleaseIndexPrivate() : CheckValidUntil(metaIndex::TRI_UNSET), ValidUntilMin(0), ValidUntilMax(0) {}
};
/*}}}*/
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
);
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++)
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)
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, ',');
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,
#include <apt-pkg/indexfile.h>
#include <apt-pkg/metaindex.h>
+#include <apt-pkg/debmetaindex.h>
+
#include <string>
#include <vector>
/*}}}*/
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;
+}
+ /*}}}*/
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
<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>
</varlistentry>
&apt-commonoptions;
-
+
</variablelist>
</refsect1>
// We generate for this given arch
string Arch;
+ bool IncludeArchAll;
// Stuff for the Source File
string SrcFile;
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) {};
};
/*}}}*/
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)
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)
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");
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);
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")
{
// 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;
/*}}}*/
// 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)
{
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;
}
/*}}}*/
/* */
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;
_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
// 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");
protected:
vector<string> Patterns;
string Arch;
+ bool IncludeArchAll;
const char *OriginalPath;
bool ErrorPrinted;
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();
};
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();
};
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() {};
};
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' ' ')";
continue
fi
for arch in $(getarchitecturesfromcommalist "$ARCH"); do
- if [ "$arch" = 'all' -o "$arch" = 'none' ]; then
+ if [ "$arch" = 'none' ]; then
ARCHS="$(getarchitectures)"
else
ARCHS="$arch"
getreleaseversionfromsuite() { true; }
getlabelfromsuite() { true; }
getoriginfromsuite() { true; }
+getarchitecturesfromreleasefile() { echo "all $(getarchitectures)"; }
aptftparchiverelease() {
aptftparchive -qq release "$@" | sed -e '/0 Release$/ d' # remove the self reference
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)"
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} \
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"
}
--- /dev/null
+#!/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-
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
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
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*'
};
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,
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
${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
${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
${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)'
configcompression '.' 'gz'
insertpackage 'unstable' 'foo' 'all' '1.0'
+insertpackage 'unstable' 'bar' 'i386' '1.0'
setupaptarchive --no-update
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() {
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
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
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
# 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
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
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
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
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
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.
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
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'
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
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'
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'
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
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
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
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
}
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
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
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:
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
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
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() {
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
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
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.
setupenvironment
configarchitecture 'amd64' 'i386'
-insertpackage 'unstable' 'apt' 'all' '1.0'
+insertpackage 'unstable' 'apt' 'amd64,i386' '1.0'
setupaptarchive --no-update
setupenvironment
configarchitecture "i386"
-insertpackage 'unstable' 'foo' 'all' '1.0'
+insertpackage 'unstable' 'foo' 'i386' '1.0'
setupaptarchive --no-update
changetowebserver
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
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
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
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.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
*** 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:
*** 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:
*** 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:
*** 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'
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'
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
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
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
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
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
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
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
$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} $*
}
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
}
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'
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'
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");
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");
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]);
_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]);