Issue 14032 - gnupatch and gnucp on Solaris?
Summary: gnupatch and gnucp on Solaris?
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: Sun Solaris
: P3 Trivial (vote)
Target Milestone: OOo 1.1 RC
Assignee: sander_traveling
QA Contact: issues@tools
URL:
Keywords:
Depends on: 15939
Blocks:
  Show dependency tree
 
Reported: 2003-05-02 17:06 UTC by pavel
Modified: 2003-08-08 14:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description pavel 2003-05-02 17:06:25 UTC
Hi,

I do not have those tools on Solaris:

oo@ultra:/> find . -name gnupatch 2>/dev/null
oo@ultra:/> find . -name gnucp 2>/dev/null       

oo@ultra:/> uname -a
SunOS ultra 5.8 Generic_108528-16 sun4u sparc SUNW,Ultra-5_10

Shouldn't we first check if those binaries exist before calling them?

I use this simple change to get over this:

-GNUCOPY=gnucp
-GNUPATCH=gnupatch
+GNUCOPY=cp
+GNUPATCH=/usr/local/bin/patch
Comment 1 pavel 2003-05-09 13:51:18 UTC
Sander, is it for you?
Comment 2 sander_traveling 2003-05-09 13:54:15 UTC
yes, we should get this fixed before beta2. 
Comment 3 pavel 2003-06-12 10:35:43 UTC
Sander,

what is the status of this?
Comment 4 pavel 2003-06-15 10:35:36 UTC
Hmm, odk/util/makefile.pmk uses $(GNUCOPY) -u. But standard cp does
not support -u. So I just removed it:

--- makefile.pmk~       Sat Jun 14 10:00:42 2003
+++ makefile.pmk        Sat Jun 14 10:00:44 2003
@@ -115,8 +115,8 @@
 MY_COPY=$(GNUCOPY)
 MY_COPY_RECURSIVE=$(GNUCOPY) -r
 .ELSE
-MY_COPY=$(GNUCOPY) -u
-MY_COPY_RECURSIVE=$(GNUCOPY) -urf
+MY_COPY=$(GNUCOPY)
+MY_COPY_RECURSIVE=$(GNUCOPY) -rf
 .ENDIF
 
 CONVERTTAGSCRIPT=$(SOLARENV)$/bin$/converttags.pl

Comment 5 Martin Hollmichel 2003-06-16 09:54:31 UTC
reassigned.
Comment 6 jsc 2003-06-16 13:52:59 UTC
$(GNUCOPY) is set in the build environment. It seems to be used in
other places too. In fact of this i will use gnucp and the options
exactly as i did it in this makefile. Removing of options is not a
good fix :-( I think gnucp is more a requirement for the build env and
should be documented (Sander?). I will not accept this patch, please
remove it.
Comment 7 pavel 2003-06-16 18:48:43 UTC
Reopen to reassign. That patch is not meant to be included in OOo. It
only whos how I solved it for my build. The issue is that:

"Shouldn't we first check if those binaries exist before calling them?"

as I said in the issue.

Comment 8 pavel 2003-06-16 19:05:43 UTC
Sander, please take it back :-)
Comment 9 pavel 2003-06-22 21:54:20 UTC
Sander, could you please comment on this?
Comment 10 sander_traveling 2003-06-22 22:17:47 UTC
so what we need to do is:

    a) make sure that gnucp and gnupatch are settable values like CC 
       (because people will have them in different places and 
       different names) 

    b) have test in configure that make sure that we are dealing with 
       the real things (so gnucp does support -u)

    c) update the requirements page

Comment 11 pavel 2003-06-22 22:38:18 UTC
Isn't it better to stick with the default cp and patch and get rid of
extra features like -u of GNU patch?

Don't get me wrong, I'm not against GNU (in fact I'm the developer of
Emacs and have @gnu.org address), but it would be much easier for
newcomers to compile on Solaris without that extra requirement.
Comment 12 sander_traveling 2003-06-22 22:46:45 UTC
Sort of yes - but really only if the people using -u actually stop
adding it back again and again so it isn't a continual struggle of
making it compile with solaris patch and cp again. 
Comment 13 pavel 2003-07-13 11:11:20 UTC
This is easily solved by reporting such thing to IZ and fixing them.

According to POSIX 1003.2, cp allows:

cp [-fip] source_file target_file
cp [-fip] source_file . . . target
cp -R [-fip] source_file . . . target
cp -r [-fip] source_file . . . target

Thus using -u is not POSIX compliant and as such must not be used!
Comment 14 sander_traveling 2003-07-15 04:22:45 UTC
there are now --with-gnu-patch and --with-gnu-cp options to configure, 

that allow one to specify the location of teh respective tools.

marking as closed 
 
Comment 15 pavel 2003-08-02 17:41:41 UTC
Hi,

dmake in python on Solaris with GNU patch in /usr/local/bin/patch and
configured with --with-gnu-patch=/usr/local/bin/patch:

oo:/mnt/hdc2/ultra/BuildDir/ooo_11rc3_src/solenv # grep ^GNUPATCH
../SolarisSparcEnv.Set.sh 
GNUPATCH="/usr/local/bin/patch"

cd ./unxsols4.pro/misc/build && cat ../../../Python-2.2.2.patch |
patch -b -p2 &
& touch so_patched_so_python
  Looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
  The next patch looks like a new-style context diff.
Malformed patch at line 1822:
patch: Line must begin with '+ ', '  ', or '! '.
dmake:  Error code 2, while making
'./unxsols4.pro/misc/build/so_patched_so_pyth
on'
---* TG_SLO.MK *---

solenv/inc/tg_ext.mk uses system patch on Solaris instead of GNUPATCH
when BSCLIENT is not TRUE:

.IF "$(BSCLIENT)"=="TRUE"
        +cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATCH_FILE_NAME) |
$(GNUPATCH) -f $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FI
LE)
.ELSE           # "$(BSCLIENT)"!=""
        +cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATCH_FILE_NAME) |
patch $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
.ENDIF          # "$(BSCLIENT)"!=""

I propose changing patch to GNUPATCH. Thus we will have almost the
same lines there. Can those be unified? I will use this patch
temporarily on Solaris:

--- ooo_11rc3_src.orig/solenv/inc/tg_ext.mk     Sat Aug  2 18:15:15 2003
+++ ooo_11rc3_src/solenv/inc/tg_ext.mk  Sat Aug  2 18:17:26 2003
@@ -218,7 +218,7 @@
 .IF "$(BSCLIENT)"=="TRUE"
        +cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATCH_FILE_NAME) |
$(GNUPATCH) -f $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FI
LE)
 .ELSE           # "$(BSCLIENT)"!=""
-       +cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATCH_FILE_NAME) |
patch $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
+       +cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATCH_FILE_NAME) |
$(GNUPATCH) $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
 .ENDIF          # "$(BSCLIENT)"!=""
 .ENDIF          # "$(GUI)"=="WNT"
 .ENDIF                 # "$(PATCH_FILE_NAME)"=="none" ||      
"$(PATCH_FILE_NAME)"==""


Comment 16 sander_traveling 2003-08-05 19:19:09 UTC
commited in 1.46.18.1 (rc3), reclosing
Comment 17 pavel 2003-08-08 14:07:24 UTC
Thanks!