zotero / styles-repo

Zotero styles page
http://www.zotero.org/styles
15 stars 12 forks source link

Too many styles? #6

Closed rmzelle closed 11 years ago

rmzelle commented 11 years ago

@dstillman, @adam3smith: @cpina just committed about 1500 new Elsevier dependents. Running one of my own bash scripts on OS X now gives the error style-qc.sh: line 42: /usr/bin/java: Argument list too long, and I assume the Zotero style repository scripts are running into a similar issue, since the number of styles indexed is stuck at 4,463, whereas we now have 5810 [sic] styles in the github repo.

cpina commented 11 years ago

If you send me the style-qc.sh I can probably provide a better way to handle this (instead of a *.csl that I suspect that it's doing).

rmzelle commented 11 years ago

The script: https://github.com/citation-style-language/utilities/blob/master/style-qc.sh It seems to fail on line 42, where Jing is supposed to validate all dependent styles.

http://www.linuxjournal.com/article/6060 has a few pointers on how to address this problem.

cpina commented 11 years ago

Hi, I've had a quick test with the styles-repo repository and I haven't encountered the problem and I haven't seen where the problem could occur.

I'm familiar with the problem, I just need to think how to solve (depends on each case).

cpina commented 11 years ago

I'm not a sysadmin but I think that this should work:

find ${pathCSLStyles} -maxdepth 1 -name '*.csl' -print0 | xargs -0 -n 500 java -jar ${pathJing} -c ${pathCSLSchema}
find ${pathCSLStyles}/dependent -maxdepth 1 -name '*.csl' -print0 | xargs -0 -n 500  java -jar ${pathJing} -c ${pathCSLSchema}

find prints all the file names and xargs gets it and executes java -jar ${pathJing} -c "500 hundred styles maximum". It will execute. If there are more than 500 hundred: will execute it again. An example: echo 1 2 3 4 5 | xargs -n 2 /bin/echo "This is one execution" (change the -n X to other numbers to understand it).

I believe that this is what you need. It works on my Debian.

dstillman commented 11 years ago
I assume the Zotero style repository scripts are running into a similar issue, since the number of styles indexed is stuck at 4,463, whereas we now have 5810 [sic] styles in the github repo

I suspect the page just hadn't updated yet—that doesn't happen instantaneously at the moment. It's at 5811 styles now.

rmzelle commented 11 years ago

Ah, okay. Carles, thanks for the pointer!