Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Christopher Faylor
On Sun, Aug 06, 2006 at 08:26:11PM -0800, Shane wrote:
>> What's wrong with "cp -a" or "cp -r"?
>It only copied files that were directly under the source directory.  It
>didn't traverse the directories inside source recursively.  I did some
>searching and, I came up with a similar thread.  Finally the tar method
>was recommended in it too.  Please refer :
>http://lists.samba.org/archive/samba/1999-December/016328.html and it's
>follow-ups.

1999 archives in a non-cygwin mailing list?  No, thank you.

I have used "cp -a" and "cp -r" any number of times with success on
cygwin.  However, if cp is not working correctly, I'm sure the coreutils
maintainer would be interested in fixing it, if you have further
details.

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Shane
> What's wrong with "cp -a" or "cp -r"?
It only copied files that were directly under the source directory.
It didn't traverse the directories inside source recursively. I did some 
searching and,
I came up with a similar thread. Finally the tar method was recommended in it 
too.
Please refer : http://lists.samba.org/archive/samba/1999-December/016328.html 
and it's follow-ups.

Thanks and Regards
Shane


> -Original Message-
> From: [EMAIL PROTECTED]
> Sent: Sun, 6 Aug 2006 21:04:27 -0400
> To: cygwin@cygwin.com
> Subject: Re: Checking XCOPY Exit Value in Cygwin Bash
> 
> On Mon, Aug 07, 2006 at 06:52:40AM +0900, Shane wrote:
> >Christopher Faylor wrote:
> >>Is there some reason why you are not using "cp" to accomplish your
> >>task?  "cp --help" should provide you with all sorts of options for
> >>copying files.  You should be able to press "cp" into service for this.
>>> 
> >>Using DOS utilities and DOS paths for this type of thing is putting you
> >>on the fringes of support for Cygwin.  I really wouldn't recommend it.
> >>Clearly this is not such a Windows-specific problem that it outside of
> >>the capabilities of a UNIX solution.
>> 
> >My initial attempt was with cp.  But I didn't see a way of preserving
> >the original directory structure of the source dir,
> 
> What's wrong with "cp -a" or "cp -r"?
> 
> --
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:   http://cygwin.com/problems.html
> Documentation: http://cygwin.com/docs.html
> FAQ:   http://cygwin.com/faq/

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Christopher Faylor
On Mon, Aug 07, 2006 at 06:52:40AM +0900, Shane wrote:
>Christopher Faylor wrote:
>>Is there some reason why you are not using "cp" to accomplish your
>>task?  "cp --help" should provide you with all sorts of options for
>>copying files.  You should be able to press "cp" into service for this.
>>
>>Using DOS utilities and DOS paths for this type of thing is putting you
>>on the fringes of support for Cygwin.  I really wouldn't recommend it.
>>Clearly this is not such a Windows-specific problem that it outside of
>>the capabilities of a UNIX solution.
>
>My initial attempt was with cp.  But I didn't see a way of preserving
>the original directory structure of the source dir,

What's wrong with "cp -a" or "cp -r"?

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Shane

Christopher Faylor wrote:


Is there some reason why you are not using "cp" to accomplish your task?
"cp --help" should provide you with all sorts of options for copying files.
You should be able to press "cp" into service for this.

Using DOS utilities and DOS paths for this type of thing is putting you
on the fringes of support for Cygwin.  I really wouldn't recommend it.
Clearly this is not such a Windows-specific problem that it outside of
the capabilities of a UNIX solution.

  


My initial attempt was with cp. But I didn't see a way of preserving the 
original directory structure of the source dir,
inside the destination directory. XCOPY just seemed easier. Will have a 
go at 'cp' again.

Thanks and regards
Shane

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Shane

Igor Peshansky wrote:

