From 55e10b14c8ee71a194c08dce178ad82d699db3f5 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Wed, 16 May 2007 07:58:49 +0000 Subject: [PATCH] createrepo-0.4.8-skip-symlinks.patch * adds an option to skip symlinks (-S, --skip-symlinks) Christoph Thiel --- genpkgmetadata.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/genpkgmetadata.py b/genpkgmetadata.py index d2c003b..3801653 100755 --- a/genpkgmetadata.py +++ b/genpkgmetadata.py @@ -83,6 +83,8 @@ class MetaDataGenerator: for fn in names: if os.path.isdir(fn): continue + if self.cmds['skip-symlinks'] and os.path.islink(fn): + continue elif fn[-extlen:].lower() == '%s' % (ext): relativepath = dirname.replace(startdir, "", 1) relativepath = relativepath.lstrip("/") @@ -381,13 +383,15 @@ def parseArgs(args): cmds['database'] = False cmds['file-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*', '^\/usr\/lib\/sendmail$'] cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*'] + cmds['skip-symlinks'] = False try: - gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:C', ['help', 'exclude=', + gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CS', ['help', 'exclude=', 'quiet', 'verbose', 'cachedir=', 'basedir=', 'baseurl=', 'groupfile=', 'checksum=', 'version', 'pretty', 'split', 'outputdir=', - 'noepoch', 'checkts', 'database']) + 'noepoch', 'checkts', 'database', + 'skip-symlinks']) except getopt.error, e: errorprint(_('Options Error: %s.') % e) usage() @@ -455,6 +459,8 @@ def parseArgs(args): cmds['noepoch'] = True elif arg in ['-d', '--database']: cmds['database'] = True + elif arg in ['-S', '--skip-symlinks']: + cmds['skip-symlinks'] = True except ValueError, e: errorprint(_('Options Error: %s') % e) -- 2.34.1