[Labs-l] [tools] New version of take

Petr Bena benapetr at gmail.com
Sun Jun 23 17:19:04 UTC 2013


 Just since I noticed that you started changing the original version,
I list all features of this new take

-- it properly handle * arguments (this is a bug in current version)

petrb at toolsbeta-login:~$ ls
05-role-role--labs--tools--bastion  40-infrastructure-banner-beta  log
             qdisplay        result.e2   result.o3   take.deb
100-webproxy.conf                   apache2
logsplitter      qtop            result.e3   result.o4   task
100-webserver.conf                  bin
Mail             replica.my.cnf  result.e4   result.out
toolsbeta.wmflabs.org.key
2                                   linux-3.9.7
motd             request.pem     result.err  suphp.conf
toolsbeta.wmflabs.org.pem
40-bastion-banner                   linux-3.9.7.tar.xz
php-wrapper      result          result.o1   sv          toolwatcher
40-infrastructure-banner            list
proxy_html.conf  result.e1       result.o2   take        xx


new version

petrb at toolsbeta-login:~$ take *
ERROR: File /home/petrb/motd contains more than 1 hardlink
ERROR: Not taking the ownership of /home/petrb/motd because you don't
meet the requirements

old version
petrb at toolsbeta-login:~$ ./take *
mo2: will only touch files with no hardlinks
linux-3.9.7: No such file or directory
linux-3.9.7.tar.xz: No such file or directory
list: No such file or directory
logsplitter: No such file or directory
Mail: No such file or directory
motd: No such file or directory
php-wrapper: No such file or directory
proxy_html.conf: No such file or directory
qdisplay: No such file or directory
qtop: No such file or directory
replica.my.cnf: No such file or directory
request.pem: No such file or directory
result: No such file or directory
result.e1: No such file or directory
result.e2: No such file or directory
result.e3: No such file or directory
result.e4: No such file or directory

and many more errors

-- it contains -v (--verbose)

-- it contains -h (--help)

-- it contains --version

-- it display usage by default if you don't provide any argument

-- it display more verbose errors (--verbose can also help you find
out where the problem happened)

-- it display results in numbers (with -v) it show how many files were
successfully processed vs how many failed

-- it contains Makefile

-- it contains a script which build & package it for easy deployment

-- it allows you to recursively change a group as well, this may be
useful in some cases, especially when you are using take in other way
(using it as user and overtaking files produced by tool)



On Sun, Jun 23, 2013 at 5:44 PM, Platonides <platonides at gmail.com> wrote:
> On 23/06/13 09:04, Petr Bena wrote:
>>
>> Purpose of the struct is that if I forgot to close some FD it would
>> get automagically closed once the object is destroyed (it's created on
>> stack, so once it get removed from stack it get auto-closed)
>>
>> your change is correct, I should have make sure that closing it
>> multiple times doesn't cause troubles, however I don't see where I am
>> closing it three times?
>
>
> Once by FD.Close()
> Twice by FD destructor
> Thrice by destructor of the FD copy created when passed by copy into child
> function.
>
>
> Yes, I supposed so, but you are correctly closing the fds, and the object is
> adding more headaches than the risk that you leaked the fd (which would have
> been easy to detect).
>
>
> _______________________________________________
> Labs-l mailing list
> Labs-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/labs-l



More information about the Labs-l mailing list