You are not logged in.

#26 2008-04-13 21:41:04

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Find files that are not under pacmans control

Thanks guys smile


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#27 2008-04-15 16:52:40

solstice
Member
Registered: 2006-10-27
Posts: 235
Website

Re: Find files that are not under pacmans control

with the version of spider.007, i added /var/tmp to the filtered paths

Offline

#28 2008-04-15 19:17:15

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Find files that are not under pacmans control

solstice wrote:

with the version of spider.007, i added /var/tmp to the filtered paths

Of course you need to adjust that list to fit your configuration...

Offline

#29 2008-04-15 20:48:22

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Find files that are not under pacmans control

The temporary directory handling is not very safe! Use:

TMPDIR=`mktemp -d`
if [[ -z $TMPDIR ]] ; then
    echo "Could not create temporary directory." >&2
    exit 1
fi

And the end of the code should be:

# Clean up
[[ -n $TMPDIR ]] && rm $TMPDIR/{full,owned,owned_full} && rmdir $TMPDIR

exit 0

Let's reduce the risk of recursively deleting all our precious files wink

Offline

#30 2008-04-17 07:46:39

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Find files that are not under pacmans control

B wrote:

Any update on this? The link to the script is dead smile

It was gone for 1 day, my server got a new IP address smile

Offline

#31 2008-04-17 09:32:55

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,393
Website

Re: Find files that are not under pacmans control

It is looking good - brebs additions chages would be good....  As I said near the start of the thread, want to submit it to the pacman-dev list for inclusion in the pacman-contrib package?

Offline

#32 2008-04-18 08:14:42

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Find files that are not under pacmans control

The removal process is now a bit better; I will submit it to the pacman-dev list for possible inclusion in the pacman-contrib package

Offline

#33 2008-05-29 20:33:51

venky80
Member
Registered: 2007-05-13
Posts: 1,002

Re: Find files that are not under pacmans control

Is there any update on this?
Is it still safe to use?


Acer Aspire V5-573P Antergos KDE

Offline

#34 2008-05-29 22:21:21

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Find files that are not under pacmans control

Safe? This script (whichever version you'll use) just *prints* a list of files. What can be unsafe about that?

Of course, when you decide to delete some of those, you should know what you're deleting. But that's up to your own decision.

Offline

#35 2008-05-30 07:40:03

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Find files that are not under pacmans control

and what would you like to see updated? big_smile

By the way; my message to the mailinglist seems to got lost in /dev/null; no responses at all? How to get this script included in pacman-contrib?

Last edited by Spider.007 (2008-05-30 07:45:29)

Offline

#36 2008-05-30 08:34:38

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,393
Website

Re: Find files that are not under pacmans control

Spider.007 wrote:

By the way; my message to the mailinglist seems to got lost in /dev/null; no responses at all? How to get this script included in pacman-contrib?

Which mailing list did you send it to?  I don't remember seeing it and can't find it in the archives, so maybe it really did go to /dev/null!

Anyway, I have this on my list of scripts to add to pacman-contrib.  The best way to get it included is to send it inline to the pacman-dev mailing list where the pacman devs will probably make some additional comments before it is included.

Offline

#37 2009-04-26 03:11:39

venky80
Member
Registered: 2007-05-13
Posts: 1,002

Re: Find files that are not under pacmans control

is there any update on this?


Acer Aspire V5-573P Antergos KDE

Offline

#38 2009-04-26 03:18:21

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,393
Website

Re: Find files that are not under pacmans control

The script never actually made it to the pacman-dev list so has not been included in contrib yet.

Offline

#39 2009-04-26 17:39:06

venky80
Member
Registered: 2007-05-13
Posts: 1,002

Re: Find files that are not under pacmans control

Allan wrote:

The script never actually made it to the pacman-dev list so has not been included in contrib yet.

Do you think it will get added to the pacman-dev list?


Acer Aspire V5-573P Antergos KDE

Offline

#40 2009-04-27 02:46:58

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,393
Website

Re: Find files that are not under pacmans control

venky80 wrote:
Allan wrote:

The script never actually made it to the pacman-dev list so has not been included in contrib yet.

Do you think it will get added to the pacman-dev list?

I think you misunderstood.  pacman-dev is a mailing list were scripts can be sent for inclusion in contrib section of pacman (which is where the pacman-contrib package comes from).

Offline

#41 2009-05-29 04:48:40

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Find files that are not under pacmans control

Oh great thread, here is my version!

#!/bin/bash

IGNORE="^/lib/modules|^/usr/local|^/usr/src|^/usr/share/mime|^/usr/share/texmf-var"
SEARCH="/bin /etc /lib /opt /sbin /usr"

# search for regular files
comm -2 -3 <(find $SEARCH -type f | sort -u | egrep -v $IGNORE) <(pacman -Qlq | awk '$2 !~ "/$" {print $2}' | sort -u)

# search for symlinks
# comm -2 -3 <(find $SEARCH -type l | sort -u | egrep -v $IGNORE) <(pacman -Qlq | awk '$2 !~ "/$" {print $2}' | sort -u)

Offline

#42 2013-11-06 10:44:35

techlive
Member
Registered: 2009-05-02
Posts: 25

Re: Find files that are not under pacmans control

Really nice thread, Here I came up with an one linear command which does exactly want I want.


alias pacman-disowned="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/srv' -o -path '/proc' -o -path '/home' -o -path '/root' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman'  \) -prune -o -type f -print | sort -u) <(pacman -Qlq | sort -u)"


then, pacman-disowned will do.

Last edited by techlive (2013-11-06 10:45:46)

Offline

#43 2013-11-06 12:05:15

techlive
Member
Registered: 2009-05-02
Posts: 25

Re: Find files that are not under pacmans control

HERE are two revised one linear scripts.

Show dirs that don't belong to any package:

alias pacman-disowned-dirs="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type d -print | sed 's/\([^/]\)$/\1\//' | sort -u) <(pacman -Qlq | sort -u)"

Show files that don't belong to any package:

alias pacman-disowned-files="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type f -print | sort -u) <(pacman -Qlq | sort -u)"

Offline

Board footer

Powered by FluxBB