LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-03-2009, 11:52 PM   #1
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
Midnight Commander 4.6.2


ftp://lcpu.3322.org/pub/FileTools/mc...re-12.2.tar.gz

This source package is home-made, only for testing. The mc-4.6.2 has many improvements over 4.61.

FIXME: Could anyone help with extending the iconv commands in the SlackBuild script to other languages? With the utf8 patch, mc (especially mcedit) works properly only in utf8 terminals. So the hint file should be converted to utf8.
 
Old 02-05-2009, 12:38 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
That's a really, really slow link there... maximum speed of about 1.1KB/s.
Don't you have a small diff with the changes you've made? Or another server you can upload to?
 
Old 02-05-2009, 01:14 PM   #3
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
Besides the attached stuff, I also repacked the official source in order to:
1. Change recursively the owner/group to root/root, remove write permissions for group/others.
2. Use bzip2 compression.

Many source packages, bash and mc for example, contain files owned by non-root UIDs. This is very dangerous because those UIDs are usually automatically chosen by the developers' system. There is a high risk that the same UIDs are present in the end-user's system. If the administrator runs the SlackBuild script, corresponding users can then open the source files during unpack and plant backdoors into the software.

Patrick says everyone who runs SlackBuild scripts must have a dedicated build server. This is impractical in some way. So I postfixed the TMP variable with a mode 700 directory in the SlackBuild script. I suggest that every newly written SlackBuild script do this to ensure security.
Attached Files
File Type: txt mc-4.6.2-patch_and_SlackBuild.tar.gz.uue.txt (74.3 KB, 33 views)

Last edited by guanx; 02-07-2009 at 04:01 AM.
 
Old 02-05-2009, 01:16 PM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Really bad server -downloads begin after about 30 seconds and then proceed for about 45 seconds before stalling again. I've stopped and restarted the download about 7 times now and have gotten a total of 340KB transferred. I've only persisted because I am flat-out crazy -more sane folks wouldn't last so long, so if you plan to get feedback you need to find a more efficient way to transfer your info. I'm really not even sure what I'm supposed to be downloading. Are these altered sources? If so, simply clean them up ba running 'make distclean' in them, then change the name of the folder so it is not the original name. Then unpack the original sources right beside them and create a diff of the dirs by running something like this:
diff -pruN original-dir your-dir > my-changes.diff
Then post the diff here (in CODE tags) or offer to email it anyone who might be interested in helping.
 
Old 02-05-2009, 01:24 PM   #5
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by gnashley View Post
Really bad server -downloads begin after about 30 seconds and then proceed for about 45 seconds before stalling again. I've stopped and restarted the download about 7 times now and have gotten a total of 340KB transferred. I've only persisted because I am flat-out crazy -more sane folks wouldn't last so long, so if you plan to get feedback you need to find a more efficient way to transfer your info. I'm really not even sure what I'm supposed to be downloading. Are these altered sources? If so, simply clean them up ba running 'make distclean' in them, then change the name of the folder so it is not the original name. Then unpack the original sources right beside them and create a diff of the dirs by running something like this:
diff -pruN original-dir your-dir > my-changes.diff
Then post the diff here (in CODE tags) or offer to email it anyone who might be interested in helping.
Please see the attachment above. I did not know it was so slow for ftp. I often login to Cologne through that server. Maybe wget can work better than the traditional ftp program.
 
Old 02-05-2009, 03:53 PM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Okay, that's a lot better. I did try using wget with the original link but still was getting estinated times of several hours. Instead i found the original tarball from the mc site.
I wasn't able to get a clean compile though -probably because of my Slack-11-ish install which doesn't even include all the originals.
But, I did look into the language files, which seems to be what you wanted help with. Most of them are using iso8859 encoding, so
-f ISO_8859-X -t utf8
should work for most of them. You'll have to figure out exactly which iso-8859 variant is used for each of them though. I'm sure there is a way to get the info -the only list I know of that correlates the iso number with the language by name is the one in the kernel configuration. So, running 'make menuconfig' in the kernel sources and going to the codepage section may be helpful.

The regular english mc.hint and the Dutch(Nederlandisch) mc.hint.nl are in aSCII text.
These are probably all cyrillic
mc.hint.ru (Russian)
mc.hint.sr (Serbian)
mc.hint.uk (Ukrainian)
And the rest are probably using the iso set for western and central Europe. The problem is that using the file command only reports 'iso-8859 text' for all of them except english and dutch.
Sorry I can't be of more help. I've been working on several versions of mc lately. debian is using 4.6.2 but with a lot of patches which fix many things. You might do well to coordinate with that version -I saw that there were some problems with the utf8 patch -if anyone has fixed them it would surely be debian. Another possibility would be to coordinate your patches with the forked version:
mc-MP 4.1.x
This is a fork of an earlier version that still doesn't include all the glib2 and gnome dependency issues
The latest version is:
mc-4.1.40-pre9.tar.gz

You really might do best by investigating the debian version:
mc_4.6.2~git20080311
I just checked the debian patch and they are using the utf8 patch from mandriva since the other patch they had been using didn't work for some locales.
 
Old 02-05-2009, 04:50 PM   #7
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
Thank you! Gnashley. Looking into "menuconfig" helps a lot.

