SliTaz SliTaz Forum

You are not logged in.

#1 2015-03-19 18:08:33

llev
Member
Registered: 2011-12-09
Posts: 568

Bugs in man

There's a problem with the web source of manpages: they are truncated!

For instance, compare [c]http://man.he.net/?topic=bash&section=1[/c] and

[c]http://linux.die.net/man/1/bash[/c]:

An example of what you get by "man bash" on lines 52-58:

[c]Bash also  interprets  a  number  of  multi-character  options.   These
       options  must  appear  on  the command line before the single-character
       options to be recognized.

              fully.
       --init-file file
       --rcfile file[/c]

Offline

#2 2015-03-29 20:36:46

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

Proposed patch:

[c]--- man.old     2015-03-29 18:19:38.659615501 +0200
+++ man.new     2015-03-29 21:53:08.168638227 +0200
@@ -20,6 +20,7 @@

local i
local SECTION
+local SECTIONS
local MSG
local TOPIC
local MAN_SECTION
@@ -75,10 +76,23 @@
        fi
done

-[ "x$SECTION" = "x" ] && SECTION="all"
-(wget -O - "http://mirror.slitaz.org/man/$SECTION/$TOPIC.html" || \
-       wget -O - "http://man.he.net/?topic=$TOPIC&section=$SECTION") 2> /dev/null | \
-       awk "BEGIN { s=0; n=0 } /<PRE>/ { s=1 } { if (s) { print; n++} } /<\/PRE>/ { s=0 } END { if (n == 0) print \"$(_ 'No manual entry for $TOPIC$MSG')\" }" | \
-       sed -e 's/<[^>]*>//g' -e 's/</</g' -e 's/>/>/g' -e 's/&/\&/g' | less -M
+if [ "$SECTION" = all ]
+then SECTIONS="1 2 3 4 5 6 7 8"
+else SECTIONS=$SECTION
+fi

+for SECTION in $SECTIONS
+do
+  URL=$( wget -q -O - http://man7.org/linux/man-pages/dir_all_alphabetic.html | \
+        sed -n -r "s%.*href=\"\./(man./.*html)\">$TOPIC\($SECTION\).*%\1%p" )
+  if [ -n "$URL" ]
+  then
+    wget -q -O - "http://man7.org/linux/man-pages/$URL" | \
+    awk "BEGIN {s=0} /headline/{s=1} /COLOPHON/{s=0} {if(s) print}" | \
+    sed -e 's%<span class="top-link">top</span>%%' -e 's/<[^>]*>//g' -e 's/</</g' \
+        -e 's/>/>/g' -e 's/&/\&/g' -e 's/ / /g' | less -M
+    exit 0
+  fi
+done
+_ 'No manual entry for $TOPIC$MSG'
exit 0[/c]
You'll notice that I removed the part referring to mirror.slitaz.org/man/, because it seems not to exist. I based this on man7.org which doesn't have an automated way to search across sections, but has a full list of pages from which the section is searched. (linuxcommand.org also has a database of manpages, but they are older and I found no single page listing all manpages available.)

edit: I tested this patch with busybox wget/awk/sed and with GNU versions.

Offline

#3 2015-03-29 23:14:20

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Bugs in man

Post this patch as an attachment in text file format.

Offline

#4 2015-03-30 12:59:45

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

You're right, I didn't notice the forum interpreted the html codes! Things like s/>/>/g look somehow dumb :-)

I'll post the attachment tonight (last time I tried to attach a text file it failed; if needed I'll attach a pdf!).

Offline

#5 2015-03-30 13:47:39

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Bugs in man

You can also paste the patch to paste.slitaz.org and post the snip url to the paste. I verified it doesn't interpret html code.

Offline

#6 2015-03-30 18:22:31

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

OK, let's try here first...

It fails ("denied mime"). Let me follow your link...

Here it is: http://snipurl.com/29t7sy4

Offline

#7 2015-03-31 14:19:30

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Bugs in man

Snip url link is intermittent.

http://is.gd/ezIaPX

The commit: http://hg.slitaz.org/slitaz-base-files/rev/27287c7c55c9

http://hg.slitaz.org/slitaz-base-files/raw-file/27287c7c55c9/rootfs/usr/bin/man

After slitaz-base-files is tagged and a commit to wok/slitaz-base-files/receipt VERSION=  matching the tag it will be in the slitaz-base-files tazpkg.

Offline

#8 2015-03-31 20:28:22

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

Thanks mojo. And sorry for the inconvenient snip url.

With your explanations I'm starting to understand the way it works. But if I look at a recent change to slitaz-base-files, namely the patch to libtaz.sh by Aleksej, I see no tagging here http://hg.slitaz.org/slitaz-base-files/, yet in wok there is this version change http://hg.slitaz.org/wok/rev/59881e1fbb5e . So it is possible to commit before tagging?

