add revert_diffs() to openbsd.ksh

This commit is contained in:
Aaron Bieber 2021-03-10 23:29:44 +00:00
parent 9039960258
commit 247c052c6c
2 changed files with 17 additions and 9 deletions

View File

@ -20,6 +20,13 @@ pclean() {
find . -size 0 -exec rm {} \; find . -size 0 -exec rm {} \;
} }
revert_diffs() {
for i in $(find . -name \*.orig); do
F=$(echo $i | sed 's/\.orig//')
mv -v "$i" "$F"
done
}
cdw() { cdw() {
cd $(make show=WRKSRC) cd $(make show=WRKSRC)
} }

View File

@ -4,13 +4,14 @@ This extension adds a number of useful OpenBSD specific tools.
The following functions are added: The following functions are added:
| Name | Purpose | | Name | Purpose |
|-------------+-----------------------------------------------------------------------------------------------------| |----------------+-----------------------------------------------------------------------------------------------------|
| cdw() | Intended to be used from a port directory. Will change directory to ~$WRKSRC~. | | cdw() | Intended to be used from a port directory. Will change directory to ~$WRKSRC~. |
| maintains() | Similar to ~port()~, this will display the ~$MAINTAINER~ of a port passed in as the first argument. | | maintains() | Similar to ~port()~, this will display the ~$MAINTAINER~ of a port passed in as the first argument. |
| pclean() | Remove ~.orig~ and empty files from ~$CWD~. | | pclean() | Remove ~.orig~ and empty files from ~$CWD~. |
| port() | Like ~src()~, but for ~/usr/ports~. | | revert_diffs() | Recursively move .orig files to their corresponding file name. |
| port_grep() | Recursively search ports tree for [file]'s that contain [pattern]. | | port() | Like ~src()~, but for ~/usr/ports~. |
| seq() | A shell implementation of Linux's [[https://linux.die.net/man/1/seq][seq(1)]] command. It supports alpha and numeric ranges. | | port_grep() | Recursively search ports tree for [file]'s that contain [pattern]. |
| src() | Similar to plan9's [[http://man.9front.org/1/src][src(1)]] command. It drops you to ~/usr/src/*/<arg 1>~. | | seq() | A shell implementation of Linux's [[https://linux.die.net/man/1/seq][seq(1)]] command. It supports alpha and numeric ranges. |
| src() | Similar to plan9's [[http://man.9front.org/1/src][src(1)]] command. It drops you to ~/usr/src/*/<arg 1>~. |