{"id":14530527,"url":"https://github.com/projg2/mgorny-dev-scripts","last_synced_at":"2025-09-02T02:31:06.514Z","repository":{"id":38107185,"uuid":"175802149","full_name":"projg2/mgorny-dev-scripts","owner":"projg2","description":"Quick \u0026 dirty ebuild development scripts","archived":false,"fork":false,"pushed_at":"2025-08-21T06:15:13.000Z","size":174,"stargazers_count":34,"open_issues_count":5,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-21T08:33:55.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projg2.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-15T10:48:50.000Z","updated_at":"2025-08-21T06:15:17.000Z","dependencies_parsed_at":"2023-11-28T18:31:19.080Z","dependency_job_id":"5bd3de1b-acd9-42ad-abb8-227f1f84046d","html_url":"https://github.com/projg2/mgorny-dev-scripts","commit_stats":null,"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"purl":"pkg:github/projg2/mgorny-dev-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projg2%2Fmgorny-dev-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projg2%2Fmgorny-dev-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projg2%2Fmgorny-dev-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projg2%2Fmgorny-dev-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projg2","download_url":"https://codeload.github.com/projg2/mgorny-dev-scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projg2%2Fmgorny-dev-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273219785,"owners_count":25066235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-05T00:01:07.882Z","updated_at":"2025-09-02T02:31:06.485Z","avatar_url":"https://github.com/projg2.png","language":"Shell","funding_links":[],"categories":["readelf and objdump"],"sub_categories":["Using ltrace to trace both userspace library calls, syscalls, and collect stack traces"],"readme":"==================\nmgorny-dev-scripts\n==================\n\nThis is a bunch of handy scripts that I use for ebuild development.\nPlease note that those scripts are generally very simple and have very\nlimited precondition checks and error handling.  Most of the time, they\nterminate on any error (relying on external tools providing error\nmessages) and behave unpredictably e.g. when run with incorrect\narguments or in wrong directory.\n\n\nPackage committing helpers\n==========================\n\ncopybump\n--------\nSed wrapper that updates copyright notices in specified files.\nTypical usage::\n\n    # ('git diff --name-only' gives paths valid for top-level directory)\n    # update all currently modified files\n    copybump $(git diff --name-only)\n    # update files modified by all commits since origin\n    copybump $(git diff --name-only origin)\n\npkgcommit\n---------\nDependencies: git\n\nCommits changes, prepending package name determined from the current\ndirectory.  Accepts same arguments as ``git commit``, handles ``-m``\nargument specially.  Typical usage::\n\n    # (in package directory)\n    # commit current dir, open EDITOR for commit message\n    pkgcommit -sS .\n    # use provided commit message (prepends package)\n    pkgcommit -sS -m 'Bump to 1.2.3' .\n    # use version saved by pkgbump\n    pkgcommit -sS --bump\n\ngit-fixup-mg\n------------\nDependencies: git\n\nCommits changes to the specified files (or current directory, if no\nargument specified) as a fixup to the latest commit on those files.\nTypical usage::\n\n    # (in package directory)\n    # initial commit\n    pkgcommit -sS -m 'Bump to 1.2.3'\n    # do some fixes\n    git-fixup-mg\n    # rebase squashes fixup into parent commit\n    git rebase -i -S origin\n\n\nPackage maintenance helpers\n===========================\n\ncheck-revdep\n------------\nDependecies: pkgcore\n\nRuns a visibility (dependency) check for all reverse dependencies\nof the specified packages (or the current package, if none specified).\nThis can be used to verify that the cleanup of given package does not\nbreak any revdeps (e.g. using ``\u003c`` deps or old USE flags).  Typical\nusage::\n\n    cd foo/bar\n    git rm bar-1.ebuild\n    check-revdep\n    pkgdev manifest\n    pkgcommit -sS . -m 'Remove old'\n\nUses rdep_ command.  You may want to call ``rdep-fetch-cache`` if you\nplan on using it multiple times.\n\npkgdiff-mg\n----------\nDependencies: portage, pkgcore\n\nCalls ``ebuild(1)`` to extract archives for two specified ebuilds,\nand then diffs the result.  Does not handle ebuilds unpacking multiple\ndirectories into workdir or package.env PORTAGE_TMPDIR overrides.\nTypical usage::\n\n    pkgdiff-mg foo-1.0.ebuild foo-1.1.ebuild\n\nThe data is extracted into ``${TMPDIR:-/tmp}/mgorny-dev-scripts/portage``\nto avoid hitting collisions with other Portage builds.\n\nWith the ``--build-system``/``-b`` argument, it will attempt to show a diff of\nonly the build system files::\n\n    pkgdiff-mg --build-system foo-1.0.ebuild foo-1.1.ebuild\n\npkgbump\n-------\nDependencies: portage, gentoolkit (ekeyword), git, pkgcore\nOptional dependencies: gpyutils \u003e= 0.12 (gpy-impl)\n\nCopies ebuild for a version bump, dropping keywords, updating Manifest\nand running pkgdiff-mg_ to compare archives.  Typical usage::\n\n    pkgbump foo-1.0.ebuild foo-1.1.ebuild\n\npkgmove\n-------\nDependencies: git\nOptional dependencies: gpyutils \u003e= 0.12 (gpy-impl)\n\nPerforms a package move.  Moves the package directory if the old name\nstill exists.  Updates all entries in ebuilds, eclasses and profiles.\nAdds a profiles/updates entry.\n\nWARNING: edits are done using greedy sed.  Double-check the results.\n\nExample use::\n\n    pkgmove dev-util/cmake-fedora dev-build/cmake-fedora\n    pkgmove dev-util/cmake dev-build/cmake\n\nmkpatchset\n----------\nDependencies: git, scp\n\nCreate a patchset from fork-style repository, and upload it\nto dev.gentoo.org.  Typical usage::\n\n    #          tag          archive-name                upstream dgo-subdir\n    mkpatchset gentoo-3.9.8 python-gentoo-patches-3.9.8 v3.9.8   python/\n\ncheck-mismatched-packages\n-------------------------\nDependencies: git, pkgcore\n\nCheck whether packages that should be bumped in sync are up-to-date.\nUseful for a pre-push hook.\n\n\nPackage tree iteration helpers\n==============================\n\nforeach-pkg\n-----------\nTakes package cat/pns as arguments, and runs bash in each directory\nspecified.  Typical usage::\n\n    # (inside repo)\n    foreach-pkg app-foo/bar app-foo/frobnicate\n    # (runs bash in app-foo/bar)\n    ...\n    # (runs bash in app-foo/frobnicate)\n    ...\n\nforeach-pkg-maint\n-----------------\nTakes maintainer e-mail as first argument, and optionally command\nas the remaining arguments.  Finds all packages with maintainer present\nin ``metadata.xml`` (cheap grep), and runs the specified command\nin their directories.  If no command is specified, just runs bash\nfor further interaction.  Typical usage::\n\n    # (inside repo)\n    # runs bash in all packages maintained by foo@gentoo.org\n    foreach-pkg-maint foo@gentoo.org\n    # runs eshowkw in all xfce@ packages that have more than one version\n    foreach-pkg-maint xfce@gentoo.org if-multiple-versions eshowkw -C |\u0026 less\n\nllvm-foreach-pkg \u0026 llvm-foreach-pkg-rev\n---------------------------------------\nRuns the specified command in directories of all LLVM packages.\nThe non-suffixed variant iterates over them in dependency first order\n(e.g. suitable for bumps), while -rev uses the reverse order\n(e.g. suitable for cleanups).  Note that the command is not undergoing\nbash expansions.\n\nTypical usage::\n\n    llvm-foreach-pkg sh -c 'x=( *14.0.0.9999* ); cp ${x} ${x/.9999}'\n    git add -A\n    pkgdev manifest\n    llvm-foreach-pkg pkgcommit -sS . -m \"Bump to 14.0.0\"\n\n    llvm-foreach-pkg sh -c 'git rm *14.0.0_rc4*'\n    pkgdev manifest\n    llvm-foreach-pkg-rev pkgcommit -sS . -m \"Remove 14.0.0_rc4\"\n\nif-multiple-versions\n--------------------\nWrapper that runs the specified command if the current directory\ncontains more than one ebuild file.  Live ebuilds (``*-9999.ebuild``)\nare ignored.  See example above.\n\nrdep\n----\nDependencies: wget, optionally tar, xz and lz4\n\nAccepts one or more cat/pns and prints their reverse dependencies.\nThe data is fetched from qa-reports.g.o.  Typical usage::\n\n    rdep app-foo/bar app-foo/frobnicate\n\nIf you plan to use it on a larger number of packages, you can prefetch\nall data and have it put into ``${TMPDIR:-/tmp}/mgorny-dev-scripts``::\n\n    rdep-fetch-cache\n\nIf lz4 is installed, the cache will be saved as a ``.tar.lz4`` archive\nfor space- and performance-efficient lookup; otherwise it will be saved\nas uncompressed ``.tar``.  If ``bsdtar`` is installed, it will be used\ninstead of ``tar`` as it supports fast reads.\n\n\nBugzilla helpers\n================\n\nfile-pkgcheck\n-------------\nDependencies: pkgcheck, xdg-utils or exo (from xfce), perl\n\nRun pkgcheck on specified packages, and open bug templates for each\nresult set.  Typical usage::\n\n    file-pkgcheck app-foo/bar\n\nfile-rekeywordreq\n-----------------\nDependencies: xdg-utils, perl\n\nRuns a web browser with pre-filled Bugzilla template for requesting\nrekeywording of the package specified as the first argument.  Typical\nusage::\n\n    file-rekeywordreq app-foo/bar\n\nfile-stablereq\n--------------\nDependencies: xdg-utils, perl\n\nRuns a web browser with pre-filled Bugzilla template for requesting\nstabilization of package specified as the first argument.  Typical\nusage::\n\n    file-stablereq app-foo/bar-1.2.3\n\nfile-kernel-stablereq\n---------------------\nDependencies: xdg-utils, perl\n\nRuns a web browser with pre-filled Bugzilla template for requesting\nstabilization of dist-kernel versions specified as arguments.  Typical\nusage::\n\n    file-kernel-stablereq 5.10.96 5.4.176\n\nfind-pkg-bugs\n-------------\nDependencies: xdg-utils, perl\n\nRuns a web browser with Bugzilla search for bugs referring to any\nof the packages listed on command-line.  Typical usage::\n\n    find-pkg-bugs app-bar/foo app-foo/bar\n\n\nGitHub helpers\n==============\n\nfind-gh-prs\n-----------\nDependencies: xdg-utils, perl\n\nRuns a web browser with GitHub pull request search for bugs referring\nto any of the packages listed on command-line.  Typical usage::\n\n    find-gh-prs app-bar/foo app-foo/bar\n\n\nLastriting helpers\n==================\n\nlr-file-bug\n-----------\nDependencies: xdg-utils, perl\n\nOpens a web browser with pre-filled bug template for removing a package\nspecified as the first argument, after 30 days.  Typical usage::\n\n    lr-file-bug $(pkg)\n\nlr-add-pmask\n------------\nDependencies: git\n\nAdd a package.mask template entry for removal of package specified\nas the first argument, optionally mentioning bug specified as the second\nargument.  Typical usage::\n\n    # without bug no\n    lr-add-pmask app-foo/bar\n    # with bug no\n    lr-add-pmask app-foo/frobnicate 123456\n    # edit package.mask afterwards\n    vim profiles/package.mask\n\nlr-commit-pmask\n---------------\nDependencies: git\n\nAttempts to determine package and bug list from package.mask entry\nin ``git diff``, and commits it.  Typical usage::\n\n    # add your package.mask entry\n    vim profiles/package.mask\n    # commit it\n    lr-commit-pmask\n\nlr-mail-pmask\n-------------\nDependencies: git, xdg-utils, perl\n\nAttempts to determine package and bug list from package.mask entry\nin ``git diff``, and spawns e-mail client in order to send last rites\nmail.  Typical usage::\n\n    # add your package.mask entry\n    vim profiles/package.mask\n    # prepare mail\n    lr-mail-pmask\n\nlr-remove\n---------\nDependencies: git, portage, xdg-utils or exo (from xfce), perl\n\nTakes a package name as the first argument, and bug numbers as remaining\narguments.  Removes the specified package and commits it as lastrited\npackage removal.  Opens a web browser on all specified bugs + search\nfor package name.  Greps profiles for stale package references.  This\npresumes you remove package.mask entry prior to running it.  Typical\nusage::\n\n    # find package to remove, remove its entry\n    vim profiles/package.mask\n    # remove the package\n    lr-remove app-foo/bar 123456\n    # (review the bugs, verify output for stale profile entries)\n    # if additional profile entries were removed\n    git commit -a --amend -S\n    # if package should not be removed after all\n    git reset --hard HEAD^\n\n\nStabilization helpers\n=====================\n\nstablereq-eshowkw\n-----------------\nDependencies: pkgcheck, gentoolkit, pager\n\nFind stabilization candidates and pipe them into eshowkw.  The script\naccepts pkgcheck arguments.  Typical usage::\n\n    stablereq-eshowkw 'dev-python/*'\n\n\nstablereq-find-candidates\n-------------------------\nDependencies: pkgcheck\n\nFind stabilization candidates for a given maintainer. Typical usage::\n\n    stablereq-find-candidates x11@gentoo.org\n\n\nstablereq-find-pkg-bugs\n-----------------------\nDependencies: pkgcheck, xdg-utils, perl\n\nFind stabilization candidates and open a Bugzilla search in the web\nbrowser for the relevant packages.  The script accepts pkgcheck\narguments.  Typical usage::\n\n    stablereq-find-pkg-bugs 'dev-python/*'\n\n\nstablereq-make-list\n---------------------\nDependencies: pkgcheck, editor\n\nFind stabilization candidates and pipe a list of file-stablereq calls\ninto an editor for editing and then running.  The script accepts\npkgcheck arguments.  Typical usage::\n\n    stablereq-make-list 'dev-python/*'\n\n\nGeneric git repository helpers\n==============================\n\ngit-foreach-repo\n----------------\nRuns the specified command in all git repositories found in current\ndirectory and below.  Typical usage::\n\n    git-foreach-repo git gc --prune --aggressive\n\ngit-make-empty\n--------------\nDependencies: git\n\nCreates an ``empty`` branch in the git repository that is detached from\nhistory and contains no files, and checks it out.  The main idea is to\nsave space by cleanly emptying unused repositories while preserving\n``.git`` directory.  Typical usage::\n\n    git-make-empty\n\nvgrep\n-----\nDependencies: git, vim\n\nWraps ``git grep`` to call ``vim`` with the same search pattern.\nTypical usage::\n\n    vgrep foo.*bar profiles/\n\n\nPackage bumping helpers\n=======================\nCommon dependencies: same as pkgbump + pkgcommit\n\nbump-boto\n---------\nBump ``dev-python/botocore``, ``dev-python/boto3`` and ``app-admin/awscli``\nin lockstep.  Takes the increment for the last version component.  Typical\nusage::\n\n    bump-boto +1\n\nbump-kernels\n------------\nBump dist-kernel packages.  Takes one or more pairs of \u003cold-version\u003e\nand \u003cnew-version\u003e.  Typical usage::\n\n    bump-kernels 5.16.14 5.16.15 5.15.28 5.15.29 5.10.105 5.10.106\n\nAfter the bumps, writes a diff from git origin into\n``${BINPKG_DOCKER}/local.diff``.  ``BINPKG_DOCKER`` defaults to\n``~/git/binpkg-docker`` and should be a checkout of binpkg-docker_ repo.\nIt should be used to build binary kernel packages, and then\nbump-kernels-bin_ should be called.\n\nRead `Distribution_Kernel/Bumping_kernels`_ on the wiki for more details.\n\n.. _binpkg-docker: https://github.com/mgorny/binpkg-docker/\n.. _Distribution_Kernel/Bumping_kernels: https://wiki.gentoo.org/wiki/Project:Distribution_Kernel/Bumping_kernels\n\nbump-kernels-bin\n----------------\nBump binary dist-kernel packages.  Takes one or more pairs\nof \u003cold-version\u003e and \u003cnew-version\u003e.  Typical usage::\n\n    bump-kernels-bin 5.16.14 5.16.15 5.15.28 5.15.29 5.10.105 5.10.106\n\nThe package expects binary kernel .xpaks to be present in ``${BINPKG}``\nsubdirectories corresponding to architectures.  ``BINPKG`` defaults\nto ``~/binpkg``.  The kernels are copied into ``DISTDIR``.\n\n\nPatchset generation helpers\n===========================\nCommon dependencies: same as mkpatchset_\n\npython-patchset\n---------------\nMakes the ``dev-lang/python`` patchset.  Typical usage::\n\n    python-patchset 3.10.2\n\nRun it in `fork/cpython`_ checkout.  Remember to push the tags\nafterwards.\n\n.. _fork/cpython: https://gitweb.gentoo.org/fork/cpython.git/\n\npypy-patchset\n---------------\nMakes the ``dev-python/pypy3`` patchset.  Typical usage::\n\n    #             branch  version\n    pypy-patchset 3.9     7.3.9\n\nRun it in `fork/pypy`_ checkout.  Note that the upstream for this\nis the unofficial git mirror `mozillazg/pypy`_.  Remember to push\nthe tags afterwards.\n\n.. _fork/pypy: https://gitweb.gentoo.org/fork/pypy.git/\n.. _mozillazg/pypy: https://github.com/mozillazg/pypy/\n\nllvm-patchset\n-------------\nMakes the ``sys-devel/llvm`` \u0026 co. patchset.  Typical usage::\n\n    llvm-patchset 14.0.0\n\nRun it in `fork/llvm-project`_ checkout.  Remember to push the tags\nafterwards.  Read `LLVM/Releases`_ on the wiki for more details.\n\n.. _fork/llvm-project: https://gitweb.gentoo.org/fork/llvm-project.git/\n.. _LLVM/Releases: https://wiki.gentoo.org/wiki/Project:LLVM/Releases\n\nlinux-patchset\n--------------\nMakes the ``sys-kernel/*-kernel`` patchset.  Typical usage::\n\n    linux-patchset 6.15.5\n\nRun it in `fork/linux`_ checkout.  Remember to push the tags afterwards.\n\n.. _fork/linux: https://gitweb.gentoo.org/fork/linux.git/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojg2%2Fmgorny-dev-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojg2%2Fmgorny-dev-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojg2%2Fmgorny-dev-scripts/lists"}