Date: Thu, 3 Feb 2005 00:04:18 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 520 ************************************************** Wednesday 02 February 2005 Number 520 ************************************************** Subjects for today 1 Re: Patching from a 'here document' : John Poltorak 2 Perl expertise wanted : John Poltorak 3 Re: Patching from a 'here document' : Steven Levine" 4 Re: SC_PAGESIZE and Innotek_libc : Dave Yeo" 5 Re: Perl expertise wanted : Dave Saville" 6 Re: Perl expertise wanted : John Poltorak **= Email 1 ==========================** Date: Tue, 1 Feb 2005 14:23:41 +0000 From: John Poltorak Subject: Re: Patching from a 'here document' On Tue, Feb 01, 2005 at 07:53:31AM -0500, Thomas Dickey wrote: > On Tue, 1 Feb 2005, John Poltorak wrote: > > > On Thu, Jan 27, 2005 at 03:19:02PM -0800, Steven Levine wrote: > >> Have you tried: > >> > >> patch args < >> patch goes here > >> EOF > > > The problem is that with an inline patch in a shell script the '$' symbol > > appears to be interpreted differently, ie as variable identifier. > > > > How do I escape the character so that it is interpreted literally? > > You add a quote (several choices) to the "EOF" in the first line, e.g. > > patch args << 'EOF' Many thanks for that handy tip - had no idea that could be done, and I suspect some other people may have learnt something too. It means I don't need alter my patch at all to be able to use it inline. > -- > Thomas E. Dickey > http://invisible-island.net > ftp://invisible-island.net -- John **= Email 2 ==========================** Date: Tue, 1 Feb 2005 15:32:20 +0000 From: John Poltorak Subject: Perl expertise wanted --ylee4SU0kCsFLcs8 Content-Type: text/plain; charset=us-ascii If anyone with any Perl expertise has a chnace to look at this, I'd be very grateful... I'm attaching a shell script which will download, patch, build and start webmin, so after you have started it, you need to fire up a browser and connect to:- http://127.0.0.1:10001/ then enter 'admin' for both userid and password. Near the top of the page you should see icons for Webmin and Servers and under Servers you should see an icon for PostgreSQL Database Server. What I'd like to know is why doesn't the Apache icon appear too. The appearance of a particular icon is supposed to be determine by the existance of the correct identifier in the os_support line of module.info file (if there is one) for a particular module. PostgreSQL doesn't have this line so appears. Apache does have this line and OS/2 should be appended to it, but it isn't being recognised. Can anyone point out why? -- John --ylee4SU0kCsFLcs8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="G:\\build_webmin" export REPOSITORY=/webm mkdir $REPOSITORY test -f $REPOSITORY/webmin-1.170-minimal.tar.gz || wget -Nc -t 1 -P $REPOSITORY http://heanet.dl.sourceforge.net/sourceforge/webadmin/webmin-1.170-minimal.tar.gz cd $REPOSITORY tar zxf webmin-1.170-minimal.tar.gz patch -p0 <<'EOF' diff -urbd webmin-1.170/miniserv.pl webmin/miniserv.pl --- webmin-1.170/miniserv.pl Sat Nov 13 03:59:56 2004 +++ webmin/miniserv.pl Sun Jan 23 20:41:22 2005 at at -1,6 +1,8 at at -#!/usr/local/bin/perl +#!/usr/bin/perl # A very simple perl web server used by Webmin +$ENV{PERL_SIGNALS} = "unsafe"; + # Require basic libraries package miniserv; use Socket; at at -423,8 +425,10 at at } # Split from the controlling terminal +if($^O !~ /os2/i) { if (fork()) { exit; } setsid(); +} # Close standard file handles open(STDIN, "$x/module.info done echo "OS/2 OS/2 4 OS/2 4 \$uname =~OS/2" >os_list.txt setup.sh $REPOSITORY/home --ylee4SU0kCsFLcs8-- **= Email 3 ==========================** Date: Tue, 01 Feb 2005 08:44:37 -0800 From: "Steven Levine" Subject: Re: Patching from a 'here document' In <20050201142341.B49 at warpix.org>, on 02/01/05 at 02:23 PM, John Poltorak said: >> patch args << 'EOF' >Many thanks for that handy tip - had no idea that could be done, and I >suspect some other people may have learnt something too. It means I don't > need alter my patch at all to be able to use it inline. John, I recommend you spend some quality time with the shell man pages. They are really the first place you should be looking. If the man pages are unclear then you should be really be asking for an explanation of the man pages. This will allow you to learn to understand the man documentation style. Also, I recommend if one set of man pages is not clear you compare them to the man pages of a similar shell. For example, the sh man pages say: <<[-]word After parameter and command substitution is done on word, the shell input is read up to the first line that literally matches the resulting word, or to an EOF. If, however, - is appended to <<: 1) leading tabs are stripped from word before the shell input is read (but after parame- ter and command substitution is done on word), 2) leading tabs are stripped from the shell input as it is read and before each line is compared with word, and 3) shell input is read up to the first line that literally matches the resulting word, or to an EOF. If any character of word is quoted (see ``Quoting,'' later), no additional processing is done to the shell input. If no characters of word are quoted: 1) parameter and command substitution occurs, 2) (escaped) \newlines are removed, and 3) \ must be used to quote the characters \, $, and `. The resulting document becomes the standard input. and the ksh man pages say: << [-]word The shell input is read up to a line that is the same as word, or to an EOF. No parameter substitution, com- mand substitution, or file name generation is per- formed on word. The resulting document, called a here-document, becomes the standard input. If any character of word is quoted, no interpretation is placed upon the characters of the document. Other- wise, parameter and command substitution occur, \NEW- LINE is ignored, and \ must be used to quote the char- acters \, $, `, and the first character of word. If - is appended to <<, then all leading tabs are stripped from word and from the document. Both are saying the same thing so you get to learn from both. HTH, Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.67 #10183 Warp4.something/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 4 ==========================** Date: Tue, 01 Feb 2005 15:17:02 -0800 From: "Dave Yeo" Subject: Re: SC_PAGESIZE and Innotek_libc On Fri, 28 Jan 2005 18:54:34 +0100, Knut St. Osmundsen wrote: > >Dave Yeo wrote: >> I see that SC_PAGESIZE is defined in unistd.h but doesn't exist in lib. >You also see that it's only defined #if __POSIX_VISIBLE >= 199309. It >looks like either unistd.h isn't included or __POSIX_VISIBLE isn't set >as exected. Someone reported another problem related to __POSIX_VISIBLE >being 0, so someone have to figure out why it's not set as expected - >it's probably a bug somewhere in the headers. I will not have time to >look at it for some time still, so if you wanna help start by inserting >the following statements between includes. >#if !__POSIX_VISIBLE ># error "POSIX_VISIBLE=0" >#endif >You might have to change the test, and perhaps add #include > at the top to see if it's correctly defined from the start of. Ok, __POSIX_VISIBLE is defined to 200112. sys/cdefs.h is included from sys/types.h. Seems that _SC_PAGESIZE was getting undefined by an obscure (to me) define XNO_SYSCONF, sorry for bothering you. Interestingly the only places with XNO_SYSCONF defined are in FreeBSD.cf NetBSD.cf (both older versions) and os2.cf Dave ps are you interested in SYS3171 in libc06b4.dll? **= Email 5 ==========================** Date: Wed, 02 Feb 2005 08:13:48 +0000 (GMT) From: "Dave Saville" Subject: Re: Perl expertise wanted On Tue, 1 Feb 2005 15:32:20 +0000, John Poltorak wrote: John Assuming that second to last line is being interpreted by the code you were asking about last week - You have a space in the uname part which might be causing the uname and the expression to be in two different array elements. Try \$uname=~OS/2 -- Regards Dave Saville **= Email 6 ==========================** Date: Wed, 2 Feb 2005 09:27:57 +0000 From: John Poltorak Subject: Re: Perl expertise wanted On Wed, Feb 02, 2005 at 08:13:48AM +0000, Dave Saville wrote: > On Tue, 1 Feb 2005 15:32:20 +0000, John Poltorak wrote: > > John > > Assuming that second to last line is being interpreted by the code you were > asking about last week - You have a space in the uname part which might be > causing the uname and the expression to be in two different array elements. > > Try \$uname=~OS/2 Whilst this may not be 100% accurate syntactcically it does result in the webmin config getting the values I expected. I don't think that any change in this element will make the Apache icon appear under Webmin. Did you try running the shell script by any chance? > -- > Regards > > Dave Saville > -- John