opt/python
Juergen Daubert b514894f5d python: fix issue with man-page symlink
0) Problem: Some people have an additional link to the python man-page:

is the python footprint mismatch something I can fix or am I missing anything important?
NEW       lrwxrwxrwx      root/root       usr/man/man1/python.1.gz -> python2.1.gz

1) the relevant part of Makefile.pre.in:

maninstall:     altmaninstall
        -rm -f $(DESTDIR)$(MANDIR)/man1/python2.1
        (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python2.1)
        -rm -f $(DESTDIR)$(MANDIR)/man1/python.1
        (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1)

2) after 'make install' we have the following chain of symlinks:

lrwxrwxrwx  1 juergen users     9 Apr 21 09:13 python.1 -> python2.1
lrwxrwxrwx  1 juergen users    11 Apr 21 09:13 python2.1 -> python2.7.1
-rw-r--r--  1 juergen users 14582 Apr 21 09:12 python2.7.1

3) the compress_manpages function of our pkgmk:

compress_manpages() {
        local FILE DIR TARGET

        cd $PKG

        find . -type f -path "*/man/man*/*" | while read FILE; do
                if [ "$FILE" = "${FILE%%.gz}" ]; then
                        gzip -9 "$FILE"
                fi
        done

        find . -type l -path "*/man/man*/*" | while read FILE; do
                TARGET=`readlink -n "$FILE"`
                TARGET="${TARGET##*/}"
                TARGET="${TARGET%%.gz}.gz"
                rm -f "$FILE"
                FILE="${FILE%%.gz}.gz"
                DIR=`dirname "$FILE"`

                if [ -e "$DIR/$TARGET" ]; then
                        ln -sf "$TARGET" "$FILE"
                fi
        done
}

4) How it works:

We search for real man-pages in $PKG and compress them, breaking all
symlinks to these man-pages, which we repair afterwards. Fixing is done by
adding a .gz extension to all targets of the symlinks.

However, we do a test if $TARGET exists before we do the actual link,
which is not the case if we have chained symlink and we do not process
in the right order.
For a "normal" collating we have the order python.1 before python2.1, so
python2.1.gz does not exits at the time we process python.1
2013-04-21 11:48:33 +02:00
..
.footprint python: fix issue with man-page symlink 2013-04-21 11:48:33 +02:00
.md5sum python: update to 2.7.4 2013-04-07 10:49:36 +02:00
Pkgfile python: fix issue with man-page symlink 2013-04-21 11:48:33 +02:00
pyconfig.h Initial consolidation of opt ports for CRUX 3.0 2012-11-22 12:50:35 -06:00