[Merge] lp:~anders-kaseorg/update-notifier/lp1200044 into lp:update-notifier

Michael Vogt michaelvogt at imap.cc
Mon Jul 15 06:43:27 UTC 2013


On Thu, Jul 11, 2013 at 02:01:24AM -0000, Anders Kaseorg wrote:
> You have been requested to review the proposed merge of lp:~anders-kaseorg/update-notifier/lp1200044 into lp:update-notifier.
> 
> For more details, see:
> https://code.launchpad.net/~anders-kaseorg/update-notifier/lp1200044/+merge/174093

Thanks for your merge proposal. This looks good, +1 from me.

Cheers,
 Michael 
 
> 
> -- 
> https://code.launchpad.net/~anders-kaseorg/update-notifier/lp1200044/+merge/174093
> You are requested to review the proposed merge of lp:~anders-kaseorg/update-notifier/lp1200044 into lp:update-notifier.

> === modified file 'data/update-motd-updates-available'
> --- data/update-motd-updates-available	2009-07-13 16:14:27 +0000
> +++ data/update-motd-updates-available	2013-07-11 01:59:28 +0000
> @@ -8,48 +8,32 @@
>      NEED_UPDATE_CHECK=yes
>  fi
>  
> -# check time when we did the last udpate check
> +# check time when we did the last update check
>  stamp="/var/lib/update-notifier/updates-available"
> -if [ -e "$stamp" ]; then
> -    stampt=$(stat -c %Y $stamp)
> -else
> -    stampt=0
> -fi
>  
>  # get list dir
>  StateDir="/var/lib/apt/"
>  ListDir="lists/"
> -eval $(apt-config shell StateDir Dir::State)
> -eval $(apt-config shell ListDir Dir::State::Lists)
> -
> -# check if we have a list file that needs checking
> -d="/$StateDir/$ListDir"
> -for f in $d/*; do
> -    # ignore dirs
> -    if [ ! -f $f ]; then
> -	continue
> -    fi
> -    t=$(stat -c %Y $f)
> -    if [ $t -gt $stampt ]; then
> -	NEED_UPDATE_CHECK=yes
> -    fi
> -done
> -
> -# check if sources.list was modified since last check
> +eval "$(apt-config shell StateDir Dir::State)"
> +eval "$(apt-config shell ListDir Dir::State::Lists)"
> +
> +# get sources.list file
>  EtcDir="etc/apt/"
>  SourceList="sources.list"
> -eval $(apt-config shell EtcDir Dir::Etc)
> -eval $(apt-config shell SourceList Dir::Etc::sourcelist)
> -if [ $(stat -c %Y "/$EtcDir/$SourceList") -gt $stampt ]; then
> +eval "$(apt-config shell EtcDir Dir::Etc)"
> +eval "$(apt-config shell SourceList Dir::Etc::sourcelist)"
> +
> +# check if we have a list file or sources.list that needs checking
> +if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -newer "$stamp" -print -quit)" ]; then
>      NEED_UPDATE_CHECK=yes
>  fi
>  
>  # output something for update-motd
>  if [ -n "$NEED_UPDATE_CHECK" ]; then
> -    echo "" > $stamp
> -    /usr/lib/update-notifier/apt-check --human-readable >> $stamp
> -    echo "" >> $stamp
> +    echo "" > "$stamp"
> +    /usr/lib/update-notifier/apt-check --human-readable >> "$stamp"
> +    echo "" >> "$stamp"
>  fi
>  
>  # output what we have (either cached or newly generated)
> -cat $stamp
> +cat "$stamp"
> 


-- 
https://code.launchpad.net/~anders-kaseorg/update-notifier/lp1200044/+merge/174093
Your team Ubuntu Core Development Team is requested to review the proposed merge of lp:~anders-kaseorg/update-notifier/lp1200044 into lp:update-notifier.



More information about the Ubuntu-reviews mailing list