I wish to know if the following list is correct:
Code:
mc.hint     iso8859-1   English
mc.hint.cs  iso8859-2   Czech
mc.hint.es  iso8859-3   Spainish
mc.hint.hu  iso8859-2   Hungarian
mc.hint.it  iso8859-1   Italian
mc.hint.nl  iso8859-1   Dutch
mc.hint.pl  iso8859-2   Polish
mc.hint.ru  koi8-r      Russian
mc.hint.sr  iso8859-5   Serbian
mc.hint.uk  koi8-u      Ukrainian
mc.hint.zh  big5        Chinese
The Debian community has done a lot for mc. Will it be better that they submit their patches to http://www.midnight-commander.org ? The mc developers are very active recently.

I don't have time to look into every patch, so only patches that are most valuable for me are applied. The patches come from various people. Only the iso9660 patch is from me.

I would base on the official source package in case the software branches like BSD (then I will be messed up).
 
Old 02-06-2009, 01:19 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
debian maintainers are very good about reporting fixes upstream to the original developers, so many of their fixes are probably getting incorporated in the main code. The three patches you are using applied with many errors against the git version that debian is using.

The last code submission for version 4.6.2 was on 2008-02-19. the next official submit was on 2008-12-18, so for most of 2008 nothing was done. Most of the new changes from that point on are by three new authors, one of whom is the debian maintainer for mc. so you can be pretty sure that most of the debian changes are going upstream. debian is alos good about using patches from other distros when they have done things right. As I mentioned, some fixes for the utf8 feature came from mandriva.

So, I'd definetly recommend you to use the latest sources that debian is using:
mc_4.6.2~git20080311.orig.tar.gz
Those are clean sources taken from the mc git repository. But, get the debian patch also:
mc_4.6.2~git20080311-4.diff.gz
When you apply that patch it will not patche the inetrnal files directly. Instead all the patches are placed in the debian/patches directory of the sources. That way you can choose which ones you want to use. they are even divided up into categories.

And, it is always helpful to have a good look at the debian/rules file and any others used for the build. In the case of mc, debian is using something called Colin's Build System which has a file called 'rocks' with some goodies in it like this:
Code:
iconv -f ISO-8859-1 -t UTF-8 mc.hint > tmp && mv tmp mc.hint && \
	iconv -f ISO-8859-1 -t UTF-8 mc.hlp > tmp && mv tmp mc.hlp && \
	iconv -f ISO-8859-1 -t UTF-8 mc.hint.es > tmp && mv tmp mc.hint.es && \
	iconv -f ISO-8859-1 -t UTF-8 mc.hlp.es > tmp && mv tmp mc.hlp.es && \
	iconv -f ISO-8859-1 -t UTF-8 mc.hint.it > tmp && mv tmp mc.hint.it && \
	iconv -f ISO-8859-1 -t UTF-8 mc.hlp.it > tmp && mv tmp mc.hlp.it && \
	iconv -f ISO-8859-1 -t UTF-8 mc.hint.nl > tmp && mv tmp mc.hint.nl && \
	iconv -f ISO-8859-2 -t UTF-8 mc.hint.cs > tmp && mv tmp mc.hint.cs && \
	iconv -f ISO-8859-2 -t UTF-8 mc.hint.hu > tmp && mv tmp mc.hint.hu && \
	iconv -f ISO-8859-2 -t UTF-8 mc.hlp.hu > tmp && mv tmp mc.hlp.hu && \
	iconv -f ISO-8859-2 -t UTF-8 mc.hint.pl > tmp && mv tmp mc.hint.pl && \
	iconv -f ISO-8859-2 -t UTF-8 mc.hlp.pl > tmp && mv tmp mc.hlp.pl && \
	iconv -f ISO-8859-5 -t UTF-8 mc.hint.sr > tmp && mv tmp mc.hint.sr && \
	iconv -f ISO-8859-5 -t UTF-8 mc.hlp.sr > tmp && mv tmp mc.hlp.sr && \
	iconv -f ISO-8859-5 -t UTF-8 mc.menu.sr > tmp && mv tmp mc.menu.sr && \
	iconv -f koi8-r -t UTF-8 mc.hint.ru > tmp && mv tmp mc.hint.ru && \
	iconv -f koi8-r -t UTF-8 mc.hlp.ru > tmp && mv tmp mc.hlp.ru && \
	iconv -f koi8-u -t UTF-8 mc.hint.uk > tmp && mv tmp mc.hint.uk && \
	iconv -f big5 -t UTF-8 mc.hint.zh > tmp && mv tmp mc.hint.zh
Tadaaa!
Hope this has helped you some more.
 
Old 02-07-2009, 03:53 AM   #9
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
Thank you! Gnashley, I have updated the attachment in post #3 of this thread. Now all the hint files are converted, and the TMP directory is now postfixed with "SlackBuild.$$". So there is no apparent security hole in the build process.

Last edited by guanx; 02-07-2009 at 03:54 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Midnight Commander help? masterross Linux - Software 3 01-22-2008 09:25 AM
midnight commander prevoo DamnSmallLinux 6 09-19-2004 04:26 PM
midnight commander archlyric Linux - Software 2 02-28-2004 02:04 AM
midnight commander enigma1 Linux - Software 6 12-10-2003 02:47 PM
Midnight Commander XPediTioN Slackware 2 07-12-2003 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration