[Libreoffice-qa] What should I do with a bug, where I got a file to test and can confirm it, but are not allowed to attach the file to the bug?

Christian Lohmaier lohmaier at googlemail.com
Fri May 2 03:46:43 PDT 2014


Hi Thomas, *,

On Thursday, May 1, 2014, Thomas Hackert
<thackert at nexgo.de<javascript:_e(%7B%7D,'cvml','thackert at nexgo.de');>>
wrote
>
> >
> > Oh, to be clear: Just randomly mailing documents to people is not
> > the way to go. Instead up show up on the #libreoffice-dev channel
>
> sigh ... Maybe I will find the time this weekend, and than I will
> try to join IRC.
>

No need to sigh - just meant as it is just not nice to just randomly mail
documents to people without asking first. That basically means "I expect
you to fix it, no matter how many other things you need to do" and that's
just not nice.
IRC just is easiest medium for quick feedback regarding this - you're not
forced to used IRC.


>
> [discus, disk or something else?]
>

Ring, CD, but not discus or disk - that is misleading. And write that it is
one with big radius, otherwise the screenshot in the bug doesn't make it
clear what is being talked about.
And no need to rewrite the comment again.


> >> It depends, how you do define "easily done" ... ;) They are named
> >> something like "U1.E1.001.odt" up to "U8.E1.001.odt" (not to
> >> forget a copyright and a copyright file for something else) ...
> >> :( I would not know an easy way to do this ... :(
> >
> > for file in *.odt; do cp -f my-one-sample.odt "$i"; done
> >
> > i.e. for each file U1.... whatever, it copies (and overwrites,
> > that's what the -f switch does) a single document, in this case
> > "my-one-sample.odt". over the file.
>
> I get an
> <quote>
> cp: cannot stat 'my-one-sample.odt': No such file or directory
> </quote>
> here ... :(
>

Well - that is the placeholder for the one filename you want to use.
Obviously I have no idea how you name your documents / how the documents in
the example are all called :-)

>
> > but it might just be a drawing shape.
> >
> > for file in *.odt; do zipgrep  'draw:type="ring"' "$file"
> > >/dev/null && echo "Ringshape in file $file"; done
>
> Again, only an error message:
> <quote>
> bash: syntax error near unexpected token `&&'
> </quote>
>

PS: - Just use a blank line - that makes it easier to parse quickly (at
least for me :-)) the lenghty "<quote>" isn't necessary.

And yes, it is a copy'n'paste error. the whole commans is meant to be put
on a single line.
And it is meant to be run from the directory where all the odts are -
otherwise the "*.odt" won't match anything.

for file in *.odt;

means get a list of all files with odt extension and run a loop with it.
For each file you encounter, assign the filename to the variable "file"

do zipgrep  'draw:type="ring"' "$file" > /dev/null && echo "Ringshape in
file $file"

means: for each file, run the command "zipgrep". Search for the
string 'draw:type="ring"' in the file named $file (that is where we reuse
the variable define in the previous part), and discard the output if it
matches (redirect stdout to /dev/null , that is the "> /dev/null" part.
content.xml has no linebreaks, and when the zipgrep matches, it would pint
a huuuuge line to the terminal that we're not interested in anyway. If
zipgrep did find something, then output the name of the file with the echo
statement.

&& means. If the previous command returned without error, then run the
second one.
|| would be the opposite: if the previous command returned with error (in
the case of zipgrep: string wasn't found), then run the second one.
; is the third way: No matter whether previous command was successful or
not, just run the second one anyway.

done

marks the end of the statement that should be repeated. so everything
between the "do" and "done" is executed for each file.

... :( First I thought, some kind of c&p errors with your commands,
> changed any quotation mark and inverted comma, but this does not
> solve the problem ... :( /me thinks, I should learn a little bit
> more of these Bash internals ... ;)
>

Wouldn't hurt to know some basic shell-scripting :-))

ciao
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice-qa/attachments/20140502/cdb30d1e/attachment.html>


More information about the Libreoffice-qa mailing list