https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=1ff458d0e5e34bec9336ae51952805c0b994b54d commit 1ff458d0e5e34bec9336ae51952805c0b994b54d Author: Christian Franke Date: Sun Jun 26 18:01:03 2022 +0200 Add perpetual support for preremove scripts Always run all /etc/preremove/0p_* first. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=4f76b0dfa08a711e6c5a28f02e51c88fafb9aa52 commit 4f76b0dfa08a711e6c5a28f02e51c88fafb9aa52 Author: Jon Turney Date: Wed Jun 29 12:54:45 2022 +0100 Consistently use '\n' rather than '\r\n' in resources '\r\n' is unnecessary, and apparently appears as '\r\r\n' in text copied from a messagebox. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=163a51d41de49cf0575f206a92143fbb593c6a21 commit 163a51d41de49cf0575f206a92143fbb593c6a21 Author: Jon Turney Date: Tue Jun 28 20:36:43 2022 +0100 Handle self-destruct packages These are sometimes useful in situations where a package is obsoleted, but doesn't have a simple replacement. The parser can't currently handle "libsolv-self-destruct-pkg()" (the magic provide name which triggers this behaviour in libsolv) appearing as a provide, because (i) brackets aren't a valid character in a package name, and (ii) empty braces isn't permitted for a versioncriteria following a package name. For backwards-compatibility (to allow old versions of setup to parse a setup.ini containing this instruction) and terseness, accept '_self-destruct' as equivalent to that magic package name. Requires libsolv >= 0.7.8 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=69ccd7669712339f4855457d68d5b885152fbfb2 commit 69ccd7669712339f4855457d68d5b885152fbfb2 Author: Jon Turney Date: Mon Jun 27 19:02:38 2022 +0100 Suppress bogus free-nonheap-object warning in iniparse.cc This warning bogusly occurs with -O0 in bison generated code. The free() is not reachable when the pointer references a non-heap object. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98753 iniparse.cc: In function ‘int yyparse()’: iniparse.cc:1789:18: warning: ‘void free(void*)’ called on unallocated object ‘yyssa’ [-Wfree-nonheap-object] iniparse.cc:1148:16: note: declared here Diff: --- IniDBBuilderPackage.cc | 7 ++- Makefile.am | 1 + install.cc | 47 +++++++++++++++++ po/fr/res.po | 136 ++++++++++++++++++++++++------------------------- res.pot | 72 +++++++++++++------------- res/en/res.rc | 50 +++++++++--------- res/fr/res.rc | 52 +++++++++---------- 7 files changed, 209 insertions(+), 156 deletions(-) diff --git a/IniDBBuilderPackage.cc b/IniDBBuilderPackage.cc index 3a8f10f8..6305ac80 100644 --- a/IniDBBuilderPackage.cc +++ b/IniDBBuilderPackage.cc @@ -322,7 +322,12 @@ IniDBBuilderPackage::buildPackageListNode (const std::string & name) #if DEBUG Log (LOG_BABBLE) << "New node '" << name << "' for package list" << endLog; #endif - currentSpec = new PackageSpecification (name); + + std::string actual_name = name; + if (name == "_self-destruct") + actual_name = "libsolv-self-destruct-pkg()"; + + currentSpec = new PackageSpecification (actual_name); if (currentNodeList) currentNodeList->push_back (currentSpec); } diff --git a/Makefile.am b/Makefile.am index 423f4d78..bf8b52ec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,6 +33,7 @@ AM_CPPFLAGS = -D__USE_MINGW_ANSI_STDIO=1 -DLZMA_API_STATIC\ $(ZLIB_CFLAGS) $(LZMA_CFLAGS) $(ZSTD_CFLAGS) $(LIBCRYPT_CFLAGS) $(LIBSOLV_CFLAGS) inilex_CXXFLAGS:=-Wno-sign-compare +iniparse_CXXFLAGS:=-Wno-free-nonheap-object noinst_PROGRAMS = @SETUP@$(EXEEXT) inilint diff --git a/install.cc b/install.cc index e58ef4b3..6689a08d 100644 --- a/install.cc +++ b/install.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include "ini.h" #include "resource.h" @@ -50,6 +51,8 @@ #include "archive.h" #include "archive_tar.h" #include "script.h" +#include "find.h" +#include "FindVisitor.h" #include "package_db.h" #include "package_meta.h" @@ -73,6 +76,28 @@ struct std_dirs_t { mode_t mode; }; +class Perpetual0RemoveFindVisitor : public FindVisitor +{ +public: + explicit Perpetual0RemoveFindVisitor (std::vector