# HG changeset patch # User Oleksandr Gavenko # Date 1280346732 -10800 # Node ID 63b568f99e3c2d6bfc32163e5a09cec1d6718bcf # Parent 1e9048a10b95ff00cb075af1a8c612953258baad Install manually Midnight Commander ini files as for Cygwin and Debian available different utilities. diff -r 1e9048a10b95 -r 63b568f99e3c .mc/bindings.cygwin --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.mc/bindings.cygwin Wed Jul 28 22:52:12 2010 +0300 @@ -0,0 +1,322 @@ +# Midnight Commander 3.0 extension file +# Warning: Structure of this file has changed completely with version 3.0 +# +# All lines starting with # or empty lines are thrown away. +# Lines starting in the first column should have following format: +# +# keyword/descNL, i.e. everything after keyword/ until new line is desc +# +# keyword can be: +# +# shell (desc is, when starting with a dot, any extension (no wildcars), +# i.e. matches all the files *desc . Example: .tar matches *.tar; +# if it doesn't start with a dot, it matches only a file of that name) +# +# regex (desc is an extended regular expression) +# Please note that we are using the GNU regex library and thus +# \| matches the literal | and | has special meaning (or) and +# () have special meaning and \( \) stand for literal ( ). +# +# type (file matches this if `file %f` matches regular expression desc +# (the filename: part from `file %f` is removed)) +# +# directory (matches any directory matching regular expression desc) +# +# include (matches an include directive) +# +# default (matches any file no matter what desc is) +# +# Other lines should start with a space or tab and should be in the format: +# +# keyword=commandNL (with no spaces around =), where keyword should be: +# +# Open (if the user presses Enter or doubleclicks it), +# +# View (F3), Edit (F4) +# +# Include is the keyword used to add any further entries from an include/ +# section +# +# command is any one-line shell command, with the following substitutions: +# +# %% -> % character +# %p -> name of the current file (without path, but pwd is its path) +# %f -> name of the current file. Unlike %p, if file is located on a +# non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs, +# then the file will be temporarily copied into a local directory +# and %f will be the full path to this local temporal file. +# If you don't want to get a local copy and want to get the +# virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then +# use %d/%p instead of %f. +# %d -> name of the current directory (pwd, without trailing slash) +# %s -> "selected files", i.e. space separated list of tagged files if any +# or name of the current file +# %t -> list of tagged files +# %u -> list of tagged files (they'll be untaged after the command) +# +# (If these 6 letters are in uppercase, they refer to the other panel. +# But you shouldn't have to use it in this file.) +# +# +# %cd -> the rest is a path mc should change into (cd won't work, since it's +# a child process). %cd handles even vfs names. +# +# %view -> the command you type will be piped into mc's internal file viewer +# if you type only the %view and no command, viewer will load %f file +# instead (i.e. no piping, so it is different to %view cat %f) +# %view may be directly followed by {} with a list of any of +# ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for +# text using backspace for bold and underscore) and unform +# (no highlighting for nroff sequences) separated by commas. +# +# %var -> You use it like this: %var{VAR:default}. This macro will expand +# to the value of the VAR variable in the environment if it's set +# otherwise the value in default will be used. This is similar to +# the Bourne shell ${VAR-default} construct. +# +# Rules are applied from top to bottom, thus the order is important. +# If some actions are missing, search continues as if this target didn't +# match (i.e. if a file matches the first and second entry and View action +# is missing in the first one, then on pressing F3 the View action from +# the second entry will be used. default should catch all the actions. +# +# Any new entries you develop for you are always welcome if they are +# useful on more than one system. You can send your modifications +# by e-mail to mc-devel@gnome.org + + +### Archives ### + +# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk +regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$ + Open=%cd %p#utar + View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf - + +regex/\.tar\.bz$ + # Open=%cd %p#utar + View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf - + +regex/\.t(ar\.bz2|bz|b2)$ + Open=%cd %p#utar + View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf - + +# .tar.F - used in QNX +regex/\.tar\.F$ + # Open=%cd %p#utar + View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf - + +# .qpr/.qpk - QNX Neutrino package installer files +regex/\.(qp[rk])$ + Open=%cd %p#utar + View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf - + +# tar +regex/\.(tar|TAR)$ + Open=%cd %p#utar + View=%view{ascii} tar tvvf - < %f + +# lha +type/^LHa\ .*archive + Open=%cd %p#ulha + View=%view{ascii} lha l %f + +# arj +regex/\.a(rj|[0-9][0-9])$ + Open=%cd %p#uarj + View=%view{ascii} arj l %f + +# ha +regex/\.([Hh][Aa])$ + Open=%cd %p#uha + View=%view{ascii} ha lf %f + +# rar +regex/\.[rR]([aA][rR]|[0-9][0-9])$ + Open=%cd %p#urar + View=%view{ascii} rar v -c- %f + +# cpio +shell/.cpio.Z + Open=%cd %p#ucpio + View=%view{ascii} gzip -dc '%f' | cpio -itv 2>/dev/null + +shell/.cpio.gz + Open=%cd %p#ucpio + View=%view{ascii} gzip -dc '%f' | cpio -itv 2>/dev/null + +shell/.cpio + Open=%cd %p#ucpio + View=%view{ascii} cpio -itv <'%f' 2>/dev/null + +# ls-lR +regex/(^|\.)ls-?lR(\.g?z|Z|bz2)?$ + Open=%cd %p#lslR + +# patch +regex/\.(diff|patch)(\.(bz2|gz|Z))?$ + Open=%cd %p#patchfs + +# ar library +regex/\.s?a$ + Open=%cd %p#uar + #Open=%view{ascii} ar tv %f + View=%view{ascii} file %f && nm %f + +# trpm +regex/\.trpm$ + Open=%cd %p#trpm + View=%view{ascii} rpm -qivl --scripts `basename %p .trpm` + +# RPM packages (SuSE uses *.spm for source packages) +regex/\.(rpm|spm)$ + Open=%cd %p#rpm + View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f + +# deb +regex/\.u?deb$ + Open=%cd %p#deb + View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f + +# dpkg +shell/.debd + Open=%cd %p#debd + View=%view{ascii} dpkg -s `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'` +# apt +shell/.deba + Open=%cd %p#deba + View=%view{ascii} apt-cache show `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'` + +# ISO9660 +regex/\.iso$ + Open=%cd %p#iso9660 + View=%view{ascii} isoinfo -l -i %f + +# 7zip archives (they are not man pages) +shell/.7z + View=%view{ascii} 7za l %f 2>/dev/null + + +### Documentation ### + +# Texinfo +regex/\.(te?xi|texinfo)$ + +# GNU Info page +type/^Info\ text + Open=info -f %f + +shell/.info + Open=info -f %f + +# Manual page +# Exception - .so libraries are not manual pages +regex/\.(so|so\.[0-9\.]*)$ + View=%view{ascii} file %f && nm %f + +regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$ + Open=case %d/%f in */log/*|*/logs/*) cat %f ;; *) nroff -man %f ;; esac | sensible-pager + View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) cat %f ;; *) nroff -man %f ;; esac + +# Troff with me macros. +# Exception - "read.me" is not a nroff file. +shell/read.me + Open= + View= + +shell/.me + Open=nroff -me %f | sensible-pager + View=%view{ascii,nroff} nroff -me %f + +# Troff with ms macros. +shell/.ms + Open=nroff -ms %f | sensible-pager + View=%view{ascii,nroff} nroff -ms %f + +# Manual page - compressed +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$ + Open=case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff -man ;; esac | sensible-pager + View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff -man ;; esac + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$ + Open=case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff -man ;; esac | sensible-pager + View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff -man ;; esac + +regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$ + Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff -man ;; esac | sensible-pager + View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff -man ;; esac + +### Miscellaneous ### + +# Makefile +regex/[Mm]akefile$ + Open=make -f %f %{Enter parameters} + +# Imakefile +shell/Imakefile + Open=xmkmf -a + +# Makefile.PL (MakeMaker) +regex/^Makefile.(PL|pl)$ + Open=%var{PERL:perl} %f + +# dbf +regex/\.([dD][bB][fF])$ + Open=%view{ascii} dbview %f + View=%view{ascii} dbview -b %f + +# REXX script +regex/\.(rexx?|cmd)$ + Open=rexx %f %{Enter parameters};echo "Press ENTER";read y + + +### Plain compressed files ### + +# zip +type/^([Zz][Ii][Pp])\ archive + Open=%cd %p#uzip + View=%view{ascii} unzip -v %f + +# zoo +regex/\.([Zz][Oo][Oo])$ + Open=%cd %p#uzoo + View=%view{ascii} zoo l %f + +# gzip +type/^gzip + Open=gzip -dc %f | sensible-pager + View=%view{ascii} gzip -dc %f 2>/dev/null + +# bzip2 +type/^bzip2 + Open=bzip2 -dc %f | sensible-pager + View=%view{ascii} bzip2 -dc %f 2>/dev/null + +# bzip +type/^bzip + Open=bzip -dc %f | sensible-pager + View=%view{ascii} bzip -dc %f 2>/dev/null + +# compress +type/^compress + Open=gzip -dc %f | sensible-pager + View=%view{ascii} gzip -dc %f 2>/dev/null + +### Debian additions ### + +# Gettext Catalogs +shell/.mo + View=%view{ascii} msgunfmt %f || cat %f + +### My. ### + +shell/.my + Open=echo %f %{Enter opt:} %{Enter file:} + +### Default ### + +# Default target for anything not described above. +default/* + Open=cygstart %f& + View= + +### EOF ### diff -r 1e9048a10b95 -r 63b568f99e3c Makefile --- a/Makefile Sun Jun 20 05:42:04 2010 +0300 +++ b/Makefile Wed Jul 28 22:52:12 2010 +0300 @@ -12,7 +12,8 @@ host_os = windows endif -OVERRIDDEN_ITEMS = .Xdefaults .bashrc .mailsign .xinitrc .mc .vimrc .inputrc .ssh .hgrc .hgignore .bazaar .minttyrc +OVERRIDDEN_ITEMS = .Xdefaults .bashrc .mailsign .xinitrc .vimrc .inputrc .ssh .hgrc .hgignore .bazaar .minttyrc +MANUALINSTALL_ITEMS = .mc IFNONEXIST_ITEMS = .wgetrc .PHONY: install @@ -47,6 +48,14 @@ done; \ fi; \ done + mkdir -p $(HOME)/.mc + install -m 640 .mc/bashrc $(HOME)/.mc + install -m 640 .mc/ini $(HOME)/.mc +ifeq '$(host_os)' 'windows' + install -m 640 .mc/bindings.cygwin $(HOME)/.mc/bindings +else + install -m 640 .mc/bindings $(HOME)/.mc/bindings +endif .PHONY: uninstall uninstall: @@ -64,6 +73,8 @@ done; \ fi; \ done + rm -f $(HOME)/.mc/bashrc $(HOME)/.mc/ini $(HOME)/.mc/bindings + rmdir $(HOME)/.mc || : .PHONY: clean clean: