Skip to content

Commit 8fe36bb

Browse files
committed
write readme
1 parent 6bf6015 commit 8fe36bb

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

NEWS.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
Release Notes
33
=============
44

5+
iwdevtools-next (xxxx-xx-xx)
6+
=============================
7+
8+
New
9+
---
10+
- workdir-cd: new tool to jump to the packages workdir in PORTAGE_TMPDIR and
11+
then run a command in that directory such as listing its contents. (can
12+
search for a partial atom, and use tab completion with bash/fish/zsh after
13+
setting up shell integration)
14+
515
iwdevtools-0.12.7 (2023-08-04)
616
==============================
717

README.rst

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Overview
99
* `qa-openrc`_ tries to find a few common mistakes in OpenRC init scripts
1010

1111
+ `repo-cd`_ facilitates navigating Gentoo repos' directories with some perks
12+
+ `workdir-cd`_ facilitates navigating Portage temp' directories with some perks
1213
+ `eoldnew`_ emerges the previous version then newest, useful with `qa-cmp`_
1314
+ `scrub-patch`_ removes dirt from patches and may suggest improvements
1415
+ `find-unresolved`_ helps find missing libraries on a stripped embedded system
@@ -250,6 +251,78 @@ Results in::
250251
Run ``repo-cd --help`` or see **repo-cd(1)** man page for details and
251252
information about known limitations.
252253

254+
workdir-cd
255+
-------
256+
Dependencies: portage (portageq), libxml2 (xmllint)
257+
258+
Can be used to jump to the working directory (cd) of the specified atom.
259+
260+
If ``--path=default`` workdir-cd will try to get the path from ``protageq``.
261+
If nothing is set as PORTAGE_TMPDIR in make.conf, the usual location of
262+
TMPDIR is ``/var/tmp/portage``.
263+
264+
I unpack two packages using the ``ebuild`` command and then use the workcd
265+
alias without an argument to navigate to the latest workdir in PORTAGE_TMPDIR::
266+
267+
~/dev/gentoo/app-admin/entr $ eval "$(command workdir-cd --bash=workcd --path="default")"
268+
~/dev/gentoo/app-admin/entr $ ebuild entr-5.3-r1.ebuild unpack
269+
Appending /home/pascal/dev/gentoo to PORTDIR_OVERLAY...
270+
* entr-5.3.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ]
271+
>>> Unpacking source...
272+
>>> Unpacking entr-5.3.tar.gz to /var/tmp/portage/app-admin/entr-5.3-r1/work
273+
>>> Source unpacked in /var/tmp/portage/app-admin/entr-5.3-r1/work
274+
~/dev/gentoo/app-admin/entr $ ebuild entr-5.4.ebuild unpack
275+
Appending /home/pascal/dev/gentoo to PORTDIR_OVERLAY...
276+
* entr-5.4.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ]
277+
>>> Unpacking source...
278+
>>> Unpacking entr-5.4.tar.gz to /var/tmp/portage/app-admin/entr-5.4/work
279+
>>> Source unpacked in /var/tmp/portage/app-admin/entr-5.4/work
280+
+ LICENSE
281+
+ Makefile.bsd
282+
+ Makefile.linux
283+
+ Makefile.macos
284+
+ NEWS
285+
+ README.md
286+
+ configure
287+
+ data.h
288+
+ entr.c
289+
+ entr.1
290+
+ missing
291+
+ system_test.sh
292+
/var/tmp/portage/app-admin/entr-5.4/work/entr-5.4 $
293+
294+
If it is given a string other than '-' as the argument, workdir-cd will list
295+
the found workdirs matching that argument::
296+
297+
/ $ workcd entr
298+
? 1:/var/tmp/portage/app-admin/entr-5.3-r1 (default)
299+
? 2:/var/tmp/portage/app-admin/entr-5.4
300+
? Choice?
301+
302+
When the alias is ran with '-' as the argument, it will list all available workdirs
303+
in tmpdir and ask for which one to cd into::
304+
305+
/ $ workcd -
306+
? 1:/var/tmp/portage/app-admin/entr-5.4 (default)
307+
? 2:/var/tmp/portage/app-admin/entr-5.3-r1
308+
? 3:/var/tmp/portage/x11-misc/xscreensaver-6.06-r2
309+
? 4:/var/tmp/portage/x11-misc/xscreensaver-6.07
310+
? 5:/var/tmp/portage/sys-apps/systemd-253.6
311+
? Choice?
312+
313+
Has some customization options, like hiding fields and running commands in
314+
the directory (in the above case it ran ``ls`` by default), and these can
315+
be saved in a ``workdir-cd.conf`` or like ``--path`` was above::
316+
317+
/ $ workcd entr --run="echo hello world"
318+
? 1:/var/tmp/portage/app-admin/entr-5.3-r1 (default)
319+
? 2:/var/tmp/portage/app-admin/entr-5.4
320+
? Choice? 1
321+
+ hello world
322+
323+
Run ``workdir-cd --help`` or see **workdir-cd(1)** man page for details and
324+
information about known limitations.
325+
253326
eoldnew
254327
-------
255328
Dependencies: portage (portageq)

0 commit comments

Comments
 (0)