├── COPYING ├── README.rst ├── bump-boto ├── bump-kernels ├── bump-kernels-bin ├── check-mismatched-packages ├── check-revdep ├── copybump ├── file-kernel-stablereq ├── file-pkgcheck ├── file-rekeywordreq ├── file-stablereq ├── find-gh-prs ├── find-pkg-bugs ├── foreach-pkg ├── foreach-pkg-maint ├── git-fixup-mg ├── git-foreach-repo ├── git-make-empty ├── if-multiple-versions ├── llvm-foreach-pkg ├── llvm-foreach-pkg-rev ├── llvm-patchset ├── lr-add-pmask ├── lr-commit-pmask ├── lr-file-bug ├── lr-mail-pmask ├── lr-remove ├── mkpatchset ├── pkg ├── pkgbump ├── pkgcommit ├── pkgdiff-mg ├── pkgmove ├── pypy-patchset ├── python-patchset ├── rdep ├── rdep-fetch-cache ├── stablereq-eshowkw ├── stablereq-find-candidates ├── stablereq-find-pkg-bugs ├── stablereq-make-list └── urlencode /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | mgorny-dev-scripts 3 | ================== 4 | 5 | This is a bunch of handy scripts that I use for ebuild development. 6 | Please note that those scripts are generally very simple and have very 7 | limited precondition checks and error handling. Most of the time, they 8 | terminate on any error (relying on external tools providing error 9 | messages) and behave unpredictably e.g. when run with incorrect 10 | arguments or in wrong directory. 11 | 12 | 13 | Package committing helpers 14 | ========================== 15 | 16 | copybump 17 | -------- 18 | Sed wrapper that updates copyright notices in specified files. 19 | Typical usage:: 20 | 21 | # ('git diff --name-only' gives paths valid for top-level directory) 22 | # update all currently modified files 23 | copybump $(git diff --name-only) 24 | # update files modified by all commits since origin 25 | copybump $(git diff --name-only origin) 26 | 27 | pkgcommit 28 | --------- 29 | Dependencies: git 30 | 31 | Commits changes, prepending package name determined from the current 32 | directory. Accepts same arguments as ``git commit``, handles ``-m`` 33 | argument specially. Typical usage:: 34 | 35 | # (in package directory) 36 | # commit current dir, open EDITOR for commit message 37 | pkgcommit -sS . 38 | # use provided commit message (prepends package) 39 | pkgcommit -sS -m 'Bump to 1.2.3' . 40 | # use version saved by pkgbump 41 | pkgcommit -sS --bump 42 | 43 | git-fixup-mg 44 | ------------ 45 | Dependencies: git 46 | 47 | Commits changes to the specified files (or current directory, if no 48 | argument specified) as a fixup to the latest commit on those files. 49 | Typical usage:: 50 | 51 | # (in package directory) 52 | # initial commit 53 | pkgcommit -sS -m 'Bump to 1.2.3' 54 | # do some fixes 55 | git-fixup-mg 56 | # rebase squashes fixup into parent commit 57 | git rebase -i -S origin 58 | 59 | 60 | Package maintenance helpers 61 | =========================== 62 | 63 | check-revdep 64 | ------------ 65 | Dependecies: pkgcore 66 | 67 | Runs a visibility (dependency) check for all reverse dependencies 68 | of the specified packages (or the current package, if none specified). 69 | This can be used to verify that the cleanup of given package does not 70 | break any revdeps (e.g. using ``<`` deps or old USE flags). Typical 71 | usage:: 72 | 73 | cd foo/bar 74 | git rm bar-1.ebuild 75 | check-revdep 76 | pkgdev manifest 77 | pkgcommit -sS . -m 'Remove old' 78 | 79 | Uses rdep_ command. You may want to call ``rdep-fetch-cache`` if you 80 | plan on using it multiple times. 81 | 82 | pkgdiff-mg 83 | ---------- 84 | Dependencies: portage, pkgcore 85 | 86 | Calls ``ebuild(1)`` to extract archives for two specified ebuilds, 87 | and then diffs the result. Does not handle ebuilds unpacking multiple 88 | directories into workdir or package.env PORTAGE_TMPDIR overrides. 89 | Typical usage:: 90 | 91 | pkgdiff-mg foo-1.0.ebuild foo-1.1.ebuild 92 | 93 | The data is extracted into ``${TMPDIR:-/tmp}/mgorny-dev-scripts/portage`` 94 | to avoid hitting collisions with other Portage builds. 95 | 96 | With the ``--build-system``/``-b`` argument, it will attempt to show a diff of 97 | only the build system files:: 98 | 99 | pkgdiff-mg --build-system foo-1.0.ebuild foo-1.1.ebuild 100 | 101 | pkgbump 102 | ------- 103 | Dependencies: portage, gentoolkit (ekeyword), git, pkgcore 104 | Optional dependencies: gpyutils >= 0.12 (gpy-impl) 105 | 106 | Copies ebuild for a version bump, dropping keywords, updating Manifest 107 | and running pkgdiff-mg_ to compare archives. Typical usage:: 108 | 109 | pkgbump foo-1.0.ebuild foo-1.1.ebuild 110 | 111 | pkgmove 112 | ------- 113 | Dependencies: git 114 | Optional dependencies: gpyutils >= 0.12 (gpy-impl) 115 | 116 | Performs a package move. Moves the package directory if the old name 117 | still exists. Updates all entries in ebuilds, eclasses and profiles. 118 | Adds a profiles/updates entry. 119 | 120 | WARNING: edits are done using greedy sed. Double-check the results. 121 | 122 | Example use:: 123 | 124 | pkgmove dev-util/cmake-fedora dev-build/cmake-fedora 125 | pkgmove dev-util/cmake dev-build/cmake 126 | 127 | mkpatchset 128 | ---------- 129 | Dependencies: git, scp 130 | 131 | Create a patchset from fork-style repository, and upload it 132 | to dev.gentoo.org. Typical usage:: 133 | 134 | # tag archive-name upstream dgo-subdir 135 | mkpatchset gentoo-3.9.8 python-gentoo-patches-3.9.8 v3.9.8 python/ 136 | 137 | check-mismatched-packages 138 | ------------------------- 139 | Dependencies: git, pkgcore 140 | 141 | Check whether packages that should be bumped in sync are up-to-date. 142 | Useful for a pre-push hook. 143 | 144 | 145 | Package tree iteration helpers 146 | ============================== 147 | 148 | foreach-pkg 149 | ----------- 150 | Takes package cat/pns as arguments, and runs bash in each directory 151 | specified. Typical usage:: 152 | 153 | # (inside repo) 154 | foreach-pkg app-foo/bar app-foo/frobnicate 155 | # (runs bash in app-foo/bar) 156 | ... 157 | # (runs bash in app-foo/frobnicate) 158 | ... 159 | 160 | foreach-pkg-maint 161 | ----------------- 162 | Takes maintainer e-mail as first argument, and optionally command 163 | as the remaining arguments. Finds all packages with maintainer present 164 | in ``metadata.xml`` (cheap grep), and runs the specified command 165 | in their directories. If no command is specified, just runs bash 166 | for further interaction. Typical usage:: 167 | 168 | # (inside repo) 169 | # runs bash in all packages maintained by foo@gentoo.org 170 | foreach-pkg-maint foo@gentoo.org 171 | # runs eshowkw in all xfce@ packages that have more than one version 172 | foreach-pkg-maint xfce@gentoo.org if-multiple-versions eshowkw -C |& less 173 | 174 | llvm-foreach-pkg & llvm-foreach-pkg-rev 175 | --------------------------------------- 176 | Runs the specified command in directories of all LLVM packages. 177 | The non-suffixed variant iterates over them in dependency first order 178 | (e.g. suitable for bumps), while -rev uses the reverse order 179 | (e.g. suitable for cleanups). Note that the command is not undergoing 180 | bash expansions. 181 | 182 | Typical usage:: 183 | 184 | llvm-foreach-pkg sh -c 'x=( *14.0.0.9999* ); cp ${x} ${x/.9999}' 185 | git add -A 186 | pkgdev manifest 187 | llvm-foreach-pkg pkgcommit -sS . -m "Bump to 14.0.0" 188 | 189 | llvm-foreach-pkg sh -c 'git rm *14.0.0_rc4*' 190 | pkgdev manifest 191 | llvm-foreach-pkg-rev pkgcommit -sS . -m "Remove 14.0.0_rc4" 192 | 193 | if-multiple-versions 194 | -------------------- 195 | Wrapper that runs the specified command if the current directory 196 | contains more than one ebuild file. Live ebuilds (``*-9999.ebuild``) 197 | are ignored. See example above. 198 | 199 | rdep 200 | ---- 201 | Dependencies: wget, optionally tar, xz and lz4 202 | 203 | Accepts one or more cat/pns and prints their reverse dependencies. 204 | The data is fetched from qa-reports.g.o. Typical usage:: 205 | 206 | rdep app-foo/bar app-foo/frobnicate 207 | 208 | If you plan to use it on a larger number of packages, you can prefetch 209 | all data and have it put into ``${TMPDIR:-/tmp}/mgorny-dev-scripts``:: 210 | 211 | rdep-fetch-cache 212 | 213 | If lz4 is installed, the cache will be saved as a ``.tar.lz4`` archive 214 | for space- and performance-efficient lookup; otherwise it will be saved 215 | as uncompressed ``.tar``. If ``bsdtar`` is installed, it will be used 216 | instead of ``tar`` as it supports fast reads. 217 | 218 | 219 | Bugzilla helpers 220 | ================ 221 | 222 | file-pkgcheck 223 | ------------- 224 | Dependencies: pkgcheck, xdg-utils or exo (from xfce), perl 225 | 226 | Run pkgcheck on specified packages, and open bug templates for each 227 | result set. Typical usage:: 228 | 229 | file-pkgcheck app-foo/bar 230 | 231 | file-rekeywordreq 232 | ----------------- 233 | Dependencies: xdg-utils, perl 234 | 235 | Runs a web browser with pre-filled Bugzilla template for requesting 236 | rekeywording of the package specified as the first argument. Typical 237 | usage:: 238 | 239 | file-rekeywordreq app-foo/bar 240 | 241 | file-stablereq 242 | -------------- 243 | Dependencies: xdg-utils, perl 244 | 245 | Runs a web browser with pre-filled Bugzilla template for requesting 246 | stabilization of package specified as the first argument. Typical 247 | usage:: 248 | 249 | file-stablereq app-foo/bar-1.2.3 250 | 251 | file-kernel-stablereq 252 | --------------------- 253 | Dependencies: xdg-utils, perl 254 | 255 | Runs a web browser with pre-filled Bugzilla template for requesting 256 | stabilization of dist-kernel versions specified as arguments. Typical 257 | usage:: 258 | 259 | file-kernel-stablereq 5.10.96 5.4.176 260 | 261 | find-pkg-bugs 262 | ------------- 263 | Dependencies: xdg-utils, perl 264 | 265 | Runs a web browser with Bugzilla search for bugs referring to any 266 | of the packages listed on command-line. Typical usage:: 267 | 268 | find-pkg-bugs app-bar/foo app-foo/bar 269 | 270 | 271 | GitHub helpers 272 | ============== 273 | 274 | find-gh-prs 275 | ----------- 276 | Dependencies: xdg-utils, perl 277 | 278 | Runs a web browser with GitHub pull request search for bugs referring 279 | to any of the packages listed on command-line. Typical usage:: 280 | 281 | find-gh-prs app-bar/foo app-foo/bar 282 | 283 | 284 | Lastriting helpers 285 | ================== 286 | 287 | lr-file-bug 288 | ----------- 289 | Dependencies: xdg-utils, perl 290 | 291 | Opens a web browser with pre-filled bug template for removing a package 292 | specified as the first argument, after 30 days. Typical usage:: 293 | 294 | lr-file-bug $(pkg) 295 | 296 | lr-add-pmask 297 | ------------ 298 | Dependencies: git 299 | 300 | Add a package.mask template entry for removal of package specified 301 | as the first argument, optionally mentioning bug specified as the second 302 | argument. Typical usage:: 303 | 304 | # without bug no 305 | lr-add-pmask app-foo/bar 306 | # with bug no 307 | lr-add-pmask app-foo/frobnicate 123456 308 | # edit package.mask afterwards 309 | vim profiles/package.mask 310 | 311 | lr-commit-pmask 312 | --------------- 313 | Dependencies: git 314 | 315 | Attempts to determine package and bug list from package.mask entry 316 | in ``git diff``, and commits it. Typical usage:: 317 | 318 | # add your package.mask entry 319 | vim profiles/package.mask 320 | # commit it 321 | lr-commit-pmask 322 | 323 | lr-mail-pmask 324 | ------------- 325 | Dependencies: git, xdg-utils, perl 326 | 327 | Attempts to determine package and bug list from package.mask entry 328 | in ``git diff``, and spawns e-mail client in order to send last rites 329 | mail. Typical usage:: 330 | 331 | # add your package.mask entry 332 | vim profiles/package.mask 333 | # prepare mail 334 | lr-mail-pmask 335 | 336 | lr-remove 337 | --------- 338 | Dependencies: git, portage, xdg-utils or exo (from xfce), perl 339 | 340 | Takes a package name as the first argument, and bug numbers as remaining 341 | arguments. Removes the specified package and commits it as lastrited 342 | package removal. Opens a web browser on all specified bugs + search 343 | for package name. Greps profiles for stale package references. This 344 | presumes you remove package.mask entry prior to running it. Typical 345 | usage:: 346 | 347 | # find package to remove, remove its entry 348 | vim profiles/package.mask 349 | # remove the package 350 | lr-remove app-foo/bar 123456 351 | # (review the bugs, verify output for stale profile entries) 352 | # if additional profile entries were removed 353 | git commit -a --amend -S 354 | # if package should not be removed after all 355 | git reset --hard HEAD^ 356 | 357 | 358 | Stabilization helpers 359 | ===================== 360 | 361 | stablereq-eshowkw 362 | ----------------- 363 | Dependencies: pkgcheck, gentoolkit, pager 364 | 365 | Find stabilization candidates and pipe them into eshowkw. The script 366 | accepts pkgcheck arguments. Typical usage:: 367 | 368 | stablereq-eshowkw 'dev-python/*' 369 | 370 | 371 | stablereq-find-candidates 372 | ------------------------- 373 | Dependencies: pkgcheck 374 | 375 | Find stabilization candidates for a given maintainer. Typical usage:: 376 | 377 | stablereq-find-candidates x11@gentoo.org 378 | 379 | 380 | stablereq-find-pkg-bugs 381 | ----------------------- 382 | Dependencies: pkgcheck, xdg-utils, perl 383 | 384 | Find stabilization candidates and open a Bugzilla search in the web 385 | browser for the relevant packages. The script accepts pkgcheck 386 | arguments. Typical usage:: 387 | 388 | stablereq-find-pkg-bugs 'dev-python/*' 389 | 390 | 391 | stablereq-make-list 392 | --------------------- 393 | Dependencies: pkgcheck, editor 394 | 395 | Find stabilization candidates and pipe a list of file-stablereq calls 396 | into an editor for editing and then running. The script accepts 397 | pkgcheck arguments. Typical usage:: 398 | 399 | stablereq-make-list 'dev-python/*' 400 | 401 | 402 | Generic git repository helpers 403 | ============================== 404 | 405 | git-foreach-repo 406 | ---------------- 407 | Runs the specified command in all git repositories found in current 408 | directory and below. Typical usage:: 409 | 410 | git-foreach-repo git gc --prune --aggressive 411 | 412 | git-make-empty 413 | -------------- 414 | Dependencies: git 415 | 416 | Creates an ``empty`` branch in the git repository that is detached from 417 | history and contains no files, and checks it out. The main idea is to 418 | save space by cleanly emptying unused repositories while preserving 419 | ``.git`` directory. Typical usage:: 420 | 421 | git-make-empty 422 | 423 | 424 | Package bumping helpers 425 | ======================= 426 | Common dependencies: same as pkgbump + pkgcommit 427 | 428 | bump-boto 429 | --------- 430 | Bump ``dev-python/botocore``, ``dev-python/boto3`` and ``app-admin/awscli`` 431 | in lockstep. Takes the increment for the last version component. Typical 432 | usage:: 433 | 434 | bump-boto +1 435 | 436 | bump-kernels 437 | ------------ 438 | Bump dist-kernel packages. Takes one or more pairs of 439 | and . Typical usage:: 440 | 441 | bump-kernels 5.16.14 5.16.15 5.15.28 5.15.29 5.10.105 5.10.106 442 | 443 | After the bumps, writes a diff from git origin into 444 | ``${BINPKG_DOCKER}/local.diff``. ``BINPKG_DOCKER`` defaults to 445 | ``~/git/binpkg-docker`` and should be a checkout of binpkg-docker_ repo. 446 | It should be used to build binary kernel packages, and then 447 | bump-kernels-bin_ should be called. 448 | 449 | Read `Distribution_Kernel/Bumping_kernels`_ on the wiki for more details. 450 | 451 | .. _binpkg-docker: https://github.com/mgorny/binpkg-docker/ 452 | .. _Distribution_Kernel/Bumping_kernels: https://wiki.gentoo.org/wiki/Project:Distribution_Kernel/Bumping_kernels 453 | 454 | bump-kernels-bin 455 | ---------------- 456 | Bump binary dist-kernel packages. Takes one or more pairs 457 | of and . Typical usage:: 458 | 459 | bump-kernels-bin 5.16.14 5.16.15 5.15.28 5.15.29 5.10.105 5.10.106 460 | 461 | The package expects binary kernel .xpaks to be present in ``${BINPKG}`` 462 | subdirectories corresponding to architectures. ``BINPKG`` defaults 463 | to ``~/binpkg``. The kernels are copied into ``DISTDIR``. 464 | 465 | 466 | Patchset generation helpers 467 | =========================== 468 | Common dependencies: same as mkpatchset_ 469 | 470 | python-patchset 471 | --------------- 472 | Makes the ``dev-lang/python`` patchset. Typical usage:: 473 | 474 | python-patchset 3.10.2 475 | 476 | Run it in `fork/cpython`_ checkout. Remember to push the tags 477 | afterwards. 478 | 479 | .. _fork/cpython: https://gitweb.gentoo.org/fork/cpython.git/ 480 | 481 | pypy-patchset 482 | --------------- 483 | Makes the ``dev-python/pypy3`` patchset. Typical usage:: 484 | 485 | # branch version 486 | pypy-patchset 3.9 7.3.9 487 | 488 | Run it in `fork/pypy`_ checkout. Note that the upstream for this 489 | is the unofficial git mirror `mozillazg/pypy`_. Remember to push 490 | the tags afterwards. 491 | 492 | .. _fork/pypy: https://gitweb.gentoo.org/fork/pypy.git/ 493 | .. _mozillazg/pypy: https://github.com/mozillazg/pypy/ 494 | 495 | llvm-patchset 496 | ------------- 497 | Makes the ``sys-devel/llvm`` & co. patchset. Typical usage:: 498 | 499 | llvm-patchset 14.0.0 500 | 501 | Run it in `fork/llvm-project`_ checkout. Remember to push the tags 502 | afterwards. Read `LLVM/Releases`_ on the wiki for more details. 503 | 504 | .. _fork/llvm-project: https://gitweb.gentoo.org/fork/llvm-project.git/ 505 | .. _LLVM/Releases: https://wiki.gentoo.org/wiki/Project:LLVM/Releases 506 | -------------------------------------------------------------------------------- /bump-boto: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bump botocore, boto3 and awscli 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | cd "$(git rev-parse --show-toplevel)" 10 | 11 | INCREMENT=${1#+} 12 | if ! [[ ${INCREMENT} ]]; then 13 | echo "Usage: ${0} " >&2 14 | exit 1 15 | fi 16 | 17 | bump_pkg() { 18 | local pkg=${1} 19 | 20 | ( 21 | cd "${pkg}" 22 | 23 | local ebuilds 24 | mapfile -t ebuilds < <(printf '%s\n' *.ebuild | sort -V) 25 | local newest=${ebuilds[-1]} 26 | if [[ ${newest} == *9999* ]]; then 27 | newest=${ebuilds[-2]} 28 | fi 29 | newest=${newest%.ebuild} 30 | local oldv=${newest##*.} 31 | local newv=$(( oldv + INCREMENT )) 32 | newest=${newest%.*} 33 | 34 | "${scriptdir}"/pkgbump "${newest}.${oldv}.ebuild" "${newest}.${newv}.ebuild" 35 | ${EDITOR:-vim} "${newest}.${newv}.ebuild" 36 | "${scriptdir}"/pkgcommit . -sS --bump 37 | ) 38 | } 39 | 40 | bump_pkg dev-python/botocore 41 | bump_pkg dev-python/boto3 42 | bump_pkg app-admin/awscli 43 | -------------------------------------------------------------------------------- /bump-kernels: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bump dist-kernels 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -x -e 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | cd "$(git rev-parse --show-toplevel)" 10 | 11 | while [[ ${#} -gt 0 ]]; do 12 | old=${1} 13 | new=${2} 14 | [[ ${old} && ${new} ]] 15 | 16 | for pkg in {vanilla,gentoo}-kernel; do 17 | ( 18 | cd sys-kernel/${pkg} 19 | match=( *${pkg}-${old}*.ebuild ) 20 | newk=${pkg}-${new}.ebuild 21 | cp "${match[-1]}" "${newk}" 22 | ekeyword ~all "${newk}" 23 | "${scriptdir}"/copybump "${newk}" 24 | ${EDITOR:-vim} "${newk}" 25 | GENTOO_MIRRORS= ebuild "${newk}" manifest 26 | 27 | # do verify-sig 28 | if [[ ${pkg} == vanilla-kernel ]]; then 29 | USE=verify-sig ebuild "${newk}" unpack 30 | ebuild "${newk}" clean 31 | fi 32 | 33 | git add Manifest "${newk}" 34 | "${scriptdir}"/pkgcommit -sS . -m "Bump to ${new}" 35 | ) 36 | done 37 | 38 | ( 39 | cd virtual/dist-kernel 40 | cp dist-kernel-{${old},${new}}.ebuild 41 | ekeyword ~all dist-kernel-${new}.ebuild 42 | "${scriptdir}"/copybump dist-kernel-${new}.ebuild 43 | git add dist-kernel-${new}.ebuild 44 | "${scriptdir}"/pkgcommit -sS . -m "Bump to ${new}" 45 | ) 46 | 47 | shift 2 48 | done 49 | 50 | git diff origin > ${BINPKG_DOCKER:-~/git/binpkg-docker}/local.diff 51 | -------------------------------------------------------------------------------- /bump-kernels-bin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bump dist-kernels -bin variants 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -x -e 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | distdir=$(portageq distdir) 10 | cd "$(git rev-parse --show-toplevel)" 11 | 12 | while [[ ${#} -gt 0 ]]; do 13 | old=${1} 14 | new=${2} 15 | [[ ${old} && ${new} ]] 16 | 17 | for pkg in gentoo-kernel-bin; do 18 | for arch in amd64 arm64 ppc64le x86; do 19 | match=( 20 | ${BINPKG:-~/binpkg}/${arch}/kernel/sys-kernel/${pkg%-bin}/${pkg%-bin}-${new}*.gpkg.tar 21 | ) 22 | [[ ${#match[@]} -eq 1 ]] 23 | 24 | fn=${match##*/} 25 | cp "${match}" "${distdir}/${fn/.gpkg.tar/.${arch}.gpkg.tar}" 26 | done 27 | 28 | ( 29 | cd sys-kernel/${pkg} 30 | match=( *${pkg}-${old}.ebuild ) 31 | newk=${pkg}-${new}.ebuild 32 | cp "${match[-1]}" "${newk}" 33 | ekeyword ~all "${newk}" 34 | "${scriptdir}"/copybump "${newk}" 35 | ${EDITOR:-vim} "${newk}" 36 | GENTOO_MIRRORS= ebuild "${newk}" manifest 37 | 38 | git add Manifest "${newk}" 39 | "${scriptdir}"/pkgcommit -sS . -m "Bump to ${new}" 40 | ) 41 | done 42 | 43 | shift 2 44 | done 45 | -------------------------------------------------------------------------------- /check-mismatched-packages: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # check whether packages that should be kept in sync are up-to-date 3 | # (c) 2023-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | REPO=$(git rev-parse --show-toplevel) 7 | PKGS=( 8 | dev-python/ensurepip-pip:0=dev-python/pip:0 9 | dev-python/ensurepip-setuptools:0=dev-python/setuptools:0 10 | dev-python/ensurepip-wheel:0=dev-python/wheel:0 11 | app-doc/python-docs:2.7=dev-lang/python:2.7 12 | app-doc/python-docs:3.8=dev-lang/python:3.8 13 | app-doc/python-docs:3.9=dev-lang/python:3.9 14 | app-doc/python-docs:3.10=dev-lang/python:3.10 15 | app-doc/python-docs:3.11=dev-lang/python:3.11 16 | app-doc/python-docs:3.12=dev-lang/python:3.12 17 | app-doc/python-docs:3.13=dev-lang/python:3.13 18 | dev-python/python-tests:3.11=dev-lang/python:3.11 19 | dev-python/python-tests:3.12=dev-lang/python:3.12 20 | dev-python/python-tests:3.13=dev-lang/python:3.13 21 | dev-python/python-tests:3.13t=dev-lang/python:3.13t 22 | dev-python/python-tests:3.14=dev-lang/python:3.14 23 | dev-python/python-tests:3.14t=dev-lang/python:3.14t 24 | dev-python/uv=dev-python/uv-build 25 | ) 26 | 27 | declare -A VERSIONS 28 | while read -r PKG; do 29 | SLOT=${PKG#*:} 30 | PKG=${PKG%:*} 31 | PKG=${PKG%-r[0-9]*} 32 | NAME=${PKG%-*} 33 | VERSION=${PKG##*-} 34 | VERSION=${VERSION%_p*} 35 | # ignore live ebuilds, we want to check newest release 36 | [[ ${VERSION} == *9999* ]] && continue 37 | VERSIONS[${NAME}:${SLOT}]=${VERSION} 38 | done < <( 39 | pquery --raw --quiet --repo "${REPO}" --slot "${PKGS[@]%=*}" "${PKGS[@]#*=}" 40 | ) 41 | 42 | RET=0 43 | for PKG in "${PKGS[@]}"; do 44 | A=${PKG%=*} 45 | B=${PKG#*=} 46 | AV="${VERSIONS[${A}]}" 47 | BV="${VERSIONS[${B}]}" 48 | 49 | if [[ ${AV} != ${BV} ]]; then 50 | echo "Package version mismatch found!" >&2 51 | echo " ${A}: ${AV}" >&2 52 | echo " ${B}: ${BV}" >&2 53 | RET=1 54 | fi 55 | done 56 | 57 | exit "${RET}" 58 | -------------------------------------------------------------------------------- /check-revdep: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # check packages' revdeps (defaults to current pkg) 3 | # (c) 2020-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | if [ ${#} -eq 0 ]; then 7 | set -- $(pkg) 8 | fi 9 | 10 | rdep "${@}" | grep -v '^\[B' | 11 | xargs patom -F '%{category}/%{package}' 2>/dev/null | 12 | sort -u | 13 | xargs pkgcheck scan -c SourcingCheck,VisibilityCheck --exit error 14 | -------------------------------------------------------------------------------- /copybump: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # update copyright headers in specified files 3 | # typical usage: copybump $(git diff --name-only origin) 4 | # (c) 2019-2024 Michał Górny 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | exec sed -i -r -e "1s:(Copyright.* [0-9]{4})(-[0-9]{4})?:\1-$(date +%Y):" \ 8 | -e "1s:(Copyright.* $(date +%Y))-$(date +%Y):\1:" \ 9 | -e "1s:Gentoo Foundation:Gentoo Authors:" "${@}" 10 | -------------------------------------------------------------------------------- /file-kernel-stablereq: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # open a browser to file stablereq for kernel versions ${@} 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | - 6 | set -e 7 | scriptdir=${BASH_SOURCE%/*} 8 | 9 | for ver; do 10 | pkgs="virtual/dist-kernel-${ver} * 11 | sys-kernel/gentoo-kernel-${ver} * 12 | sys-kernel/gentoo-kernel-bin-${ver} *" 13 | 14 | nl=$'\n' 15 | xdg-open "https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%20Linux&component=Stabilization&bug_severity=enhancement&short_desc=$("${scriptdir}"/urlencode <<<"${pkgs%% *}: stablereq")&cf_stabilisation_atoms=$("${scriptdir}"/urlencode <<<"${pkgs}")&keywords=CC-ARCHES&comment=Please+stabilize." 16 | done 17 | -------------------------------------------------------------------------------- /file-pkgcheck: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run pkgcheck on one or more packages, and open bug templates for each 3 | # triggering pkgcheck report 4 | # (c) 2019-2024 Michał Górny 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | scriptdir=${BASH_SOURCE%/*} 8 | urls=() 9 | 10 | for pkg; do 11 | res=$(pkgcheck scan ${PKGCHECK_ARGS} "${@}" 2>&1 | tee /dev/fd/2) 12 | [[ -z ${res} ]] && continue 13 | enc=$("${scriptdir}"/urlencode <<<"${res}") 14 | pkgenc=$("${scriptdir}"/urlencode <<<"${pkg}") 15 | ciurl="https://qa-reports.gentoo.org/output/gentoo-ci/output.html%23${pkgenc}" 16 | urls+=( 17 | "https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%20Linux&component=Current+packages&bug_file_loc=${ciurl}&short_desc=${pkgenc}:+QA+issues&comment=${enc::2048}" 18 | ) 19 | done 20 | 21 | if type -P exo-open &>/dev/null; then 22 | exo-open "${urls[@]}" 23 | else 24 | for url in "${urls[@]}"; do 25 | xdg-open "${url}" 26 | done 27 | fi 28 | -------------------------------------------------------------------------------- /file-rekeywordreq: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # open a browser to file rekeywordreq for package(s) ${*} 3 | # (c) 2020-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | pkgs=${*} 10 | nl=$'\n' 11 | exec xdg-open "https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%20Linux&component=Keywording&bug_severity=enhancement&short_desc=$("${scriptdir}"/urlencode <<<"${pkgs// /, }: rekeyword")&cf_stabilisation_atoms=$("${scriptdir}"/urlencode <<<"${pkgs// /${nl}}")&keywords=CC-ARCHES&comment=Please+restore+keywords." 12 | -------------------------------------------------------------------------------- /file-stablereq: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # open a browser to file stablereq for package(s) ${*} 3 | # (c) 2020-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | pkgs=${*} 10 | nl=$'\n' 11 | exec xdg-open "https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%20Linux&component=Stabilization&bug_severity=enhancement&short_desc=$("${scriptdir}"/urlencode <<<"${pkgs// /, }: stablereq")&cf_stabilisation_atoms=$("${scriptdir}"/urlencode <<<"${pkgs// /${nl}}")&keywords=CC-ARCHES&comment=Please+stabilize." 12 | -------------------------------------------------------------------------------- /find-gh-prs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # open a browser searching Gentoo GitHub repo for pull requests 3 | # (c) 2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | scriptdir=${BASH_SOURCE%/*} 7 | search= 8 | while [[ ${#} -gt 0 ]]; do 9 | search+=${1} 10 | [[ -n ${2} ]] && search+=' OR ' 11 | shift 12 | done 13 | 14 | set -e 15 | 16 | exec xdg-open "https://github.com/gentoo/gentoo/pulls?q=is:pr+is:open+$("${scriptdir}"/urlencode <<<"${search}")" 17 | -------------------------------------------------------------------------------- /find-pkg-bugs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # open a browser searching Gentoo Bugzilla for named packages 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | scriptdir=${BASH_SOURCE%/*} 7 | search= 8 | while [[ ${#} -gt 0 ]]; do 9 | search+=${1} 10 | [[ -n ${2} ]] && search+=' OR ' 11 | shift 12 | done 13 | 14 | set -e 15 | 16 | exec xdg-open "https://bugs.gentoo.org/buglist.cgi?quicksearch=$("${scriptdir}"/urlencode <<<"${search}")" 17 | -------------------------------------------------------------------------------- /foreach-pkg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run bash inside each package directory specified 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | cd "$(git rev-parse --show-toplevel)" 9 | for pkg; do 10 | ( 11 | export pkg 12 | cd "${pkg}" 13 | bash || : 14 | ) 15 | done 16 | -------------------------------------------------------------------------------- /foreach-pkg-maint: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run specified command $2+ for each package maintained by $1 3 | # (usually combined with if-multiple-versions) 4 | # (c) 2019-2024 Michał Górny 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | set -e 8 | 9 | maint=${1} 10 | shift 11 | 12 | cd "$(git rev-parse --show-toplevel)" 13 | exec 77< <(git grep -l "${maint}" '*/*/metadata.xml' | cut -d/ -f1-2) 14 | 15 | while read -r -u 77 pkg; do 16 | ( 17 | export pkg 18 | cd "${pkg}" 19 | if [[ -z "${@}" ]]; then 20 | bash || : 21 | else 22 | "${@}" || : 23 | fi 24 | ) 25 | done 26 | -------------------------------------------------------------------------------- /git-fixup-mg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # commit a fixup! to the last change in specified file/directory 3 | # (current directory by default) 4 | # (c) 2019-2024 Michał Górny 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | exec git commit --fixup $(git log --format='%H' -1 "${@:-.}") "${@:-.}" 8 | -------------------------------------------------------------------------------- /git-foreach-repo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run specified command for each git repository found in current dir 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | while read -u 4 -d '' -r f; do 7 | echo "[${f%.git}]" >&2 8 | ( 9 | cd "${f%.git}" && "${@}" 10 | ) 11 | done 4< <(find -name .git -print0) 12 | -------------------------------------------------------------------------------- /git-make-empty: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # create and check an empty branch out in git repo 3 | # (clean way of doing 'rm -Rf *') 4 | # (c) 2019-2024 Michał Górny 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | set -e -x 8 | 9 | git checkout --orphan empty 10 | git reset --hard 11 | exec git commit --allow-empty -m empty 12 | -------------------------------------------------------------------------------- /if-multiple-versions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run specified command if there are more than one ebuild versions 3 | # in current dir 4 | # (c) 2019-2024 Michał Górny 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | no=0 8 | 9 | shopt -s nullglob 10 | for f in *.ebuild; do 11 | if [[ ${f} != *-9999.ebuild ]]; then 12 | (( no++ )) 13 | fi 14 | done 15 | 16 | if [[ ${no} -gt 1 ]]; then 17 | "${@}" 18 | fi 19 | -------------------------------------------------------------------------------- /llvm-foreach-pkg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run specified command for all LLVM packages, in bump order 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | cd "$(git rev-parse --show-toplevel)" || exit 1 7 | 8 | readarray -t packages < metadata/stabilization-groups/llvm.group 9 | 10 | for pkg in "${packages[@]}"; do 11 | [[ ${pkg} == '#'* ]] && continue 12 | ( 13 | cd "${pkg}" && 14 | "${@}" 15 | ) 16 | done 17 | -------------------------------------------------------------------------------- /llvm-foreach-pkg-rev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run specified command for all LLVM packages, in reverse bump order 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | cd "$(git rev-parse --show-toplevel)" || exit 1 7 | 8 | readarray -t packages < <(tac metadata/stabilization-groups/llvm.group) 9 | 10 | for pkg in "${packages[@]}"; do 11 | [[ ${pkg} == '#'* ]] && continue 12 | ( 13 | cd "${pkg}" && 14 | "${@}" 15 | ) 16 | done 17 | -------------------------------------------------------------------------------- /llvm-patchset: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # generate LLVM patchset 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e -x 7 | scriptdir=${BASH_SOURCE%/*} 8 | ver=${1} 9 | [[ -n ${ver} ]] 10 | upst=${2:-llvmorg-${ver%-r[0-9]*}} 11 | exec "${scriptdir}"/mkpatchset gentoo-"${ver}" llvm-gentoo-patchset-"${ver}" \ 12 | "${upst}" llvm/ 13 | -------------------------------------------------------------------------------- /lr-add-pmask: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # add a template package.mask entry for pkg ${1} with bug ${2} 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | pkg=${1} 7 | bug=${2} 8 | 9 | if [ -z "${pkg}" ]; then 10 | echo "Usage: ${0} []" >&2 11 | exit 1 12 | fi 13 | 14 | set -e 15 | 16 | cd "$(git rev-parse --show-toplevel)" 17 | 18 | user=${ECHANGELOG_USER:-$(git config --get user.name) <$(git config --get user.email)>} 19 | 20 | exec sed -i -e "/#--- END OF EXAMPLES ---/a\ 21 | \\\n\ 22 | # ${user} ($(date '+%Y-%m-%d'))\n\ 23 | # Removal on $(date --date='today + 30 day' '+%Y-%m-%d').${bug:+ Bug #${bug}.}\n\ 24 | ${pkg}" profiles/package.mask 25 | -------------------------------------------------------------------------------- /lr-commit-pmask: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # commit the new entry to package.mask 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | cd "$(git rev-parse --show-toplevel)" 9 | [[ -n "$(git diff -U0 profiles/package.mask)" ]] 10 | 11 | # 1. package(s) 12 | pkg=( 13 | $(git diff -U0 profiles/package.mask | sed -n -e 's/^+\([^+#]\)/\1/p') 14 | ) 15 | pkg="${pkg[*]}" 16 | 17 | # 2. bugno 18 | bugno=$(git diff -U0 profiles/package.mask | 19 | sed -n -e 's/^+#.*Removal.* Bug #\([0-9]\+\)./\1/p') 20 | 21 | msg="package.mask: Last rite ${pkg// /, }${bugno:+ 22 | 23 | Bug: https://bugs.gentoo.org/${bugno}}" 24 | 25 | exec git commit -s -S -m "${msg}" profiles/package.mask 26 | -------------------------------------------------------------------------------- /lr-file-bug: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # open a browser with template for filing removal bug for pkg(s) ${*} 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | pkgs=${*} 10 | exec xdg-open "https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%20Linux&component=Current+packages&short_desc=$("${scriptdir}"/urlencode <<<"${pkgs// /, }: removal")&keywords=PMASKED&cc=treecleaner@gentoo.org&deadline=$(date --date='today + 30 day' +%Y-%m-%d)" 11 | -------------------------------------------------------------------------------- /lr-mail-pmask: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # open a mail client with template last rites mail based on current diff 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | cd "$(git rev-parse --show-toplevel)" 10 | msg=$( 11 | git diff -U0 HEAD^ profiles/package.mask | 12 | sed -n -e 's/^+\([^+]\)/\1/p' 13 | ) 14 | 15 | pkg=( $(echo "${msg}" | grep '^[^#]') ) 16 | pkg=${pkg[*]} 17 | 18 | exec xdg-open "mailto:gentoo-dev-announce@lists.gentoo.org?cc=gentoo-dev@lists.gentoo.org&reply-to=gentoo-dev@lists.gentoo.org&subject=$("${scriptdir}"/urlencode <<<"Last rites: ${pkg// /, }")&body=$("${scriptdir}"/urlencode <<<"${msg}")" 19 | -------------------------------------------------------------------------------- /lr-remove: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # remove the specified package, opening all relevant bugs in the browser 3 | # and grepping profiles for stale references 4 | # note: package.mask entry must be removed first! 5 | # (c) 2019-2024 Michał Górny 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | pkg=${1}; shift 10 | 11 | if ! [[ ${pkg} ]]; then 12 | echo "Usage: ${0} cat/pkg [bugno]" 13 | exit 1 14 | fi 15 | 16 | set -e -x 17 | cd "$(git rev-parse --show-toplevel)" 18 | git rm -r "${pkg}" 19 | urls=( 20 | "${@/#/https:\/\/bugs.gentoo.org\/show_bug.cgi?id=}" 21 | "https://bugs.gentoo.org/buglist.cgi?no_redirect=1&quicksearch=$("${scriptdir}"/urlencode <<<"${pkg}")" 22 | ) 23 | if type -P exo-open &>/dev/null; then 24 | exo-open "${urls[@]}" 25 | else 26 | for url in "${urls[@]}"; do 27 | xdg-open "${url}" 28 | done 29 | fi 30 | git --no-pager grep "${pkg}" profiles/ || : 31 | 32 | msg="${pkg}: Remove last-rited pkg 33 | " 34 | if [[ -n ${@} ]]; then 35 | for bug; do 36 | msg+=" 37 | Bug: https://bugs.gentoo.org/${bug}" 38 | done 39 | fi 40 | 41 | exec git commit -a -s -S -m "${msg}" 42 | -------------------------------------------------------------------------------- /mkpatchset: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # create a patchset tarball and upload it to dev.g.o 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e -x 7 | tag=${1} 8 | name=${2} 9 | upstream=${3} 10 | subdir=${4} 11 | 12 | if [ -z "${tag}" -o -z "${name}" -o -z "${upstream}" ]; then 13 | echo "Usage: ${0} []" >&2 14 | exit 1 15 | fi 16 | 17 | git tag "${tag}" 18 | 19 | mkdir "${name}" 20 | cd "${name}" 21 | git format-patch "${upstream}" 22 | cd .. 23 | tar -cf "${name}".tar "${name}" 24 | xz -9e "${name}".tar 25 | scp "${name}".tar.xz "dev.gentoo.org:public_html/dist/${subdir}" 26 | rm -r "${name}"{,.tar.xz} 27 | -------------------------------------------------------------------------------- /pkg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # print package name for current directory 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | path=$(git rev-parse --show-prefix) 7 | echo "${path%/}" 8 | -------------------------------------------------------------------------------- /pkgbump: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # (c) 2019-2024 Michał Górny 3 | # SPDX-License-Identifier: GPL-2.0-or-later 4 | 5 | for arg; do 6 | if [[ ${arg} != *.ebuild ]]; then 7 | echo "Incorrect filename: ${arg}" 8 | exit 1 9 | fi 10 | 11 | filename=${arg##*/} 12 | version=$(patom -F '%{fullver}' "=category/${arg%.ebuild}") 13 | if [[ -z ${version} ]]; then 14 | echo "Incorrect filename: ${arg}" 15 | exit 1 16 | fi 17 | done 18 | 19 | set -e -x 20 | 21 | scriptdir=${BASH_SOURCE%/*} 22 | cp "${1}" "${2}" 23 | "${scriptdir}"/copybump "${2}" 24 | ekeyword ~all "${2}" 25 | if grep -q "^PYTHON_COMPAT" "${2}" && type -P gpy-impl &>/dev/null; then 26 | gpy-impl "${2}" -@dead || : 27 | fi 28 | # tell ebuilds we don't want everything 29 | export PKGBUMPING=${version} 30 | GENTOO_MIRRORS= ebuild "${2}" manifest 31 | [[ ! -f Manifest ]] || git add Manifest 32 | git add "${2}" 33 | echo "${version}" > .pkgbump-pv 34 | exec "${scriptdir}"/pkgdiff-mg "${1}" "${2}" 35 | -------------------------------------------------------------------------------- /pkgcommit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # handy wrapper for 'git commit', prepending package name 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | args=() 7 | msg= 8 | used_bump= 9 | 10 | # check for -m ... 11 | while [[ ${#} -gt 0 ]]; do 12 | case ${1} in 13 | -m) 14 | msg=${2} 15 | shift 2 16 | continue 17 | ;; 18 | --bump) 19 | if [[ ! -f .pkgbump-pv ]]; then 20 | echo "No .pkgbump-pv (pkgbump not used?)" >&2 21 | exit 1 22 | fi 23 | # make sure it doesn't up being committed 24 | git rm --cached .pkgbump-pv || : 25 | used_bump=1 26 | msg="Bump to $(<.pkgbump-pv)" 27 | shift 28 | continue 29 | ;; 30 | esac 31 | 32 | args+=( "${1}" ) 33 | shift 34 | done 35 | 36 | set -e -x 37 | 38 | tmpf=$(mktemp) 39 | echo "$(pkg): ${msg}" > "${tmpf}" 40 | [[ ${msg} ]] || ${EDITOR:-vim} "${tmpf}" 41 | if [[ -s ${tmpf} ]]; then 42 | git commit -F "${tmpf}" "${args[@]}" 43 | fi 44 | rm -f "${tmpf}" 45 | if [[ ${used_bump} ]]; then 46 | rm .pkgbump-pv 47 | fi 48 | -------------------------------------------------------------------------------- /pkgdiff-mg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # diff sources unpacked by two ebuilds (works only for simple ebuilds) 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e -x 7 | 8 | mode=default 9 | while [[ ${#} -gt 0 ]]; do 10 | case ${1} in 11 | --all|-a) 12 | mode= 13 | ;; 14 | --build-system|-b) 15 | mode=build-system 16 | ;; 17 | *) 18 | break 19 | ;; 20 | esac 21 | shift 22 | done 23 | 24 | get_category() { 25 | local dir=. 26 | [[ ${1} != */* ]] || dir=${1%/*} 27 | dir=$( cd "${dir}" && pwd ) 28 | dir="${dir%/*}" 29 | echo "${dir##*/}" 30 | } 31 | 32 | cat1=$(get_category "${1}") 33 | cat2=$(get_category "${2}") 34 | fn1=${1##*/} 35 | fn2=${2##*/} 36 | ver1=$(patom -F '%{fullver}' "=${cat1}/${fn1%.ebuild}") 37 | ver2=$(patom -F '%{fullver}' "=${cat2}/${fn2%.ebuild}") 38 | 39 | export PORTAGE_TMPDIR="${TMPDIR:-/tmp}"/mgorny-dev-scripts 40 | export USE="${USE} test" 41 | # use noauto to skip pkg_setup 42 | export FEATURES="${FEATURES} noauto" 43 | # tell ebuilds we don't want everything 44 | mkdir -p "${PORTAGE_TMPDIR}" 45 | PKGBUMPING=${ver1} ebuild "${1}" unpack 46 | PKGBUMPING=${ver2} ebuild "${2}" unpack 47 | s1=$(sed -nr 's/^declare -x S="(.*)"/\1/p' "${PORTAGE_TMPDIR}"/portage/${cat1}/${fn1%.ebuild}/temp/environment) 48 | s2=$(sed -nr 's/^declare -x S="(.*)"/\1/p' "${PORTAGE_TMPDIR}"/portage/${cat2}/${fn2%.ebuild}/temp/environment) 49 | 50 | [[ -d ${s1} ]] 51 | [[ -d ${s2} ]] 52 | 53 | { 54 | case "${mode}" in 55 | build-system) 56 | find "${s1}" "${s2}" -type f \ 57 | ! \( \ 58 | -name 'configure.ac' -o \ 59 | -name '*.m4' -o \ 60 | -name 'meson.build' -o \ 61 | -name 'meson.options' -o \ 62 | -name 'meson_options.txt' -o \ 63 | -name '*.cmake' -o \ 64 | -name 'CMakeLists.txt' -o \ 65 | -name 'setup.py' -o \ 66 | -name 'setup.cfg' -o \ 67 | -name 'pyproject.toml' -o \ 68 | -name 'Makefile.PL' -o \ 69 | -name 'Build.PL' -o \ 70 | -name 'dist.ini' -o \ 71 | -name 'META.yml' -o \ 72 | -name 'META.json' -o \ 73 | -name 'NEWS*' -o \ 74 | -name 'CHANGES*' -o \ 75 | -name 'CHANGELOG*' -o \ 76 | -name 'Gemfile' -o \ 77 | -name 'Gemfile.lock' -o \ 78 | -name 'META' -o \ 79 | -name '*.opam' -o \ 80 | -name 'opam' -o \ 81 | -name 'dune' -o \ 82 | -name 'dune-project' -o \ 83 | -name 'LICENSE*' -o \ 84 | -name 'COPYING*' -o \ 85 | -name 'SConscript' -o \ 86 | -name 'SConstruct' -o \ 87 | -name 'Cargo.lock' -o \ 88 | -name 'Cargo.toml' \ 89 | \) -printf "%f\n" 90 | ;; 91 | default) 92 | find "${s1}" "${s2}" -type f \ 93 | \( \ 94 | -name '*.min.*' -o \ 95 | -name 'searchindex.js' \ 96 | \) -printf "%f\n" 97 | ;; 98 | esac 99 | } | diff --color=always --exclude=".git" --strip-trailing-cr -X - -dupNr "${s1}" "${s2}" | ${PAGER:-less} 100 | -------------------------------------------------------------------------------- /pkgmove: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # perform a package move 3 | # (c) 2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e -x 7 | 8 | scriptdir=${BASH_SOURCE%/*} 9 | from=${1} 10 | to=${2} 11 | 12 | [[ ${from} && ${to} ]] 13 | 14 | if [[ -d ${from} ]]; then 15 | git mv "${from}" "${to}" 16 | fi 17 | 18 | find profiles/updates -type f -exec sed -i -e "\@^move ${from} @d" {} + 19 | git grep -l "${from}" :!profiles/updates | 20 | xargs -r sed -i -e "s@${from}@${to}@g" 21 | update_file=profiles/updates/$(date "+%qQ-%Y") 22 | echo "move ${from} ${to}" >> "${update_file}" 23 | git add -N "${update_file}" 24 | 25 | modified=( $(git diff --name-only HEAD) ) 26 | "${scriptdir}"/copybump "${modified[@]}" 27 | if type -P gpy-impl &>/dev/null; then 28 | git grep -l "^PYTHON_COMPAT" "${modified[@]}" | 29 | xargs -r gpy-impl -@dead || : 30 | fi 31 | -------------------------------------------------------------------------------- /pypy-patchset: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # generate PyPy patchset 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e -x 7 | scriptdir=${BASH_SOURCE%/*} 8 | branch=${1} 9 | [[ -n ${branch} ]] 10 | ver=${2} 11 | [[ -n ${ver} ]] 12 | exec "${scriptdir}"/mkpatchset "gentoo-${branch}-${ver}" \ 13 | "pypy${branch}-gentoo-patches-${ver}" \ 14 | "release-pypy${branch}-v${ver%_p*}" python/ 15 | -------------------------------------------------------------------------------- /python-patchset: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # generate CPython patchset 3 | # (c) 2022-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e -x 7 | scriptdir=${BASH_SOURCE%/*} 8 | ver=${1} 9 | [[ -n ${ver} ]] 10 | exec "${scriptdir}"/mkpatchset "gentoo-${ver}" "python-gentoo-patches-${ver}" \ 11 | "v${ver%_p*}" python/ 12 | -------------------------------------------------------------------------------- /rdep: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # print revdeps of packages specified on command-line 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | # bsdtar is faster than GNU tar 7 | if command -v bsdtar >/dev/null; then 8 | TAR="bsdtar -xqOf" 9 | else 10 | TAR="tar -xOf" 11 | fi 12 | 13 | # find the best cache available 14 | CACHEDIR=${TMPDIR:-/tmp}/mgorny-dev-scripts 15 | GET= 16 | if [ -d "${CACHEDIR}" ]; then 17 | cd "${CACHEDIR}" || exit 1 18 | if [ -f rdeps.tar.lz4 ]; then 19 | GET="${TAR} rdeps.tar.lz4 " 20 | elif [ -f rdeps.tar ]; then 21 | GET="${TAR} rdeps.tar " 22 | elif [ -d rindex ]; then 23 | GET="cat " 24 | fi 25 | fi 26 | 27 | # use wget if no cache available 28 | if [ -z "${GET}" ]; then 29 | echo "[Fetching from qa-reports, please consider running rdep-fetch-cache]" >&2 30 | GET="wget -q -O - https://qa-reports.gentoo.org/output/genrdeps/" 31 | fi 32 | 33 | 34 | fetch() { 35 | ${GET}${1}index/${pkg} 36 | } 37 | 38 | for pkg; do 39 | echo "== rdep of ${pkg} ==" >&2 40 | fetch r 41 | echo "== ddep of ${pkg} ==" >&2 42 | fetch d 43 | echo "== bdep of ${pkg} ==" >&2 44 | fetch b 45 | echo "== pdep of ${pkg} ==" >&2 46 | fetch p 47 | echo "== idep of ${pkg} ==" >&2 48 | fetch i 49 | done 50 | -------------------------------------------------------------------------------- /rdep-fetch-cache: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # fetch cache for rdep 3 | # (c) 2020-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | mkdir -p "${TMPDIR:-/tmp}"/mgorny-dev-scripts || exit 1 7 | cd "${TMPDIR:-/tmp}"/mgorny-dev-scripts || exit 1 8 | 9 | if command -v lz4 >/dev/null; then 10 | echo "lz4 available, repacking as rdeps.tar.lz4" >&2 11 | 12 | exec wget -O - https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz | 13 | xz -cd | lz4 -c > rdeps.tar.lz4 14 | else 15 | echo "fetching to rdeps.tar (install lz4 to compress)" >&2 16 | 17 | exec wget -O - https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz | 18 | xz -cd > rdeps.tar 19 | fi 20 | -------------------------------------------------------------------------------- /stablereq-eshowkw: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # grab stabilization candidates and pipe them into eshowkw 3 | # (c) 2021-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | pkgcheck scan ${PKGCHECK_ARGS} -c StableRequestCheck \ 7 | -R FormatReporter --format '{category}/{package}' "${@}" | 8 | sort | xargs eshowkw -C |& ${PAGER:-less} 9 | -------------------------------------------------------------------------------- /stablereq-find-candidates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # format stabilization candidates for maintainer 3 | # (c) 2022-2024 Matt Turner 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | set -e 7 | 8 | if [[ ${#} -eq 0 ]]; then 9 | echo "Usage: $0 " 10 | exit 11 | fi 12 | maint=${1} 13 | 14 | cd "$(git rev-parse --show-toplevel)" 15 | 16 | echo " days │ category/package:slot" 17 | echo "──────┼────────────────────────────────────────────────────────────────────────" 18 | exec \ 19 | git grep -l "${maint}" '*/*/metadata.xml' | 20 | cut -d/ -f1-2 | 21 | xargs pkgcheck scan ${PKGCHECK_ARGS} -k StableRequest -R FormatReporter --format " {age:4} │ {category}/{package}-{version}:{slot}" | 22 | sort -k2 23 | -------------------------------------------------------------------------------- /stablereq-find-pkg-bugs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # grab stabilization candidates and pipe them into find-pkg-bugs 3 | # (c) 2021-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | pkgcheck scan ${PKGCHECK_ARGS} -c StableRequestCheck \ 7 | -R FormatReporter --format '{category}/{package}' "${@}" | 8 | sort | xargs -n40 find-pkg-bugs 9 | -------------------------------------------------------------------------------- /stablereq-make-list: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # grab stabilization candidates and pipe a list of 'file-stablereq' commands 3 | # into an editor 4 | # (c) 2021-2024 Michał Górny 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | pkgcheck scan ${PKGCHECK_ARGS} -c StableRequestCheck -R FormatReporter \ 8 | --format '={category}/{package}-{version}' "${@}" | 9 | sort | ${EDITOR:-vim} - 10 | -------------------------------------------------------------------------------- /urlencode: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Quick wrapper to URL-encode stdin to stdout, via Perl. 3 | # (c) 2019-2024 Michał Górny 4 | # SPDX-License-Identifier: GPL-2.0-or-later 5 | 6 | exec perl -MURI::Escape -00 -p -e 'chomp; $_ = uri_escape $_' 7 | --------------------------------------------------------------------------------