Re: [Rpm-maint] [rpm-software-management/rpm] RFE: set builsubdir to the *first* extracted archive not the last one (#551)
Even simpler -- only one line of code needs to change -- would be to define _buildsubdir only if it is not already defined. That might even permit overriding _buildsubdir to be set from the spec file, or -- with Yet Another POPT alias -- from the rpmbuild command line. And of course %setup becomes even more complex and counter intuitive because the behavior then starts to be convolved with how a spec file is written, or how rpmbuild is invoked. And %setup then starts to diverge from documented 20yo behavior. (aside) I recommend these solutions merely to shut you up and watch this RFE be closed: I'm tired of your pontifications about rpm's unfriendly user behavior that do not include PR's. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/551#issuecomment-424182018___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] RFE: set builsubdir to the *first* extracted archive not the last one (#551)
FWIW, here is an implementation that would permit first rather than last definition of %_buildsubdir to be used under user control. RPM5 permits read only macros which -- when set -- prevent a macro value from being changed. The syntax prefixes a macro name with a '.' in order to set (actually toggle, but let's not go there) a read only flag. The '.' is not part of the name, is stripped off to set a read only flag. Any attempt to redefine the macro value is ignored (and warned iirc). The entire implementation is a couple dozen lines of code. Adding another configurable macro to define whether _buildsubdir or its read only variant with a '.' prefix is to be used can be configured in rpm in multiple ways. The read only variant will of course be the first, rather than the last, value defined by %setup, entirely satisfying the RFE stated herein. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/551#issuecomment-424180043___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] debugedit fails to update section headers (#423)
The following workaround allows to maintain original section order: ```diff --- a/tools/debugedit.c +++ b/tools/debugedit.c @@ -2342,21 +2342,21 @@ fdopen_dso (int fd, const char *name) } if (elf_getphdrnum (elf, ) != 0) { error (0, 0, "Couldn't get number of phdrs: %s", elf_errmsg (-1)); goto error_out; } /* If there are phdrs we want to maintain the layout of the allocated sections in the file. */ - if (phnum != 0) + //if (phnum != 0) elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT); memset (dso, 0, sizeof(DSO)); dso->elf = elf; dso->phnum = phnum; dso->ehdr = ehdr; dso->scn = (Elf_Scn **) >shdr[ehdr.e_shnum + 20]; for (i = 0; i < ehdr.e_shnum; ++i) { ``` -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/423#issuecomment-424147426___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] RFE: set builsubdir to the *first* extracted archive not the last one (#551)
You are absolutely correct that %setup from time immemorial has been overly complicated, non-intuitive, and *documented*. Expecting users to change their behavior 20y later is a political task, better left to distro packaging committees and package reviews: %setup does what %setup does. Meanwhile you critiquing an implementation 20y later in multiple RFE's because it doesn't fit your obscure usage case isn't helpful either. If %setup is not appropriate for whatever you are attempting, then DO NOT USE %setup It's really that simple. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/551#issuecomment-424135436___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] debugedit fails to update section headers (#423)
I think in my case it happens because `debugedit` was not able to delete any sections (no file size changes) but it reordered sections in the file and did not update section offsets. Attaching original, mangled file and a script:[__t.tar.gz](https://github.com/rpm-software-management/rpm/files/2412961/__t.tar.gz) -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/423#issuecomment-424133239___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] RFE: set builsubdir to the *first* extracted archive not the last one (#551)
I don't doubt that's what the setup authors intended, but really, it's overly clever for human beings, that like their commands simple and easy to remember, it's overly clever for scripts, that like to loop over the same command not compute complex lists of arguments, it's overly clever for whoever is tasked to explain it so anyone else, and besides, it does not handle patching of intermediate sources well. Which is why from time immemorial, starting with the heroic period when maximum rpm was written, the documented and actual `%setup` use was not what the setup authors intended, but one setup call per archive. So could we make the way people actually use `%setup` work better please? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/551#issuecomment-424052712___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] debugedit fails to update section headers (#423)
debugedit also can break gcc's crtstartup: https://bugs.gentoo.org/666954 . I think it's the same issue. Will try to provide more detail today. -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/423#issuecomment-424051949___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] RFE: set builsubdir to the *first* extracted archive not the last one (#551)
You're supposed to use `%setup` once, and tell it how many archives it needs to extract before it it should change into the workdir. For example: `%setup -q -b 3` tells it to unpack `Source0`, `Source1`, `Source2`, and `Source3` before changing into the `%name-%version` workdir. If you want another directory, you need to override with `-n`. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/551#issuecomment-423950341___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] RFE: set builsubdir to the *first* extracted archive not the last one (#551)
I believe that's what the `-n` option of `%setup` is for. You can (or have to) set/repeat the desired `%buildsubdir` on every invocation of `%setup`. (IIRC, multiple `%setup`s are deemed esoteric/byzantine anyway.) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/551#issuecomment-423901592___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint