Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
5901f30b
Unverified
Commit
5901f30b
authored
May 25, 2023
by
WH-2099
Committed by
GitHub
May 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(archlinux): optimize `paclist` and `pacdisowned` (#11398)
Co-authored-by:
ratijas
<
me@ratijas.tk
>
parent
ec369bb3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
README.md
plugins/archlinux/README.md
+2
-0
archlinux.plugin.zsh
plugins/archlinux/archlinux.plugin.zsh
+12
-11
No files found.
plugins/archlinux/README.md
View file @
5901f30b
...
@@ -181,3 +181,4 @@ whether the package manager is installed, checked in the following order:
...
@@ -181,3 +181,4 @@ whether the package manager is installed, checked in the following order:
-
Ybalrid (Arthur Brainville) - ybalrid@ybalrid.info
-
Ybalrid (Arthur Brainville) - ybalrid@ybalrid.info
-
Jeff M. Hubbard - jeffmhubbard@gmail.com
-
Jeff M. Hubbard - jeffmhubbard@gmail.com
-
K. Harishankar(harishnkr) - hari2menon1234@gmail.com
-
K. Harishankar(harishnkr) - hari2menon1234@gmail.com
-
WH-2099 - wh2099@outlook.com
\ No newline at end of file
plugins/archlinux/archlinux.plugin.zsh
View file @
5901f30b
...
@@ -25,27 +25,28 @@ alias pacown='pacman -Qo'
...
@@ -25,27 +25,28 @@ alias pacown='pacman -Qo'
alias
pacupd
=
"sudo pacman -Sy"
alias
pacupd
=
"sudo pacman -Sy"
function
paclist
()
{
function
paclist
()
{
# Based on https://bbs.archlinux.org/viewtopic.php?id=93683
local
pkgs
=
$(
LC_ALL
=
C pacman
-Qqe
)
pacman
-Qqe
|
\
for
pkg
in
${
(f)pkgs
}
;
do
xargs
-I
'{}'
\
pacman
-Qs
--color
=
auto
"^
${
pkg
}
\$
"
||
break
expac
"
${
bold_color
}
% 20n
${
fg_no_bold
[white]
}
%d
${
reset_color
}
"
'{}'
done
}
}
function
pacdisowned
()
{
function
pacdisowned
()
{
local
tmp db fs
local
tmp
_dir
db fs
tmp
=
${
TMPDIR
-/tmp
}
/pacman-disowned-
$UID
-
$$
tmp
_dir
=
$(
mktemp
--directory
)
db
=
$tmp
/db
db
=
$tmp
_dir
/db
fs
=
$tmp
/fs
fs
=
$tmp
_dir
/fs
mkdir
"
$tmp
"
trap
"rm -rf
$tmp_dir
"
EXIT
trap
'rm -rf "$tmp"'
EXIT
pacman
-Qlq
|
sort
-u
>
"
$db
"
pacman
-Qlq
|
sort
-u
>
"
$db
"
find /
bin /etc /lib /sbin
/usr
!
-name
lost+found
\
find /
etc
/usr
!
-name
lost+found
\
\(
-type
d
-printf
'%p/\n'
-o
-print
\)
|
sort
>
"
$fs
"
\(
-type
d
-printf
'%p/\n'
-o
-print
\)
|
sort
>
"
$fs
"
comm
-23
"
$fs
"
"
$db
"
comm
-23
"
$fs
"
"
$db
"
rm
-rf
$tmp_dir
}
}
alias
pacmanallkeys
=
'sudo pacman-key --refresh-keys'
alias
pacmanallkeys
=
'sudo pacman-key --refresh-keys'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment