I'm unable to add jquery.min.js to clearcase w

2019-05-30 05:34发布

问题:

I'm trying to upload my project to clearcase repository using the eclipse plugin, but I'm having problems with jquery file, the minified version, jquery-1.7.min.js. When I try to upload it this is the error:

text_file_delta: Error: "/tmp/ccrctemp/tmp12564" is not a 'text file': it contains a line exceeding 8000 bytes. Use a different type manager (such as compressed file).

I guess that "/tmp/ccrctemp/tmp12564" is the jquery file. I've been looking for any solution on the Internet, but I only find solutions via command, I want to know how to solve it with eclipse plugin if there is any solution to this.

I'm using Rational ClearTeam Explorer 8.0.0

Thanks in advance.

Greetings.

UPDATE

I'm also having problems with empty files, Why I can´t upload empty files? Is there any way to upload it? I thought about modifying the file by typing a space, but maybe I need that empty file as it will be filled later.

Greetings.

回答1:

If the issue is related to the type manager which doesn't interpret the content of that specific file as text, you can cahnge its type:

 cleartool chtype compressed_file

See more with the IBM technote "Clearimport fails when importing text files that are seen as binary files into a VOB".
I detail this issue in "Clearcase issue while “add file to source control”".



回答2:

The file type is chosen/processed when the file is created. Once the file is created you can only change file type the cmd line tool. The most effective way of ensuring all file types are correct is by adding an entry to the ClearCase magic file (OK 2 entries) so the appropriate type is chosen when adding to source control.

minimized_javascript web_file script binary_delta_file : -printable & -name "*.[mM][iI][nN].[jJ][sS]";
minimized_javascript web_file script binary_delta_file : -name "*.[mM][iI][nN].[jJ][sS]" ;

These entries need to be processed AHEAD of the regular .js entries in the magic file when the file gets created.

If you are using ClearTeam Explorer and Web based views (CTE default), the changes need to made on the view server's magic file, not the local one.

Magic file ? What's that? Well, Rational does a terrible job of explaining it, but it is a very powerful mechanism for managing how CC handles files. Feel free to read:

About the ClearCase Magic file

About the MAGIC_PATH variable

Evaluating multiple magic files

Unfortunately, IBM was never able to provide me a clear answer what should be in the custom magic file: just the custom lines and no closure line or the custom plus all the lines from the default. So, we changed our MAGIC_PATH to:

MAGIC_PATH=/cc_store/vobstg/vobstore/magic:/opt/rational/clearcase/config/magic 

and added a copy w/custom lines ahead of the provided rules in the first path, which we called cc.magic. I suspect as long as you have no catch-all, it will process every *.magic path per the ordering rules until it finds a matching rule or catch-all.

They also failed to point out for the above to actually work in CC8 using CTE, you also need to modify the Websphere server file: /apps/infra/rational/SDLC/common/ccrcprofile/config/cells/dfltCell/nodes/dfltNode/servers/server1/server.xml

<environment xmi:id="Property_1387399742135" name="MAGIC_PATH" value="/cc_store/vobstg/vobstore/magic:/opt/rational/clearcase/config/magic" description="Setting req'd so CCRC web views can access MAGIC_PATH" required="false"/>

It is documented that under CC7, you needed to change the files: /var/adm/rational/common/rwp/conf/ ccrcweb.conf and ccrc.conf But CC8 of course comes w/standalone Webshpere, so the files are no longer there.

Of course, if you got this far, you probably realize you need write access to the view server ClearCase install to change these settings, in which case you also have access to run the command line tool cleartool.

And if you have command line access, here's a little command you can run against dynamic view to change all the files with the wrong settings:

cleartool find * -type f  -name "*.min.js" -element '! eltype(binary_delta_file)' -print |sed 's:@@::'  |   xargs -I {} cleartool chtype -force binary_delta_file {}