Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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.
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
Last edited by fernfrancis; 09-05-2010 at 02:23 AM.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.