[Frugalware-darcs] frugalware-current: tools/checkpkgs: pps-ppc

2006-10-29 Thread VMiklos
Darcsweb-Url: 
http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=frugalware-current;a=darcs_commitdiff;h=20061030003317-e2957-43389c26ffe654669e907a14d0835b08591d97a2.gz;

[tools/checkpkgs: pps-ppc
VMiklos [EMAIL PROTECTED]**20061030003317] {
hunk ./tools/checkpkgs 101
-out_put = '%-35s %-15s [%s] i686 [%s] pps [%s] x86_64'
+out_put = '%-35s %-15s [%s] i686 [%s] ppc [%s] x86_64'
}
___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs


[Frugalware-darcs] frugalware-current: tools/checkpkgs: drop -extra support

2006-07-31 Thread VMiklos
[tools/checkpkgs: drop -extra support
VMiklos [EMAIL PROTECTED]**20060731203012] {
hunk ./tools/checkpkgs 105
-for repo in ['frugalware-' + arch, 'extra/frugalware-' + arch]:
+for repo in ['frugalware-' + arch]:
hunk ./tools/checkpkgs 118
-for fbuild in os.walk('../extra/source'):
-if not 'FrugalBuild' in fbuild[2]:
-continue
-fbuilds.append(fbuild[0] + '/FrugalBuild')
hunk ./tools/checkpkgs 154
-if fbuild.startswith('../source'):
-group = fbuild.split('/')[-3]
-else:
-group = '/' + fbuild.split('/')[-3]
+group = fbuild.split('/')[-3]
hunk ./tools/checkpkgs 168
-print out_put % (pkg, group.replace('', 'extra'), i686, ppc, x86_64)
+print out_put % (pkg, group, i686, ppc, x86_64)
}
___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs


[Frugalware-darcs] frugalware-current: tools/checkpkgs: see if there are packages, elsewhere we're offline

2006-07-26 Thread VMiklos
[tools/checkpkgs: see if there are packages, elsewhere we're offline
VMiklos [EMAIL PROTECTED]**20060726232924] {
hunk ./tools/checkpkgs 110
+# See if there are packages, elsewhere we're offline
+if len(rempkgs) == 0:
+   raise No remote packages are found
}
___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs


[Frugalware-darcs] frugalware-current: tools/checkpkgs

2006-05-24 Thread BMH1980
[tools/checkpkgs
BMH1980 [EMAIL PROTECTED]**20060524205953
 Removing the use of python's ftplib
 Readding the use of repoman ls
] {
hunk ./tools/checkpkgs 4
-import ftplib, getopt, os, sys
+import getopt, os, sys
hunk ./tools/checkpkgs 104
-ftp = ftplib.FTP('ftp.frugalware.org')
-ftp.login()
hunk ./tools/checkpkgs 106
-repo_path = '/pub/frugalware/frugalware-' + path + '/' + repo
-ftp.retrlines('LIST ' + repo_path, tmppkgs.append)
-for item in tmppkgs:
-rempkgs.append(item.split()[-1].replace('.fpm', ''))
-ftp.quit()
+cmd = 'repoman -t %s ls %s 2 /dev/null' % (path, repo)
+for item in os.popen(cmd).readlines():
+rempkgs.append(item.replace('.fpm\n', ''))
hunk ./tools/checkpkgs 173
+
}
___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs


[Frugalware-darcs] frugalware-current: tools/checkpkgs

