diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-02-26 12:14:59 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-02-26 16:31:20 +0100 |
commit | 975316780b2ba3d4e60592fac9d4eb99ffc4c924 (patch) | |
tree | 2f56406e2f33eb8747b4bd3e019e8519c424d739 | |
parent | f4cae55a9ffaa80e339ab8a94e8737ba22f702e3 (diff) |
tagfile: Remove deprecated pkgUserTagSection and TFRewrite
-rw-r--r-- | apt-pkg/tagfile.cc | 148 | ||||
-rw-r--r-- | apt-pkg/tagfile.h | 16 | ||||
-rw-r--r-- | debian/libapt-pkg6.0.symbols | 5 |
3 files changed, 2 insertions, 167 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 1e7f2867c..4b6a5e78b 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -473,14 +473,12 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset) // pkgTagSection::pkgTagSection - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -APT_IGNORE_DEPRECATED_PUSH pkgTagSection::pkgTagSection() : Section(0), d(new pkgTagSectionPrivate()), Stop(0) { memset(&AlphaIndexes, 0, sizeof(AlphaIndexes)); memset(&BetaIndexes, 0, sizeof(BetaIndexes)); } -APT_IGNORE_DEPRECATED_POP /*}}}*/ // TagSection::Scan - Scan for the end of the header information /*{{{*/ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const Restart) @@ -538,14 +536,12 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R } else { if (BetaIndexes[lastTagHash] != 0) lastTagData.NextInBucket = BetaIndexes[lastTagHash]; - APT_IGNORE_DEPRECATED_PUSH BetaIndexes[lastTagHash] = TagCount; - APT_IGNORE_DEPRECATED_POP } d->Tags.push_back(lastTagData); } - APT_IGNORE_DEPRECATED(++TagCount;) + ++TagCount; lastTagData = pkgTagSectionPrivate::TagData(Stop - Section); // find the colon separating tag and value char const * Colon = (char const *) memchr(Stop, ':', End - Stop); @@ -590,7 +586,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R } else { if (BetaIndexes[lastTagHash] != 0) lastTagData.NextInBucket = BetaIndexes[lastTagHash]; - APT_IGNORE_DEPRECATED(BetaIndexes[lastTagHash] = TagCount;) + BetaIndexes[lastTagHash] = TagCount; } d->Tags.push_back(lastTagData); } @@ -1065,146 +1061,6 @@ bool pkgTagSection::Write(FileFd &File, char const * const * const Order, std::v } /*}}}*/ -void pkgUserTagSection::TrimRecord(bool /*BeforeRecord*/, const char* &End)/*{{{*/ -{ - for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r' || Stop[0] == '#'); Stop++) - if (Stop[0] == '#') - Stop = (const char*) memchr(Stop,'\n',End-Stop); -} - /*}}}*/ - #include "tagfile-order.c" -// TFRewrite - Rewrite a control record /*{{{*/ -// --------------------------------------------------------------------- -/* This writes the control record to stdout rewriting it as necessary. The - override map item specificies the rewriting rules to follow. This also - takes the time to sort the feild list. */ -APT_IGNORE_DEPRECATED_PUSH -bool TFRewrite(FILE *Output,pkgTagSection const &Tags,const char *Order[], - TFRewriteData *Rewrite) -{ - unsigned char Visited[256]; // Bit 1 is Order, Bit 2 is Rewrite - for (unsigned I = 0; I != 256; I++) - Visited[I] = 0; - - // Set new tag up as necessary. - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if (Rewrite[J].NewTag == 0) - Rewrite[J].NewTag = Rewrite[J].Tag; - } - - // Write all of the tags, in order. - if (Order != NULL) - { - for (unsigned int I = 0; Order[I] != 0; I++) - { - bool Rewritten = false; - - // See if this is a field that needs to be rewritten - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if (strcasecmp(Rewrite[J].Tag,Order[I]) == 0) - { - Visited[J] |= 2; - if (Rewrite[J].Rewrite != 0 && Rewrite[J].Rewrite[0] != 0) - { - if (isspace_ascii(Rewrite[J].Rewrite[0])) - fprintf(Output,"%s:%s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - else - fprintf(Output,"%s: %s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - } - Rewritten = true; - break; - } - } - - // See if it is in the fragment - unsigned Pos; - if (Tags.Find(StringView(Order[I]),Pos) == false) - continue; - Visited[Pos] |= 1; - - if (Rewritten == true) - continue; - - /* Write out this element, taking a moment to rewrite the tag - in case of changes of case. */ - const char *Start; - const char *Stop; - Tags.Get(Start,Stop,Pos); - - if (fputs(Order[I],Output) < 0) - return _error->Errno("fputs","IO Error to output"); - Start += strlen(Order[I]); - if (fwrite(Start,Stop - Start,1,Output) != 1) - return _error->Errno("fwrite","IO Error to output"); - if (Stop[-1] != '\n') - fprintf(Output,"\n"); - } - } - - // Now write all the old tags that were missed. - for (unsigned int I = 0; I != Tags.Count(); I++) - { - if ((Visited[I] & 1) == 1) - continue; - - const char *Start; - const char *Stop; - Tags.Get(Start,Stop,I); - const char *End = Start; - for (; End < Stop && *End != ':'; End++); - - // See if this is a field that needs to be rewritten - bool Rewritten = false; - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if (stringcasecmp(Start,End,Rewrite[J].Tag) == 0) - { - Visited[J] |= 2; - if (Rewrite[J].Rewrite != 0 && Rewrite[J].Rewrite[0] != 0) - { - if (isspace_ascii(Rewrite[J].Rewrite[0])) - fprintf(Output,"%s:%s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - else - fprintf(Output,"%s: %s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - } - - Rewritten = true; - break; - } - } - - if (Rewritten == true) - continue; - - // Write out this element - if (fwrite(Start,Stop - Start,1,Output) != 1) - return _error->Errno("fwrite","IO Error to output"); - if (Stop[-1] != '\n') - fprintf(Output,"\n"); - } - - // Now write all the rewrites that were missed - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if ((Visited[J] & 2) == 2) - continue; - - if (Rewrite[J].Rewrite != 0 && Rewrite[J].Rewrite[0] != 0) - { - if (isspace_ascii(Rewrite[J].Rewrite[0])) - fprintf(Output,"%s:%s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - else - fprintf(Output,"%s: %s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - } - } - - return true; -} -APT_IGNORE_DEPRECATED_POP - /*}}}*/ - pkgTagSection::~pkgTagSection() { delete d; } diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 8b59c43de..de7bfcbaf 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -187,11 +187,6 @@ class pkgTagSection }; -class APT_DEPRECATED_MSG("Use pkgTagFile with the SUPPORT_COMMENTS flag instead") pkgUserTagSection : public pkgTagSection -{ - virtual void TrimRecord(bool BeforeRecord, const char* &End) APT_OVERRIDE; -}; - /** \class pkgTagFile reads and prepares a deb822 formatted file for parsing * via #pkgTagSection. The default mode tries to be as fast as possible and * assumes perfectly valid (machine generated) files like Packages. Support @@ -227,15 +222,4 @@ public: extern const char **TFRewritePackageOrder; extern const char **TFRewriteSourceOrder; -APT_IGNORE_DEPRECATED_PUSH -struct APT_DEPRECATED_MSG("Use pkgTagSection::Tag and pkgTagSection::Write() instead") TFRewriteData -{ - const char *Tag; - const char *Rewrite; - const char *NewTag; -}; -APT_DEPRECATED_MSG("Use pkgTagSection::Tag and pkgTagSection::Write() instead") bool TFRewrite(FILE *Output,pkgTagSection const &Tags,const char *Order[], - TFRewriteData *Rewrite); -APT_IGNORE_DEPRECATED_POP - #endif diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index ad35943a5..a483f317e 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -66,7 +66,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"IsMounted(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@APTPKG_6.0" 0.8.0 (c++)"LookupTag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*, char const*)@APTPKG_6.0" 0.8.0 (c++)"SizeToStr[abi:cxx11](double)@APTPKG_6.0" 0.8.0 - (c++)"TFRewrite(_IO_FILE*, pkgTagSection const&, char const**, TFRewriteData*)@APTPKG_6.0" 0.8.0 (c++)"TimeToStr[abi:cxx11](unsigned long)@APTPKG_6.0" 0.8.0 (c++)"_strstrip(char*)@APTPKG_6.0" 0.8.0 (c++)"flCombine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)@APTPKG_6.0" 0.8.0 @@ -1285,7 +1284,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"pkgTagSection::Tag::Rename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@APTPKG_6.0" 1.1~exp9 (c++)"pkgTagSection::Tag::Rewrite(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@APTPKG_6.0" 1.1~exp9 (c++)"pkgTagSection::Write(FileFd&, char const* const*, std::vector<pkgTagSection::Tag, std::allocator<pkgTagSection::Tag> > const&) const@APTPKG_6.0" 1.1~exp9 - (c++)"pkgUserTagSection::TrimRecord(bool, char const*&)@APTPKG_6.0" 1.1~exp9 (c++)"pkgVersioningSystem::~pkgVersioningSystem()@APTPKG_6.0" 1.1~exp9 (c++)"SigVerify::~SigVerify()@APTPKG_6.0" 1.1~exp9 (c++)"SigVerify::SigVerify()@APTPKG_6.0" 1.1~exp9 @@ -1314,7 +1312,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"typeinfo for pkgProblemResolver@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo for pkgRecords@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo for pkgSourceList@APTPKG_6.0" 1.1~exp9 - (c++)"typeinfo for pkgUserTagSection@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo for SigVerify@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo for TranslationsCopy@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo name for APT::PackageUniverse@APTPKG_6.0" 1.1~exp9 @@ -1338,7 +1335,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"typeinfo name for pkgProblemResolver@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo name for pkgRecords@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo name for pkgSourceList@APTPKG_6.0" 1.1~exp9 - (c++)"typeinfo name for pkgUserTagSection@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo name for SigVerify@APTPKG_6.0" 1.1~exp9 (c++)"typeinfo name for TranslationsCopy@APTPKG_6.0" 1.1~exp9 (c++)"URI::ArchiveOnly(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@APTPKG_6.0" 1.1~exp9 @@ -1363,7 +1359,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"vtable for pkgProblemResolver@APTPKG_6.0" 1.1~exp9 (c++)"vtable for pkgRecords@APTPKG_6.0" 1.1~exp9 (c++)"vtable for pkgSourceList@APTPKG_6.0" 1.1~exp9 - (c++)"vtable for pkgUserTagSection@APTPKG_6.0" 1.1~exp9 (c++)"vtable for SigVerify@APTPKG_6.0" 1.1~exp9 (c++)"vtable for TranslationsCopy@APTPKG_6.0" 1.1~exp9 ### dpkg selection state changer & general dpkg interfacing |