Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | psdk detection | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | porting | Reporter: | pavel | ||||||||
Component: | code | Assignee: | pavel | ||||||||
Status: | CLOSED FIXED | QA Contact: | issues@porting <issues> | ||||||||
Severity: | Trivial | ||||||||||
Priority: | P1 (highest) | CC: | curvirgo, issues, khirano, quetschke, t_ono | ||||||||
Version: | current | ||||||||||
Target Milestone: | OOo 2.0 | ||||||||||
Hardware: | All | ||||||||||
OS: | Windows, all | ||||||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||||||
Developer Difficulty: | --- | ||||||||||
Attachments: |
|
Description
pavel
2005-06-27 10:04:37 UTC
set target Sorry, there are no lineendings, so the head -n1 didn't work as expected. The following patch should fix this. Created attachment 27516 [details]
Patch for configure.in
Hi Pavel, just to make sure where the NULLs are can you post the output of: pavel@drogo:~> cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | head -n 1 | od -c OK, the registry entries end with NULL, so the following should work: PSDK_HOME=`cat /proc/registry/.../MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | head -n 1 | sed 's/\x00.*$//'` Accepting /xHH might not work with every sed, but is ok with cygwins sed. pavel@drogo:~> cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsof tSDK/InstalledSDKs/*/Install\ Dir|head -n 1|od -c 0000000 C : \ P r o g r a m F i l e s 0000020 \ M i c r o s o f t S D K \ \0 0000040 C : \ P r o g r a m F i l e s 0000060 \ M i c r o s o f t S D K \ \0 0000100 C : \ P r o g r a m F i l e s 0000120 \ M i c r o s o f t S D K \ \0 0000140 C : \ P r o g r a m F i l e s 0000160 \ M i c r o s o f t S D K \ \0 0000200 C : \ P r o g r a m F i l e s 0000220 \ M i c r o s o f t S D K \ \0 0000240 C : \ P r o g r a m F i l e s 0000260 \ M i c r o s o f t S D K \ \0 0000300 pavel@drogo:~> Hmm, looks like it doesn't work with my sed: pavel@drogo:~> cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2>/dev/null | head -n 1 | sed 's/\x00.*$//'; echo C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft SDK\ pavel@drogo:~> It only eat the final 0, not the zero's in the middle. But this works: pavel@drogo:~> cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsof tSDK/InstalledSDKs/*/Install\ Dir 2>/dev/null | sed 's/\x00/\x0a/g'|head -n 1 C:\Program Files\Microsoft SDK\ pavel@drogo:~> But there is another problem: # The 2005 PSDK has a trailing backslash PSDK_HOME=`echo $PSDK_HOME | $SED -n "s/\/$//p"` This make PSDK_HOME empty again. I currently use the attached patch. Created attachment 27527 [details]
the patch I use now
Created attachment 27542 [details]
Slightly different patch
The previous patch uses tr instead of sed for the 00 -> \n transformation. I have a slightly better feeling with this than using an undocumented feature in sed (that only sometimes works ;) ). The problem with the second sed command was somehow the quoting. Using ' instead of " made the original version work but I also prefer the version without -n. Oh, I just see that I kept the p in the second sed expression, it is not needed but doesn't hurt. Pavel: Do you have a build fix CWS at the moment? Otherwise I will create one for this patch. Committed to vq19. Please verify verified. close issue |