As David said, cvs has an easy way of doing this (using "cvs diff" and
"patch"), which will also deal with local and checked in changes to the
same file (while your method won't).

  

Point taken. I will certainly look into it.

Did you happen to notice the mention of the "--keep-newer-files" tar
option in my original reply to you?  Just add that to the last "tar", and
you will only copy the files that were changed in your copy (presumably by
you) after the checked in version.

  

Yeah I saw that reply and I had tried it. There were two problems.
   1. New files will not be added to the build directory. It will say 
something like
 tar: ./Test/res/Test.manifest: Warning: Cannot stat: No such 
file or directory

 tar: Current `./Test/res/Test.manifest' is newer
  and the required manifest file is not copied into the build 
folder. So for the initial copy I have to
  use it without the --keep-newer-files, and for the subsequent 
copies I will have to use the --keep-newer-files.


   2. This is the real problem. That is getting an indication whether 
none of the files were updated or not. I want to proceed 
with the rest of the building script only if more than one files have 
been copied. I do not know how to get that using the tar 
command. I tried echoing the $? value but it gives 0 all the time. The 
source compiler can
detect if the sources were updated or not, on it's own, but 
there are a lot of projects in one Visual Studio
Solution (about 60), that I can't wait until all those projects 
have been parsed.
   I am using  
   while read amount ; do


if [ ${amount::1} != "0" ]; then
copied=true;
fi
done < copy.log
for that purpose.


MSDN apparently lies.  XCOPY for me returns non-zero on error, and 0 on
normal execution (no matter how many files were copied).
  
If that is the case, then there is no point in trying to check for the 
xcopy return value.
As a short term solution I will stick with my original XCOPY solution. 
But I will try to find out
what CVS, Make and the other tools have to offer. If there is a way of 
getting if files have been replaced using the

tar command, I will try to implement that into my solution.
Although I am fairly competent at programming in C/C++, this is my first 
attempt in writing a serious bash script,

and I must admit that I am both impressed and overwhelmed by it's power. :)

Thank you all for the help offered so far.
Regards
Shane


GET FREE 5GB ONLINE STORAGE - Safely store your documents, photos and music 
online!
Visit http://www.inbox.com/storage to find out more!

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: installer: select packages: text background color

2006-08-06 Thread Igor Peshansky
On Sun, 6 Aug 2006, Eric Blake wrote:

> > A display bug was introduced about a year ago in the "Select Packages"
> > screen of Cygwin's installer.  The text's background color is manually
> > set to white but the text's color relies upon the system's settings
> > for "Window Text."
>
> This bug was also reported about a year ago, and fixed about a year
> ago.  See http://cygwin.com/setup/snapshots/ for a snapshot with
> the fix incorporated, and then join the crusade to get the snapshot
> tested to the point that it can be released as the next stable version
> of setup.exe.

This would be a good sentiment if the setup snapshots on that page were
recent enough to warrant testing.  However, before we can start the above
crusade, we have to embark on a crusade for getting a more recent setup
snapshot out.  Max or Brian, would it be possible to produce one and post
it to setup/snapshots?  It's been overdue for a while (2.529 is 5 months
old).
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_Igor Peshansky, Ph.D. (name changed!)
 |,4-  ) )-,_. ,\ (  `'-'   old name: Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Christopher Faylor
On Sun, Aug 06, 2006 at 07:46:07AM -0800, Shane wrote:
>I am writing a automated build script for my project that will be run
>under cygwin.  I will copy my updated source files to the build
>directory and if there are updated files, the executables will be
>built.  To copy the source files, I had to use XCOPY since the
>directory structure should be preserved in the destination directory
>also.  To copy only the updated files, I used the /D switch for XCOPY.
>Now since I want to execute the source compile only if files in the
>build directory have been updated, I have to use the exit codes of
>XCOPY inside the script.  I tried checking the value of $! after
>executing XCOPY but it didnt work.  I couldn't find a solution in the
>internet too.  Currently I am piping the standard output to a file and
>checking if the number of files copied is 0 or not.  But I think this
>is not an elegant solution.  This is what I am doing now.

Is there some reason why you are not using "cp" to accomplish your task?
"cp --help" should provide you with all sorts of options for copying files.
You should be able to press "cp" into service for this.

Using DOS utilities and DOS paths for this type of thing is putting you
on the fringes of support for Cygwin.  I really wouldn't recommend it.
Clearly this is not such a Windows-specific problem that it outside of
the capabilities of a UNIX solution.

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Igor Peshansky
On Mon, 7 Aug 2006, Shane wrote:

> What I am trying to do is, checkout the source to the build directory
> and if there are any local changes in my working directory copy them to
> the build directory, build and do a test run from there. This is so that
> I can test my code before I do the actual check in.

As David said, cvs has an easy way of doing this (using "cvs diff" and
"patch"), which will also deal with local and checked in changes to the
same file (while your method won't).

> To Igor,
>   Your method worked perfectly for paths with spaces too. :)

It was designed to. :-)

