[pacman-dev] [PATCH v3] pacdiff: Search and give warnings for older pacsave.[0-9] files
Jonathan Frazier
eyeswide at gmail.com
Thu Jul 11 14:58:08 EDT 2013
On 07/11/13 at 02:30pm, Andrew Gregory wrote:
> On 07/11/13 at 02:15pm, Jonathan Frazier wrote:
> > Signed-off-by: Jonathan Frazier <eyeswide at gmail.com>
> > ---
> > contrib/pacdiff.sh.in | 12 ++++++++++--
> > 1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/contrib/pacdiff.sh.in b/contrib/pacdiff.sh.in
> > index 47779d6..a2c9cad 100644
> > --- a/contrib/pacdiff.sh.in
> > +++ b/contrib/pacdiff.sh.in
> > @@ -47,9 +47,9 @@ version() {
> >
> > cmd() {
> > if [ $locate -eq 1 ]; then
> > - locate -0 -e -b \*.pacnew \*.pacorig \*.pacsave
> > + locate -0 -e -b \*.pacnew \*.pacorig \*.pacsave '*.pacsave.[0-9]'
> > else
> > - find $diffsearchpath \( -name \*.pacnew -o -name \*.pacorig -o -name \*.pacsave \) -print0
> > + find $diffsearchpath \( -name \*.pacnew -o -name \*.pacorig -o -name \*.pacsave -o -name '*.pacsave.[0-9]' \) -print0
> > fi
> > }
> >
> > @@ -71,6 +71,12 @@ while IFS= read -u 3 -r -d '' pacfile; do
> > file="${pacfile%.pac*}"
> > file_type="pac${pacfile##*.pac}"
> >
> > + # add matches for pacsave.N to oldsaves array, do not prompt
>
> You've got a tab in the middle there.
>
> > + if [[ $file_type = pacsave.+([0-9]) ]]; then
>
> Need to indent that with a tab instead of spaces.
>
> > + oldsaves+=("$pacfile")
>
> Is there any reason not to just go ahead and print the "Ignoring..."
> warning here instead of saving them?
>
It is neater, and at some point I wanted to do something better than
just printing a warning for each them. whether it is showing n found
instead of all of them. or some merging magic rather than just merging
the latest pacnew.
> > + continue
> > + fi
> > +
> > msg "%s file found for %s" "$file_type" "$file"
> > if [ ! -f "$file" ]; then
> > warning "$file does not exist"
> > @@ -97,6 +103,8 @@ while IFS= read -u 3 -r -d '' pacfile; do
> > fi
> > done 3< <(cmd)
> >
> > +(( ${#oldsaves[@]} > 0 )) && warning "Ignoring %s" "${oldsaves[@]}"
> > +
> > exit 0
> >
> > # vim: set ts=2 sw=2 noet:
> > --
> > 1.8.3.2
> >
> >
>
More information about the pacman-dev
mailing list