Offline

#9 2015-03-31 21:06:09

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Bugs in man

Hi llev,

Let me answer your question.

When you visit aforementioned page ( http://hg.slitaz.org/slitaz-base-files/rev/e9258bc4e858 ) and point your mouse over "Download tarball: bz2  gz" links (4th line from very top) you'll see download links:

http://hg.slitaz.org/slitaz-base-files/archive/e9258bc4e858.tar.bz2

Note changeset is:

slitaz-base-files changeset 265:e9258bc4e858

So, you can download any changeset (any state in the time of particular Hg repository).

Also, you can use short changeset number (265 here):

slitaz-base-files changeset 265:e9258bc4e858

http://hg.slitaz.org/slitaz-base-files/archive/265.tar.bz2

You'll get the same changeset.

And, of course, you can download some "selected" changesets:

http://hg.slitaz.org/slitaz-base-files/

like 5.6.5, 5.6.4 (small gray numbers).

http://hg.slitaz.org/slitaz-base-files/archive/5.6.5.tar.bz2

So, we can use any form of changesets in the SliTaz receipts: long number, short number, or tag.

Next. If you asked me, why I used short changeset number instead of tag, I answer you. There are several reasons.

[*]Tagging some changeset is a changeset too. It is make a visual mess if tagging is frequent.

[*]What tags (read: versions) mean? That we make a steps forward, of course. But, how should I name version next to 5.6.4? Maybe, 5.6.5, or 5.7, or 6? I don't know. We have no detailed roadmap to versions release.

[*]It is a simple bugfixing.

I should say, that it is not completely tag/version drop in the receipts. But I'll found it very handy to update packages receipts after bugfixing, or after implementing important feature.

Offline

#10 2015-04-01 01:45:39

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Bugs in man

So it is possible to commit before tagging?

Cook uses slitaz-base-files/receipt

WGET_URL="http://hg.slitaz.org/$PACKAGE/archive/$VERSION.tar.gz" to fetch the source tarball.

If version is not a valid changeset or tag number it is a dead link.

Compare time stamp:

Commit 265 to slitaz-base-files->               Sat Mar 28 16:54:21 2015 +0200 (3 days ago ago)

Commit 17878 to wok/slitaz-base-files/receipt-> Sat Mar 28 16:57:28 2015 +0200 (3 days ago ago)

I build packages for testing with Version="tip" which always pulls the current revision.

Offline

#11 2015-04-01 08:39:31

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

Hi,

Thanks for the lesson! Now the long/short changeset, version, and tag stuff is clear. At first I thought there was a new policy in version numbers, from "old" x.y.z to a "new" sequencial numbering N, N+1...

@ Aleksej, I agree this is simpler. You could also have named it 5.6.4.1 ;-)

As for the roadmap I think distros usually change "z" for bugfixes, "y" for feature additions, and "x" for major reworks (like the one you did to Tazpanel, maybe).

Offline

#12 2015-04-01 14:14:12

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Bugs in man

Hi mojo,

I can't understand what is wrong with timestamps. It's common development loop:

[*]Fix bugs or add feature;

[*]Update receipt;

[*]Make new package;

[*]Make new ISO.

And you can see that new packages cook well on cook.slitaz.org, and new ISO is free from old bugs on mirror1.slitaz.org.

Version="tip" has not only pros but cons also. You should re-make package manually (cooker makes new package if receipt is changed).

Hi llev,

Yes, it looks like 5.7. Looks like pre-5.7. Because it has bugs and known underworks. So, maybe. Don't know.

Offline

#13 2015-04-01 14:54:41

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

Hi Aleksej,

I think mojo didn't mean there's something wrong. He just showed me that the commit to wok was indeed posterior to the commit to slitaz-base-files!

Offline

#14 2015-04-01 16:27:00

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Bugs in man

Ah, understand now smile

It was not the question for me, it was some sort of

> quote.

Offline

#15 2015-10-09 09:44:21

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

Tiny patch removing explicit calls to busybox (now unneeded) from modules:

http://paste.slitaz.org/?9df73306d3480060#UdGV7/hVOip8lE0OSbOl9yL8Si1uUzxKaRDuBvr3jNw=

(Sorry for long URL, "shorten URL" did not work, snipurl.com gave a 404.)

Offline

#16 2015-10-09 10:27:08

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Bugs in man

Hi llev,

This topic is for "man" command smile

Anyway, "tazpkg" problems you described are now fixed: http://hg.slitaz.org/tazpkg/rev/8a73a58ed3cb

Download: http://cook.slitaz.org/cooker.cgi?download=tazpkg-test-846.tazpkg

Thank you!

Offline

#17 2015-10-09 12:24:56

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Bugs in man

Ahem, wrong thread ;-)

I had two open Tazweb windows and typed in the wrong one!

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.56 MiB (Peak: 1.77 MiB) ]