[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gNewSense-users] Proposal regarding KFV data batch handling

From: Brian Brazil
Subject: Re: [gNewSense-users] Proposal regarding KFV data batch handling
Date: Sat, 12 Jul 2008 11:43:57 +0100

On Thu, Jul 10, 2008 at 2:19 PM, Bake Timmons <address@hidden> wrote:
>     OK, I will install PmWiki, etc., play with some code, and post
>     whatever I think might be useful.  Thanks.
> This is a one-off thing, so there's no need to be fancy. Can the stats aggregation code collect a list of non-free files while it's doing the maths?

The attached perl script prints pathnames of non-free file entries
(i.e., entries that are 0% free) in KFV tables.  The following text
comes from a larger comment that started an earlier version of the

Looks like linux-ubuntu-modules is done, can you do a run and dump the output on the wiki somewhere?


Usage: filter-non-free-files [file of sorted path names]

Given gNewSense KFV table source on standard input, print on
standard output relative file paths corresponding to any table rows
specifying non-free files.  Such table rows are converted to regular
expressions(*) that are matched against a special file of sorted,
relative file paths.  A single optional argument can indicate the
location of the special file, otherwise the default value is

Here is an example of creating the special file:

$ find linux-ubuntu-modules-2.6.24_16.23/ | sort > ~/kernel-files

Here is an extended example of use:

$ find /var/www/wiki.d/ -mtime -1 -type f -exec cat '{}' ';' \
    | filter-non-free-files ~/kernel-files > to-remove-new
$ rm -fr $(cat to-remove-new)
$ touch removed \
    && cp removed removed-old \
    && sort --unique --merge removed-old to-remove-new > removed

The "removed" file in this case is a record of removed files and
could be included in a web page, for example.

(*) The reason for this conversion to regexps is because of the
ambiguity of the file path representation in the KFV wiki table
entries: "-" could stand for "_" or ".".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]