Hi,

I've write a Python script (CheckPkgs.py) to check the presence of the files against the file list in each installed packages.
Note that it only checks if the file is there, not it's md5sum (and that's why it's very fast), but it's a beginning.
It writes out a log file (Missing_files.log) with all missing files according to package file list, along with the package name.
You must take in account that some packages, like nvidia erases some files after the installation, so the files don't match the package file list.

You'll need the python package. Just make the script executable (chmod +x
CheckPkgs.py) and run it.
It's not very elaborated, but I have no much time to invest in it anyway.
Maybe it could be of any value to anyone.

Armando

Jason Chu wrote:
On Tue, Mar 15, 2005 at 02:35:29PM -0500, Don Bostrom wrote:
  
Thanks for the info, now I know why I got that message.

But my original question remains, how can I verify if the files on my
harddrive actually match the files in the package?

Thanks,
-don-
    

Now that you mention it, there isn't really a way to do this.  You could
write a shell script that did it though.

Essentially it would uncompress the package from
/var/cache/pacman/pkg/$pkgname-$pkgver-$pkgrel.pkg.tar.gz into a temp dir
and start comparing md5s (or sha1s), ignoring files that are marked backup
(or maybe not and just mentioning they're marked as backup).

Jason


  

_______________________________________________ arch mailing list [email protected] http://www.archlinux.org/mailman/listinfo/arch
#! /usr/bin/python
# coding: latin-1

import os, sys
TamCons = 80

LogName = 'Missing_files.log'


def PrintInLine(obj, Tam=TamCons):
        """ Imprime sem mudan�a de linha.
        
                TamCons � o tamanho do console (padr�o 80) em colunas.
        """
        ValStr = str(obj)
        sys.stdout.write(ValStr + (Tam - 2 - len(ValStr)) * ' ' + '\r')
        sys.stdout.flush()


if __name__ == '__main__':
        FErro = file(LogName, 'w')
        Pacotes = os.popen('pacman -Qi').read().split('\n')
        Pacotes.sort()
        try:
                for Pacote in Pacotes:
                        if Pacote:
                                PrintInLine('..checking package %s' % Pacote)
                                Arquivos = os.popen('pacman -Ql %s' % 
Pacote.split()[0]).read().split('\n')
                                for Arquivo in Arquivos:
                                        if Arquivo:
                                                Arq = 
Arquivo[Arquivo.find('/'):]
                                                if (not os.path.isfile(Arq)) 
and (not os.path.isdir(Arq)) and (not os.path.islink(Arq)):
                                                        FErro.write('### %-30s: 
%s\n' % (Pacote, Arq))
        finally:
                FErro.close()
                PrintInLine('\n')
                raw_input('Done.')



_______________________________________________
arch mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/arch

Reply via email to