pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/fonts/mkfontalias
Module Name: pkgsrc
Committed By: rxg
Date: Fri Feb 24 13:56:33 UTC 2023
Modified Files:
pkgsrc/fonts/mkfontalias: Makefile distinfo
pkgsrc/fonts/mkfontalias/patches: patch-aa
Log Message:
Make it work with python 3, PKGREVISION bump.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 pkgsrc/fonts/mkfontalias/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/fonts/mkfontalias/distinfo
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/fonts/mkfontalias/patches/patch-aa
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/fonts/mkfontalias/Makefile
diff -u pkgsrc/fonts/mkfontalias/Makefile:1.21 pkgsrc/fonts/mkfontalias/Makefile:1.22
--- pkgsrc/fonts/mkfontalias/Makefile:1.21 Thu Jun 30 11:18:24 2022
+++ pkgsrc/fonts/mkfontalias/Makefile Fri Feb 24 13:56:33 2023
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.21 2022/06/30 11:18:24 nia Exp $
+# $NetBSD: Makefile,v 1.22 2023/02/24 13:56:33 rxg Exp $
#
DISTNAME= mkfontalias.py
PKGNAME= mkfontalias-20000521
-PKGREVISION= 9
+PKGREVISION= 10
CATEGORIES= fonts
MASTER_SITES= http://home.c2i.net/dark/
EXTRACT_SUFX= # empty
@@ -19,8 +19,6 @@ NO_BUILD= yes
REPLACE_PYTHON= ${DISTNAME}
INSTALLATION_DIRS= bin
-PYTHON_VERSIONS_ACCEPTED= 27
-
do-extract:
${CP} ${_DISTDIR}/${DISTNAME} ${WRKSRC}
Index: pkgsrc/fonts/mkfontalias/distinfo
diff -u pkgsrc/fonts/mkfontalias/distinfo:1.5 pkgsrc/fonts/mkfontalias/distinfo:1.6
--- pkgsrc/fonts/mkfontalias/distinfo:1.5 Tue Oct 26 10:27:19 2021
+++ pkgsrc/fonts/mkfontalias/distinfo Fri Feb 24 13:56:33 2023
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.5 2021/10/26 10:27:19 nia Exp $
+$NetBSD: distinfo,v 1.6 2023/02/24 13:56:33 rxg Exp $
BLAKE2s (mkfontalias.py) = 949c0b67b3cf9c0ce5d33cced5b5b49fe2ef8b89b4de204ed260af4bb7ba3b40
SHA512 (mkfontalias.py) = 887ef8fb9de77040da0fb8f06fedb69b2770efc28c0919c106e5432082663c5695cec02f7419264394a5ba776615f64039672f776cb9e882dfaf42219551cf34
Size (mkfontalias.py) = 3571 bytes
-SHA1 (patch-aa) = c1ea1fd0cd708f84e63b4039c1986b93086dd0b5
+SHA1 (patch-aa) = 21bc3fc86702968580b119400a6c8f6506c6ac1c
Index: pkgsrc/fonts/mkfontalias/patches/patch-aa
diff -u pkgsrc/fonts/mkfontalias/patches/patch-aa:1.1.1.1 pkgsrc/fonts/mkfontalias/patches/patch-aa:1.2
--- pkgsrc/fonts/mkfontalias/patches/patch-aa:1.1.1.1 Mon May 20 12:38:59 2002
+++ pkgsrc/fonts/mkfontalias/patches/patch-aa Fri Feb 24 13:56:33 2023
@@ -1,17 +1,40 @@
-$NetBSD: patch-aa,v 1.1.1.1 2002/05/20 12:38:59 wiz Exp $
+$NetBSD: patch-aa,v 1.2 2023/02/24 13:56:33 rxg Exp $
---- mkfontalias.py.orig Mon May 13 23:10:34 2002
+--- mkfontalias.py.orig 2023-02-24 09:21:36.213980685 +0000
+++ mkfontalias.py
@@ -16,7 +16,7 @@
# --
import sys, string, os
-_font_sizes = range(6, 16) + [ 18, 24 ]
-+_font_sizes = range(6, 13) + [ 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 ]
++_font_sizes = list ( range(6, 13) ) + [ 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 ]
_infile = 'fonts.dir'
_outfile = 'fonts.alias'
-@@ -67,13 +67,8 @@
+@@ -44,7 +44,7 @@ _font_map = { 'Arial' : 'Arial',
+ try:
+ # Strip the first line
+ fonts = open ( _infile ).readlines()[1:]
+-except IOError, val:
++except IOError as val:
+ sys.stderr.write ( 'Cannot read %s (%s) - are you sure you are in the '
+ 'fonts directory?\n' % (_infile, val) )
+ sys.exit(1)
+@@ -55,62 +55,57 @@ for line in fonts:
+ try:
+ # Get rid of the first entry, but mind that other may have
+ # spaces in them
+- font = string.strip(string.join ( string.split ( line, ' ' )[1:], ' '))
++ font = ' '.join ( line.split ( ' ' )[1:] ).strip()
+ except IndexError:
+ sys.stderr.write ( 'Cannot parse %s line: %s\n' % (_infile, line ) )
+ sys.exit(1)
+
+- entries = string.split ( font, '-' )
++ entries = font.split ( '-' )
+
+ if len(entries) != 15:
+ # Seems to be invalid
sys.stderr.write ( 'Invalid font: %s\n' % (font) )
sys.exit(1)
@@ -27,12 +50,53 @@ $NetBSD: patch-aa,v 1.1.1.1 2002/05/20 1
# Do the 'cheating' - fallback to size if not in the cheat map
real_size = _cheat_map.get ( size, size )
-@@ -81,7 +76,7 @@
- str(real_size * 10) ] +
- entries[9:], '-' )
-
+- name = string.join ( entries[:7] + [ str(real_size),
+- str(real_size * 10) ] +
+- entries[9:], '-' )
+-
- alias = string.join ( entries[:2] + [map] + entries[3:7] +
-+ alias = string.join ( entries[:3] + entries[3:7] +
- [ str(size), str(size * 10) ] +
- _res + entries[11:], '-' )
+- [ str(size), str(size * 10) ] +
+- _res + entries[11:], '-' )
++ name = '-'.join ( entries[:7] + [ str(real_size),
++ str(real_size * 10) ] +
++ entries[9:] )
++
++ alias = '-'.join ( entries[:3] + entries[3:7] +
++ [ str(size), str(size * 10) ] +
++ _res + entries[11:] )
+
+ # Add the entry to the aliases
+ _aliases.append ( '"%s" "%s"' % (alias, name) )
+
+ # Boast
+-print 'Created %s aliases' % len(_aliases)
++print ( 'Created %s aliases' % len(_aliases) )
+
+ # Backup the existing file
+ _bak = _outfile + '.bak'
+ if os.path.exists ( _outfile ) and not os.path.exists ( _bak ):
+ try:
+ os.rename ( _outfile, _bak )
+- except OSError, val:
++ except OSError as val:
+ sys.stderr.write ( 'Cannot backup %s to %s: %s\n' % (_outfile, _bak,
+ val) )
+ sys.exit(1)
+ else:
+- print 'Backed up existing %s to %s' % (_outfile, _bak)
++ print ( 'Backed up existing %s to %s' % (_outfile, _bak) )
+
+ # Ok, write the file
+ try:
+ _out = open ( _outfile, 'w' )
+-except IOError, val:
++except IOError as val:
+ sys.stderr.write ( 'Cannot open %s for writing: %s\n' % (_outfile, val) )
+ sys.exit(1)
+
+-_out.write ( string.join ( _aliases, '\n' ) )
++_out.write ( '\n'.join ( _aliases ) )
+ _out.close()
+-print 'Wrote aliases to %s' % _outfile
++print ( 'Wrote aliases to %s' % _outfile )
Home |
Main Index |
Thread Index |
Old Index