LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cvs (https://www.linuxquestions.org/questions/linux-newbie-8/cvs-829924/)

fernfrancis 09-02-2010 06:49 AM

cvs
 
i am trying to upload project to a cvs repository installed on centos 5.4
the problem i am facing is that certain folders from the repository dont get uploaded to the cvs
i dont know the exact reason why?
i checked the permission on the folder and the file under the hierarchy but there was no issue , all other projects were sucessfully uploaded
can anyone tell me the cause of this and how to solve such a situation

tronayne 09-02-2010 08:55 AM

Are there spaces in the directory (or file) names? That'll cause problems.

Do you have "garbage" directories or files in the source tree (these are fumble-finger "invisible" files that can get created). You can check whether there are any by doing ls -al | more. Been known to happen, causes havoc. You can also get to the parent directory and use find dirname -type f -print | more to see if there are any junk or unreadable files present (that'll find blanks in names for you).

Are your directories mode 755 and your files mode 644? Do you own 'em? For initial import it's "safest" to use those modes and change them later to read-only (restricting users from making changes without committing).

Just in case, if you do have spaces in directory or file names, this will fix them for you (the spaces are changed to underscore):
Code:

cat blank-rename.sh
#!/bin/bash
#ident  "$Id$"
#
#      This program is free software; you can redistribute it and/or
#      modify it under the terms of version 2 of the GNU General
#      Public License as published by the Free Software Foundation.
#
#      This program is distributed in the hope that it will be useful,
#      but WITHOUT ANY WARRANTY; without even the implied warranty of
#      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#      General Public License for more details.
#
#      You should have received a copy of the GNU General Public
#      License along with this program; if not, write to the Free
#      Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
#      MA 02111-1307, USA.
#
#      Name:          $Source$
#      Version:        $Revision$
#      Modified:      $Date$
#      Purpose:        Replace blanks in file names with underscores
#      Author:        Unknown
#      Date:          28 Feb 2010
#      $Log$

ONE=1                          # For getting singular/plural right (see below).
number=0                        # Keeps track of how many files actually renamed.
FOUND=0                        # Successful return value.

for filename in *              # Traverse all files in directory.
do
    echo "$filename" | grep -q " "        #  Check whether filename
    if [ $? -eq $FOUND ]                  #+ contains space(s).
    then
      fname=$filename                      # Yes, this filename needs work.                       
      n=`echo $fname | sed -e "s/ /_/g"`  # Substitute underscore for blank.                     
      mv "$fname" "$n"                    # Do the actual renaming.                             
      let "number += 1"                                                                           
    fi                                                                                           
done 

if [ "${number}" -eq "$ONE" ]                # For correct grammar.
then
        echo "${number} file renamed."
else
        echo "${number} files renamed."
fi

exit 0

Save the above as "blank-rename.sh" then "make blank-rename" and you've got a handy quick-fix utility.

Hope this helps some.

Tinkster 09-02-2010 01:16 PM

Have the files been added to the repository before you
tried to submit them?
Code:

man cvs
/^add


fernfrancis 09-05-2010 01:35 AM

No, I have just recieved the source code from a third party which need to be developed by our software team
i am trying to import this source code to the repository in the process three such folder in the source code does not get added to the repository , i check the permissions they seem to be fine, also there are no spaces in the folder name and no garbbage files

Tinkster 09-05-2010 02:21 AM

Please tell us HOW you're trying to "add" them to the
repository ...

fernfrancis 09-05-2010 02:29 AM

I am using these commands to import the new project to the cvs repo

cvs -d :pserver:"ffernandes"@"10.200.22.57":"/cvsroot/AACVS" login
cvs -d repository_path_name import name_of_project vendor_tag release_tag


using these two commands the project gets added to the repo but as i said certain folders dont get imported to the repository

tronayne 09-05-2010 08:44 AM

This may seem trivial but, essentially, what CVS does is copy your source tree to the repository tree; it makes entries in its log files and some other accounting stuff, but basically it's just a recursive copy of a directory tree.

So, try something (quick and easy): get into some directory where you've got some space and
Code:

cd /tmp                    (or wherever)
cp -pr source_directory .

and see if you've got a problem. You could use "-prv" to see the copy as it happens. If that fails, you've got a place to start looking in detail. You could also tar the source tree; e.g.,
Code:

cd /tmp
tar -cvf name.tar source_directory

If either of those don't work, they'll at least give you a hint why not.

This kind of stuff happens (especially with third-party source) when the source comes from a "foreign" operating system (like, say, Windows) where really screwy characters can get embedded in file names. I've seen back slants, carets (^), asterisks, vertical bars, you name it in some junk received from Windows boxes and most of those will really cause havoc on the Unix/Linux side of the world. I've also see stuff from Windows where the mode of files and directories is, well, really a problem. I've fixed those with a simple
Code:

cd dir
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

to put things in a sane condition. If either of those fail, you'll get an indication why so you can fix it.

CVS doesn't do anything exotic on import. If you don't get some folders, there's a good reason why not and it may just be one of the above that will tell you what to fix.

Hope this helps some.

Tinkster 09-05-2010 05:25 PM

Hmmm ... I guess what I was trying to say is this.

cvs doesn't allow you to add directories recursively.
You need to create the directories, then add the files
within those directories. Once they're added to the
repo you can THEN go and commit changes. If someone
created new local files, or new local directories you
need to make CVS aware of those with an explicit "add".

Code:

mkdir subdir
touch subdir/newfile.c
cvs add subdir
cvs add subdir/newfile.c
cvs commit -m "my new file" subdir/newfile.c


Cheers,
Tink


All times are GMT -5. The time now is 10:11 PM.