2006-05-16 Thread BMH1980
[tools/checkpkgs
BMH1980 [EMAIL PROTECTED]**20060516124715
 Adding new option -t|--tree like in repoman
 Tabs - spaces
 Fixing some lines like pylints hints
] {
hunk ./tools/checkpkgs 7
-(color, option, outlist) = (True, 'missing', list())
+(color, option, outlist, path) = (True, 'missing', list(), 'current')
hunk ./tools/checkpkgs 24
-   if retval == 0: out = sys.stdout
-   else: out = sys.stderr
-   out.write('Usage: %s [options]\n' % os.path.abspath(sys.argv[0]))
-   out.write('\n')
-   out.write('\t-a|--all  Check all packages\n')
-   out.write('\t-b|--buildSearch for not builded packages\n')
-   out.write('\t-e|--availableSearch for packages that will not be 
available\n')
-   out.write('\t-m|--missing  Search for missing packages (default)\n')
-   out.write('\t-n|--nocolor  Don\'t use color\n')
-   out.write('\n')
-   out.write('-b is searching for packages available on only one 
architecture.\n')
-   out.write('-m is searching for packages that can\'t be found, but 
should be existing.\n')
-   out.write('-a is a short version for -bm.\n')
-   out.write('-n doesn\'t use colors on the output. That\'s usefull if you 
want to send\n')
-   out.write('   the output via mail or you want to save it in a file.\n')
-   out.write('\n')
-   out.write('[X] or green  = package is existing\n')
-   out.write('[O] or red= package is missing\n')
-   out.write('[-] or yellow = package isn\'t built for this 
architecture\n')
-   out.write('[!] or blue   = package will not be available for this 
architecture\n')
-   sys.exit(retval)
+if retval == 0:
+out = sys.stdout
+else:
+out = sys.stderr
+out.write('Usage: %s [options]\n' % os.path.abspath(sys.argv[0]))
+out.write('\n')
+out.write('\t-a|--all  Check all packages\n')
+out.write('\t-b|--buildSearch for not builded packages\n')
+out.write('\t-e|--availableSearch for packages that will not be ')
+out.write('available\n')
+out.write('\t-m|--missing  Search for missing packages (default)\n')
+out.write('\t-n|--nocolor  Don\'t use color\n')
+out.write('\t-t|--tree=Use antoher repo (eg stable) instead of ')
+out.write('current\n')
+out.write('\n')
+out.write('-b is searching for packages available on only one ')
+out.write('architecture.\n')
+out.write('-m is searching for packages that can\'t be found, but should ')
+out.write('be existing.\n')
+out.write('-a is a short version for -bm.\n')
+out.write('-n doesn\'t use colors on the output. That\'s usefull if you ')
+out.write('want to send\n')
+out.write('   the output via mail or you want to save it in a file.\n')
+out.write('\n')
+out.write('[X] or green  = package is existing\n')
+out.write('[O] or red= package is missing\n')
+out.write('[-] or yellow = package isn\'t built for this architecture\n')
+out.write('[!] or blue   = package will not be available for this ')
+out.write('architecture\n')
+sys.exit(retval)
hunk ./tools/checkpkgs 57
-   args = getopt.getopt(sys.argv[1:], 'abehmn', ('all', 'available', 
'build', 'help', 'missing', 'nocolor'))
+args = getopt.getopt(sys.argv[1:], 'abehmnt:', ('all', 'available',
+'build', 'help', 'missing',
+'nocolor', 'tree='))
hunk ./tools/checkpkgs 61
-   cmdline = os.path.abspath(sys.argv[0])
-   for i in getopt.GetoptError('', sys.argv[1:]).opt: cmdline += ' ' + i
-   sys.stderr.write('Wrong command line:\n%s\n\n' % cmdline)
-   show_help(1)
+cmdline = os.path.abspath(sys.argv[0])
+for i in getopt.GetoptError('', sys.argv[1:]).opt:
+cmdline += ' ' + i
+sys.stderr.write('Wrong command line:\n%s\n\n' % cmdline)
+show_help(1)
hunk ./tools/checkpkgs 69
-   if len(arg) == 0: continue
-   if '-a' in arg[0] or '--all' in arg[0]: option = 'all'
-   if '-b' in arg[0] and option == 'missing': option = 'all'
-   elif '--build' in arg[0] and option == 'missing': option = 'all'
-   elif '-b' in arg[0] or '--build' in arg[0]: option = 'build'
-   if '-e' in arg[0] or '--available' in arg[0]: option = 'available'
-   if '-m' in arg[0] and option == 'build': option = 'all'
-   elif '--missing' in arg[0] and option == 'build': option = 'all'
-   elif '-m' in arg[0] or '--missing' in arg[0]: option = 'missing'
-   if '-n' in arg[0] or '--nocolor' in arg[0]: color = False
-   if '-h' in arg[0] or '--help' in arg[0]: show_help()
-
+if len(arg) == 0:
+continue
+if '-a' in arg[0] or '--all' in arg[0]:
+option = 'all'
+if '-b' in arg[0] and option == 'missing':
+option = 'all'
+elif '--build' in arg[0] and option == 'missing':
+option = 'all'
+elif '-b' in arg[0] or '--build' 

[Frugalware-darcs] frugalware-current: tools/checkpkgs

2006-05-08 Thread BMH1980
[tools/checkpkgs
BMH1980 [EMAIL PROTECTED]**20060508211125
 Rewritten from scratch
 Using shell's source command to read the FrugalBuilds
 Don't use many functions
 Using stderr for error messages
 Using python ftplib instead of repoman to get the list of remote packages
 Cleaning the whole functions
] {
hunk ./tools/checkpkgs 4
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Import needed modules
-import getopt, os, sys
+import ftplib, getopt, os, sys
hunk ./tools/checkpkgs 7
-color, command = (True, 'missing')
-ctxt = '\x1b[01m%-35s \x1b[0m%-15s \x1b[01;%smi686 \x1b[01;%smx86_64 
\x1b[01;%smppc\x1b[0m'
-rtxt = '%-35s %-15s [%s] i686 [%s] x86_64 [%s] ppc'
+(color, option, outlist) = (True, 'missing', list())
hunk ./tools/checkpkgs 9
-def checkpkgs():
-   '''Check if the remote packages are equal to the local FrugalBuilds.'''
-   i686, x86_64, ppc = (get_pkgs('i686'), get_pkgs('x86_64'), 
get_pkgs('ppc'))
-   ffdata, efdata = get_fbuilds()
-   for fdata in (ffdata, efdata):
-   for pkg in fdata:
-   i686_msg = check_pkgs(pkg[1], i686, 'i686', pkg[2])
-   x86_64_msg = check_pkgs(pkg[1], x86_64, 'x86_64', 
pkg[2])
-   ppc_msg = check_pkgs(pkg[1], ppc, 'ppc', pkg[2])
-   print_pkgs(pkg[1], pkg[0], i686_msg, x86_64_msg, 
ppc_msg)
+# Build the command to read the FrugalBuilds
+command  = 'CHROOT=1'
+command += ' ; error() { true; }'
+command += ' ; source /usr/lib/frugalware/fwmakepkg'
+command += ' ; source %s'
+command += ' ; [ -n ${nobuild} ]  exit'
+command += ' ; echo [EMAIL PROTECTED] | grep -q nobuild  exit'
+command += ' ; echo ${pkgname}-${pkgver}-${pkgrel}'
+command += ' ; echo [EMAIL PROTECTED]'
hunk ./tools/checkpkgs 19
-def print_pkgs(pkg, grp, i686, x86_64, ppc):
-   '''Print packages for that we are searching.'''
-   if command == 'all':
-   if color: print ctxt % (pkg, grp, i686[0], x86_64[0], ppc[0])
-   else: print rtxt % (pkg, grp, i686[1], x86_64[1], ppc[1])
-   elif command == 'build' and (33, '-') in (i686, x86_64, ppc):
-   if color: print ctxt % (pkg, grp, i686[0], x86_64[0], ppc[0])
-   else: print rtxt % (pkg, grp, i686[1], x86_64[1], ppc[1])
-   elif command == 'available' and (34, '!') in (i686, x86_64, ppc):
-   if color: print ctxt % (pkg, grp, i686[0], x86_64[0], ppc[0])
-   else: print rtxt % (pkg, grp, i686[1], x86_64[1], ppc[1])
-   elif command == 'missing' and (31, 'O') in (i686, x86_64, ppc):
-   if color: print ctxt % (pkg, grp, i686[0], x86_64[0], ppc[0])
-   else: print rtxt % (pkg, grp, i686[1], x86_64[1], ppc[1])
+# Empty lists
+(fbuilds, rempkgs, tmppkgs) = (list(), list(), list())
hunk ./tools/checkpkgs 22
-def check_pkgs(pkg, pkgs, arch, archs):
-   '''Return the markers for the finded packages.'''
-   if pkg in pkgs and arch in archs: return (32, 'X')
-   elif not pkg in pkgs and arch in archs: return (31, 'O')
-   elif '!' + arch in archs: return (34, '!')
-   else: return (33, '-')
+# Help function
+def show_help(retval = 0):
+   if retval == 0: out = sys.stdout
+   else: out = sys.stderr
+   out.write('Usage: %s [options]\n' % os.path.abspath(sys.argv[0]))
+   out.write('\n')
+   out.write('\t-a|--all  Check all packages\n')
+   out.write('\t-b|--buildSearch for not builded packages\n')
+   out.write('\t-e|--availableSearch for packages that will not be 
available\n')
+   out.write('\t-m|--missing  Search for missing packages (default)\n')
+   out.write('\t-n|--nocolor  Don\'t use color\n')
+   out.write('\n')
+   out.write('-b is searching for packages they are only available on one 
architecture.\n')
+   out.write('-m is searching for packages that can\'t be found, but 
should be existing.\n')
+   out.write('-a is a short version for -bm.\n')
+   out.write('-n doesn\'t use colors on the output. That\'s usefull if you 
want to send\n')
+   out.write('   the output via mail or you want to save it in a file.\n')
+   out.write('\n')
+   out.write('[X] or green  = package is existing\n')
+   out.write('[O] or red= package is missing\n')
+   out.write('[-] or 

[Frugalware-darcs] frugalware-current: tools/checkpkgs: ugly fix for the argument list too long bug

2006-04-22 Thread VMiklos
[tools/checkpkgs: ugly fix for the argument list too long bug
VMiklos [EMAIL PROTECTED]**20060422102608] {
hunk ./tools/checkpkgs 106
-   frepo = 'repoman ls frugalware-%s/*.fpm 2 /dev/null' % arch
-   erepo = 'repoman ls extra/frugalware-%s/*.fpm 2 /dev/null' % arch
+   frepo = 'repoman ls frugalware-%s/ 2 /dev/null |grep fpm$' % arch
+   erepo = 'repoman ls extra/frugalware-%s/ 2 /dev/null |grep fpm$' % arch
}
___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs


[Frugalware-darcs] frugalware-current: tools/checkpkgs

2006-04-22 Thread BMH1980
[tools/checkpkgs
BMH1980 [EMAIL PROTECTED]**20060422190401
 Removing |grep fpm$
 Adding extra line to check, if the output line is ending witht .fpm
 Fixing output of the help function
] {
hunk ./tools/checkpkgs 106
-   frepo = 'repoman ls frugalware-%s/ 2 /dev/null |grep fpm$' % arch
-   erepo = 'repoman ls extra/frugalware-%s/ 2 /dev/null |grep fpm$' % arch
+   frepo = r'repoman ls frugalware-%s/ 2 /dev/null' % arch
+   erepo = r'repoman ls extra/frugalware-%s/ 2 /dev/null' % arch
hunk ./tools/checkpkgs 110
+   if not pkg.endswith('.fpm\n'): continue
hunk ./tools/checkpkgs 129
-   print 'the output via mail or you want to save it in a file.'
+   print '   the output via mail or you want to save it in a file.'
}
___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs


[Frugalware-darcs] frugalware-current: tools/checkpkgs

2006-03-07 Thread BMH1980
[tools/checkpkgs
BMH1980 [EMAIL PROTECTED]**20060307184627
 Adding a extra line for the new options=('nobuild') option
] {
hunk ./tools/checkpkgs 81
+   elif line.startswith('options=') and 'nobuild' in line: nobuild 
= True
}
___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs


[Frugalware-darcs] frugalware-current: tools/checkpkgs

2005-12-28 Thread BMH1980
[tools/checkpkgs
BMH1980 [EMAIL PROTECTED]**20051228124546
 Complete rewrite because:
 - adding ppc
 - make it easier to add new archs
 - cleaner code
 - adding descriptions to all functions
] {
hunk ./tools/checkpkgs 1
-#! /usr/bin/env python
+#!/usr/bin/env python
hunk ./tools/checkpkgs 4
-import getopt, os, sys
-
-class checkpkgs:
-   def __init__(self, color):
-   self.pkg32, self.pkg64, self.pkgs, self.pkgsx = [[], [], [], []]
-   self.color = color
-
-
-   def get_pkg32(self):
-   for item in os.popen('repoman ls frugalware-i686/*.fpm 2 
/dev/null').readlines():
-   
self.pkg32.append(os.path.basename(item.rstrip().replace('-i686.fpm', '')))
-   for item in os.popen('repoman ls extra/frugalware-i686/*.fpm 2 
/dev/null').readlines():
-   
self.pkg32.append(os.path.basename(item.rstrip().replace('-i686.fpm', '')))
-
-
-   def get_pkg64(self):
-   for item in os.popen('repoman ls frugalware-x86_64/*.fpm 2 
/dev/null').readlines():
-   
self.pkg64.append(os.path.basename(item.rstrip().replace('-x86_64.fpm', '')))
-   for item in os.popen('repoman ls extra/frugalware-x86_64/*.fpm 
2 /dev/null').readlines():
-   
self.pkg64.append(os.path.basename(item.rstrip().replace('-x86_64.fpm', '')))
-
-
-   def get_fb_data(self, fbuild):
-   pkgname, pkgver, pkgrel, archs, nobuild = ['', '', '', ['i686', 
'x86_64'], False]
-   group = 
os.path.basename(os.path.dirname(os.path.dirname(fbuild)))
-   for item in file(fbuild, 'r').readlines():
-   if item.startswith('pkgname='):
-   pkgname = item.split('=')[1].replace('', 
'').rstrip()
-   elif item.startswith('pkgver='):
-   pkgver = item.split('=')[1].replace('', 
'').rstrip()
-   elif item.startswith('pkgrel='):
-   pkgrel = item.split('=')[1].replace('', 
'').rstrip()
-   elif item.startswith('archs='):
-   archs = item.split('=')[1].replace('(', 
'').replace(')', '').replace(', '').rstrip().split()
-   elif item.startswith('nobuild=1'):
-   nobuild = True
-   elif item.startswith('lang='):
-   lang = item.split('=')[1].replace('', 
'').rstrip()
-   try: pkgname = pkgname.replace('$lang', lang)
-   except: pass
-   return [group, pkgname + '-' + pkgver + '-' + pkgrel, archs, 
nobuild]
-
-
-   def get_pkgs(self):
-   for fbuild in os.walk('../source'):
-   if 'FrugalBuild' in fbuild[2]:
-   data = self.get_fb_data(fbuild[0] + 
'/FrugalBuild')
-   if not data[3]: self.pkgs.append(data)
-   self.pkgs.sort()
-   for fbuild in os.walk('../extra/source'):
-   if 'FrugalBuild' in fbuild[2]:
-   data = self.get_fb_data(fbuild[0] + 
'/FrugalBuild')
-   if not data[3]: self.pkgsx.append(data)
-   self.pkgsx.sort()
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
hunk ./tools/checkpkgs 18
+# Import needed modules
+import getopt, os, sys
hunk ./tools/checkpkgs 21
-   def print_pkgs(self, data):
-   if self.color:
-   print '\x1b[01m%-35s \x1b[0m%-20s \x1b[01;%smi686  
\x1b[01;%smx86_64\x1b[0m' % data
-   else: print '%-35s %-20s [%s] i686  [%s] x86_64' % data
+# Defaults
+color, command = (True, 'missing')
+ctxt = '\x1b[01m%-35s \x1b[0m%-15s \x1b[01;%smi686 \x1b[01;%smx86_64 
\x1b[01;%smppc\x1b[0m'
+rtxt = '%-35s %-15s [%s] i686 [%s] x86_64 [%s] ppc'
hunk ./tools/checkpkgs 26
+def checkpkgs():
+   '''Check if the remote packages are equal to the local FrugalBuilds.'''
+   i686, x86_64, ppc = (get_pkgs('i686'), get_pkgs('x86_64'), 
get_pkgs('ppc'))
+   ffdata, efdata = get_fbuilds()
+   for fdata in (ffdata, efdata):
+   for pkg in fdata:
+   i686_msg = check_pkgs(pkg[1], i686, 'i686', pkg[2])
+   

[Frugalware-darcs] frugalware-current: tools/checkpkgs

2005-10-09 Thread VMiklos
Sun Oct  9 22:01:19 CEST 2005  VMiklos [EMAIL PROTECTED]
  * tools/checkpkgs
  yet another workaround for Finclude
diff -rN -u old-frugalware-current/tools/checkpkgs 
new-frugalware-current/tools/checkpkgs
--- old-frugalware-current/tools/checkpkgs  2005-10-09 22:48:43.0 
+0200
+++ new-frugalware-current/tools/checkpkgs  2005-10-09 22:46:54.0 
+0200
@@ -10,6 +10,9 @@
 Fdie(){
echo $1  /dev/null
 }
+Finclude(){
+   return 0;
+}
 
 chk_status() # $1 = path to a FrugalBuild script, $2 = repo
 {

___
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs