On Wed, Apr 27, 2005 at 10:02:27PM +0200, Francesco Riosa wrote:
> Brian Harring wrote:
> 
> >>>[snip]
> >>>      
> >>>
> >>Why you could not use ctime/mtime ? Isn't possible to make a check like
> >>you do now but only on a filtered by "mtime" list of ebuild ?
> >>A command like this
> >># find . -name "*.ebuild" -and -mtime "-7" -or -ctime "-7"
> >>    
> >>
> >Actually... nope. :)
> >You're forgetting about eclass changes, which can adjust metadata 
> >(deps) of an ebuild w/out the ebuild ever being modified...
> >~brian
> >  
> >
> right was forgotting that :P , what about something like this ?
> 
> HAS_MODIFIED_ECLASS=$( find /usr/portage/eclass/ -name "*.eclass" -and
> -ctime "-1" -mtime "-1" )
> if [[ -z  $HAS_MODIFIED_ECLASS ]] ; then
>   echo "Good, using faster method"   
>   find /usr/portage -name "*.ebuild" \
>   -and -mtime "-1" \
>   -or -ctime "-1" \
>   -exec something_here.sh
> else
>   find /usr/portage -name "*.ebuild" \
>   -exec something_here.sh
> fi
> 
> will save you often, eclasses are not so frequently updated ;-)
Actually... :)

bit easier, abusing portage's own functionality.

python -c $'
import portage, time
target=long(time.strftime("%s",time.gmtime())) - 24*60*60
pdb=portage.portdb
for cp in pdb.cp_all():
        for cpv in pdb.cp_list(cp):
                flagged=False
                try:    mtime, eclasses = 
pdb.aux_get(cpv,["_mtime_","INHERITED"])
                except SystemExit:      raise
                except: continue
                if mtime >= target:     flagged=True
                else:
                        try:
                                for e in eclasses.split():
                                        if pdb.eclassdb.eclasses[e][1] >= 
target:
                                                flagged=True
                                                break
                        except KeyError:        flagged=True
                if flagged:     print cpv
'

~brian

Attachment: pgpnSqLc1NhxJ.pgp
Description: PGP signature

Reply via email to