Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for pacman's --needed flag #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packer
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ usage() {
echo ' --noedit - do not prompt to edit files'
echo ' --quickcheck - check for updates and exit'
echo ' --auronly - only do actions for aur'
echo ' --needed - do not reinstall targets that are already up-to-date'
echo ' --devel - update devel packages during -Su'
echo ' --skipinteg - when using makepkg, do not check md5s'
echo ' --preview - edit pkgbuild before sourcing'
Expand Down Expand Up @@ -411,11 +412,20 @@ installhandling() {
if existsinlocal "$pkg"; then
localversion="$(pacman -Qs "$pkg" | grep -F "local/$pkg" | cut -d ' ' -f 2)"
if ! aurversionisnewer "$pkg" "$localversion"; then
echo -e "${COLOR6}warning:$ENDCOLOR $pkg-$localversion is up to date -- reinstalling"
if [[ $needed ]]; then
aurtargets=${aurtargets[@]/$pkg}
echo -e "${COLOR6}warning:$ENDCOLOR $pkg-$localversion is up to date -- skipping"
else
echo -e "${COLOR6}warning:$ENDCOLOR $pkg-$localversion is up to date -- reinstalling"
fi
fi
fi
done

if [[ -z $aurtargets ]]; then
exit
fi

# Echo warning if packages are out of date
for pkg in "${aurtargets[@]}" "${aurdepends[@]}"; do
if isoutofdate "$pkg"; then
Expand Down Expand Up @@ -528,6 +538,7 @@ while [[ $1 ]]; do
'--noconfirm') noconfirm='1' PACOPTS+=("--noconfirm");;
'--noedit') noedit='1' ;;
'--auronly') auronly='1' ;;
'--needed') needed=1 ; PACOPTS+=("--needed") ;;
'--quickcheck') quickcheck='1' ;;
'--devel') devel='1' ;;
'--skipinteg') MAKEPKGOPTS="--skipinteg" ;;
Expand Down
5 changes: 5 additions & 0 deletions packer.8
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ Check for updates and exit\&.
Only perform commands for the AUR\&.
.RE
.PP
\fB\-\-needed\fR
.RS 4
Do not reinstall the targets that are already up-to-date.\&.
.RE
.PP
\fB\-\-devel\fR
.RS 4
Update development packages\&. (cvs, git\&...)
Expand Down