> Now if only I had a way of detecting if files were updated or not.

Did you happen to notice the mention of the "--keep-newer-files" tar
option in my original reply to you?  Just add that to the last "tar", and
you will only copy the files that were changed in your copy (presumably by
you) after the checked in version.

> To Mark
>   I tried it again. Unfortunately echo $? gives 0 for both the cases of,
> number of files copied = 0 and, greater than 0.
>   The link I posted from MSDN
> http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true
> says that XCOPY returns 1 when there were no files to be copied.

MSDN apparently lies.  XCOPY for me returns non-zero on error, and 0 on
normal execution (no matter how many files were copied).

> So I guess I am back to square one. :(

There are quite a few POSIX and Unix tools that are much better for this
job than xcopy.  I'd say investing some time in a Unix tutorial now would
save you more effort in the long run.
HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_Igor Peshansky, Ph.D. (name changed!)
 |,4-  ) )-,_. ,\ (  `'-'   old name: Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: installer: select packages: text background color

2006-08-06 Thread Daniel Convissor
On Sun, Aug 06, 2006 at 06:46:52PM +, Eric Blake wrote:
> 
> This bug was also reported about a year ago, and fixed about a year
> ago.

Great, thanks.


> See http://cygwin.com/setup/snapshots/ for a snapshot with
> the fix incorporated, and then join the crusade to get the snapshot
> tested to the point that it can be released as the next stable version
> of setup.exe.

Tried it and the following errors came up:

vv
setup-2.529.exe - Application Error

The instruction at "0x78010adf" referenced memory at "0x". The 
memory could not be "read".

I then hit "cancel" to debug...
^^

vv
Just-In_Time Debugging

An exception 'Unhandled Win32 Exception' has occurred in 
setup-2.529.exe

However, no debuggers are registered that can debug this exception.
^^

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: installer: select packages: text background color

2006-08-06 Thread Eric Blake

> A display bug was introduced about a year ago in the "Select Packages" 
> screen of Cygwin's installer.  The text's background color is manually 
> set to white but the text's color relies upon the system's settings 
> for "Window Text."

This bug was also reported about a year ago, and fixed about a year
ago.  See http://cygwin.com/setup/snapshots/ for a snapshot with
the fix incorporated, and then join the crusade to get the snapshot
tested to the point that it can be released as the next stable version
of setup.exe.

-- 
Eric Blake

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: installer: select packages: text background color

2006-08-06 Thread Daniel Convissor
Greetings:

A display bug was introduced about a year ago in the "Select Packages" 
screen of Cygwin's installer.  The text's background color is manually 
set to white but the text's color relies upon the system's settings 
for "Window Text."

No one has noticed this change because most users have their "Window" 
background color set to white and their "Window Text" color set to 
black.  But, for people who have other preferences for their Windows 
Display options, like myself, this can cause problems.

For example, here's what I see when I run the installer:
http://www.analysisandsolutions.com/cygwin/cygwin.setup.png

Kind of hard to read the list of programs, eh? :)

To demonstrate that the "Window Text" is the color being used, I 
changed that setting to red in Control Panel | Display | Appearance:
http://www.analysisandsolutions.com/cygwin/cygwin.setup.red.png

Also note, that the "Window Text" color is being used for the text 
around the program listing, such as "Select packages to install" and 
"Hide obsolete and administrative packages" when it would be 
programatically more correct to use the "Message Box"/"Message Text" 
color.

Thanks,

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Shane

David Christensen wrote:

There are standard software development tools that solve the problems
you are facing -- CVS and Make:

http://ximbiot.com/cvs/wiki/index.php?title=Main_Page

http://ximbiot.com/cvs/wiki/index.php?title=Main_Page


Both are included in Cygwin.  In the long run, you'd be better off
investing in a basic to intermediate understanding of both rather than
hacking together custom scripts to implement a subset of their
functionality.

To David,
  Thank you for the tip. Actually I am using Visual Source Safe as the 
Source Management tool.
I was considering the use of CVS, but decided against at the last moment 
because most of the fellow developers including me, had been using VSS 
for a considerable amount of time, and felt that the migration from a 
VSS to CVS would take a some time. Similarly for Make. We are primarily 
a group of developers who are conversent with MS Windows than the Unix 
environment. Cygwin basically gives us the power of bash scripting and 
the "ease" of Windows at the same time. :)


What I am trying to do is, checkout the source to the build directory 
and if there are any local changes
in my working directory copy them to the build directory, build and do a 
test run from there. This is so that I can test my code before I do the 
actual check in.


To Igor,
  Your method worked perfectly for paths with spaces too. :) Now if 
only I had a way of detecting if files were updated or not.


To Mark
  I tried it again. Unfortunately echo $? gives 0 for both the cases 
of, number of files copied = 0 and, greater than 0.
  The link I posted from MSDN 
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true 
says that XCOPY returns 1 when there were no files to be copied.


So I guess I am back to square one. :(

Thanks and best regards
Shane


GET FREE 5GB ONLINE STORAGE - Safely store your documents, photos and music 
online!
Visit http://www.inbox.com/storage to find out more!

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread David Christensen
Shane wrote:
> I am writing a automated build script for my project that will be run
> under cygwin. I will copy my updated source files to the build
> directory and if there are updated files, the executables will be
> built. To copy the source files, I had to use XCOPY since the
> directory structure should be preserved in the destination directory
> also. To copy only the updated files, I used the /D switch for XCOPY.
> Now since I want to execute the source compile only if files in the
> build directory have been updated, I have to use the exit codes of
> XCOPY inside the script.

There are standard software development tools that solve the problems
you are facing -- CVS and Make:

http://ximbiot.com/cvs/wiki/index.php?title=Main_Page

http://ximbiot.com/cvs/wiki/index.php?title=Main_Page


Both are included in Cygwin.  In the long run, you'd be better off
investing in a basic to intermediate understanding of both rather than
hacking together custom scripts to implement a subset of their
functionality.


David


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Shane

Igor Peshansky wrote:

Nope, you didn't have to.  Something like

(cd "$2/.." && find "$2" -name "*.$1" | tar cfT - -) | tar xfC - "$3"

would do the job of "XCOPY /S" using POSIX means.

  
If you go POSIX, you can use the --keep-newer-files tar option.


  
Of course it didn't.  Please read a good bash tutorial, or the "Special

Parameters" section of the bash manpage.
  

Hi Igor and Mark,
   Thank you very much for the quick reply.

I was initially using 


tar -cf - `find "$source_dir" -name "*.$file_ext" -print` | ( cd "$dest_dir" && 
tar xBf - )

but it had a problem with path names with spaces. Obviously being not that good 
in bash scripting, I couldn't get over that issue. So that was why I decided to 
use the XCOPY command. I will use your method and see. Thanks again.

I made a silly mistake in my former email. I was actually checking $? 
(not $!) for the exit code, but it didn't work. But I saw in a later reply from 
Mark that it worked for him. I will check it again. Maybe I was doing something 
silly.

thanks again 
Regards

Shane


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: NTFS fragmentation

2006-08-06 Thread Charli Li
-Original Message-
>From: Robert Pendell
>Sent: Saturday, August 05, 2006 7:50 PM
>To: Cygwin Mailing List
>Subject: Re: NTFS fragmentation
>
>
>Vladimir Dergachev wrote:
> > Also, I tried the following experiment - found a 17 MB file in
>ibiblio.org and
>> downloaded it with Firefox. The file ended up fragmented into
>more than 200
>> pieces. Tried the same file with IE - no fragmentation.
>>
>> It could be, of course, that Firefox is compiled with cygwin,
>but I have not
>> found cygwin.dll anywhere in its installation directory.
>
>IE moves the files from your Temporary Internet Files to where your
>defined destination is once the download is complete.  Firefox however
>skips that and just writes it to the destination.  That is why you see
>the fragmentation in Firefox and not IE.  The move that IE does isn't
>always noticeable.  The box will only come up if it takes more than a
>few seconds but occasionally you see it say "Moving FILE from Temporary
>Internet Files to DEST" (replacing FILE and DEST as appropriate).  The
>message is probably different but you get the idea.
>
>--
>Robert Pendell
>[EMAIL PROTECTED]
>
>Thawte Web of Trust Notary
>CAcert Assurer
>

When you actually open the file using IE, it just downloads the file into
Temporary Internet Files and opens it.  But in Fx, it downloads it into the
preset folder, but when it is just about to open, it moves the file into the
temp folder (C:\Documents and Settings\cygwin\Local Settings\temp (replace
cygwin as your username), then opens it.
---
Sure, Fx is compiled USING cygwin but not using GCC.  The build is driven by
a makefile (using make) and configure (autoconf-2.13), but the tools are
Microsoft Visual C++ tools found in C:\Program Files\Microsoft Visual
Studio\VC\bin\.  Those tools are cl (compiler), link (linker), rc (resource
compiler), and vcvars32.bat (environment setup).

Charli


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Mark Fisher

On 8/6/06, Shane wrote:

Can you please provide me a way of checking the XCOPY exit code: reference 
[http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true]
 within Bash?


result codes are stored in $? in bash
success = 0 usually, and xcopy seems to follow the norm here.

here, i did
xcopy somefile somedir
echo $?

which returned 0

when i tried
xcopy nonfile somedir
echo $?

i get 4

so test for 0 for success.

extensions of this idea:
xcopy somefile somedir && echo ok
xcopy somefile somedir || echo fail

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Igor Peshansky
On Sun, 6 Aug 2006, Shane wrote:

> Hi all,

Hi.  .  Reading the one-line below
was extremely painful in the web archives.  See for yourself:
.

>I am writing a automated build script for my project that will be
> run under cygwin. I will copy my updated source files to the build
> directory and if there are updated files, the executables will be built.
> To copy the source files, I had to use XCOPY since the directory
> structure should be preserved in the destination directory also.

Nope, you didn't have to.  Something like

(cd "$2/.." && find "$2" -name "*.$1" | tar cfT - -) | tar xfC - "$3"

would do the job of "XCOPY /S" using POSIX means.

> To copy only the updated files, I used the /D switch for XCOPY.

If you go POSIX, you can use the --keep-newer-files tar option.

> Now since I want
> to execute the source compile only if files in the build directory have
> been updated, I have to use the exit codes of XCOPY inside the script. I
> tried checking the value of $! after executing XCOPY but it didnt work.

Of course it didn't.  Please read a good bash tutorial, or the "Special
Parameters" section of the bash manpage.

> I couldn't find a solution in the internet too.  Currently I am piping
> the standard output to a file and checking if the number of files copied
> is 0 or not. But I think this is not an elegant solution. This is what I
> am doing now.
>
> [script]
> copied=false
> # Helper Function
> copy_files()
> {
> echo copying *.$1 files in $2 to $3\\$2
> xcopy /DSYI $2\\*.$1 $3\\$2 | tee copy.log
>
> while read amount  ; do
> if [ ${amount::1} != "0" ]; then
> copied=true;
> fi
> done < copy.log
> }
> cd ../source
>
> copy_files h. ..\\build
> copy_files c. ..\\build
> copy_files cpp  . ..\\build
> rm -f copy.log
> ! $copied && echo "Files up-to-date. Skipping build" && exit 0
> cd ../build
> # Start the Build Process
> [/script]
>
> Can you please provide me a way of checking the XCOPY exit code:
> reference
> [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true]
> within Bash?

It's just like checking any other exit code in bash: reference "man bash".
HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_Igor Peshansky, Ph.D. (name changed!)
 |,4-  ) )-,_. ,\ (  `'-'   old name: Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Checking XCOPY Exit Value in Cygwin Bash

2006-08-06 Thread Shane
Hi all,
   I am writing a automated build script for my project that will be run 
under cygwin. I will copy my updated source files to the build directory and if 
there are updated files, the executables will be built. To copy the source 
files, I had to use XCOPY since the directory structure should be preserved in 
the destination directory also. To copy only the updated files, I used the /D 
switch for XCOPY. Now since I want to execute the source compile only if files 
in the build directory have been updated, I have to use the exit codes of XCOPY 
inside the script. I tried checking the value of $! after executing XCOPY but 
it didnt work. I couldn't find a solution in the internet too.  Currently I am 
piping the standard output to a file and checking if the number of files copied 
is 0 or not. But I think this is not an elegant solution. This is what I am 
doing now.

[script]
copied=false
# Helper Function
copy_files()
{
echo copying *.$1 files in $2 to $3\\$2
xcopy /DSYI $2\\*.$1 $3\\$2 | tee copy.log

while read amount  ; do
if [ ${amount::1} != "0" ]; then
copied=true;
fi
done < copy.log
}
cd ../source

copy_files h. ..\\build
copy_files c. ..\\build
copy_files cpp  . ..\\build
rm -f copy.log
! $copied && echo "Files up-to-date. Skipping build" && exit 0
cd ../build
# Start the Build Process
[/script]

Can you please provide me a way of checking the XCOPY exit code: reference 
[http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true]
 within Bash?

Thank you for your time.
Shane

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: [ANNOUNCEMENT] clisp-2.39-1 released

2006-08-06 Thread Reini Urban

Dr. Volker Zell schrieb:

Reini Urban writes:


> I've taken over clisp maintainance from Sam Steingold, who lost access
> to his windows box and to this list. Thanks Sam for a wonderful job
> anyway!
> clisp-2.39-1 is now built with cygport, but you can still compile it
> with ./configure; make; make install also.

> ./configure --fsstnd=redhat --with-dynamic-ffi  \
>--with-module=rawsock --with-module=dirkey  \
>--with-module=bindings/win32 --with-module=berkeley-db \
>--with-module=pcre --with-module=postgresql \
>--with-module=fastcgi --prefix=/usr --build build

What about the zlib module, it used to be included in the last version.


Yes, you are right. I missed that.

$ clisp -q -E 1:1 -K full -norc -x '*FEATURES*'
(:FASTCGI :POSTGRESQL :PCRE :BERKELEY-DB :DIRKEY :RAWSOCK :READLINE 
:REGEXP :SYSCALLS :I18N :LOOP :COMPILER :CLOS :MOP
 :CLISP :ANSI-CL :COMMON-LISP :LISP=CL :INTERPRETER :SOCKETS 
:GENERIC-STREAMS :LOGICAL-PATHNAMES :SCREEN :FFI :GETTEXT

 :UNICODE :BASE-CHAR=CHARACTER :PC386 :UNIX :CYGWIN)

Furthermore setup.hint is also wrong, because I listed it there.
Will be updated ASAP.
I'll update the automatic README and setup.hint creation also.
--
Reini

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: running cygwin bash scripts from apache

2006-08-06 Thread Robert Mark Bram
Thank you Rene and Max for your replies.

Rene's response did the trick:

> Did you put the script in Apache's cgi-bin directory? 

Once I put it there, the script works ok. Much to my relief.

Thanks for the tip that I can configure Apache to run scripts from other places
to - that might come in handy later.

> Are you using the Apache packaged with Cygwin, or some other 
> Windows Apache? And, what version of Apache?

Max, I have Apache 2.0.55 for Windows installed - I thought I needed the Cygwin
version, but it turns out the Windows version is still ok to run Bash scripts as
long as it has the right shebang line.

Thank you both!

Rob
:)



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/