* [gentoo-commits] dev/nelchael:master commit in: scripts/
@ 2011-03-03 14:27 Krzysztof Pawlik
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Pawlik @ 2011-03-03 14:27 UTC (permalink / raw
To: gentoo-commits
commit: 8e0e7bf546861cd8b9baa81c96ee7b55c56642ee
Author: Krzysztof Pawlik <none <AT> none>
AuthorDate: Thu Mar 3 14:27:12 2011 +0000
Commit: Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Thu Mar 3 14:27:12 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=8e0e7bf5
Update.
---
scripts/generate-userlibraries.sh | 38 ++++++++++++------------------------
1 files changed, 13 insertions(+), 25 deletions(-)
diff --git a/scripts/generate-userlibraries.sh b/scripts/generate-userlibraries.sh
index 9fc4cf7..b9335aa 100755
--- a/scripts/generate-userlibraries.sh
+++ b/scripts/generate-userlibraries.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
-# 2006, Krzysztof Pawlik - nelchael@gentoo.org
-#
+# 2006-2011, Krzysztof Pawlik - nelchael@gentoo.org
+#
# This script generates file for User Libraries import for Eclipse.
# You can find that option in:
# Window -> Preferences -> Java -> Build Path -> User Libraries
@@ -10,62 +10,50 @@
#
function get_name() {
-
- echo $(echo ${1} | sed -e 's,^.*/share/\(.*\)/package.env$,\1,')
-
+ echo "$(echo "${1}" | sed -e 's,^.*/share/\(.*\)/package.env$,\1,')"
}
function get_desc() {
-
- cat ${1} | grep ^DESCRIPTION | cut -d '=' -f 2- | sed -e 's/"//g' | sed -e 's,--,,g'
-
+ grep ^DESCRIPTION "${1}" | cut -d '=' -f 2- | sed -e 's/"//g' | sed -e 's,--,,g'
}
function get_libdir() {
-
- cat ${1} | grep ^LIBRARY_PATH | cut -d '=' -f 2- | sed -e 's/"//g'
-
+ grep ^LIBRARY_PATH "${1}" | cut -d '=' -f 2- | sed -e 's/"//g'
}
function find_source() {
-
- find $(dirname ${1}) -name "*-src.zip" | head -n 1
-
+ find "$(dirname "${1}")" -name '*-src.zip' | head -n 1
}
echo '<?xml version="1.0" encoding="UTF-8"?>'
echo '<eclipse-userlibraries version="2">'
for package in /usr/share/*/package.env; do
-
- packageName=$(get_name ${package})
+ packageName="$(get_name "${package}")"
echo ' <library name="'"${packageName}"'" systemlibrary="false">'
- echo ' <!-- '"$(get_desc ${package})"' -->'
+ echo ' <!-- '"$(get_desc "${package}")"' -->'
gotSource=no
- for jar in $(grep ^CLASSPATH ${package} | cut -d = -f 2- | sed -e 's/"//g' | sed -e 's/:/ /g'); do
-
+ for jar in $(grep ^CLASSPATH "${package}" | cut -d = -f 2- | sed -e 's/"//g' | sed -e 's/:/ /g'); do
echo -n ' <archive path="'"${jar}"'"'
- if [[ -n "$(find_source ${package})" ]]; then
- echo -n ' source="'"$(find_source ${package})"'"'
+ if [[ -n "$(find_source "${package}")" ]]; then
+ echo -n ' source="'"$(find_source "${package}")"'"'
gotSource=yes
fi
- if [[ -n "$(get_libdir ${package})" ]]; then
- echo -n ' nativelibpaths="'"$(get_libdir ${package})"'"'
+ if [[ -n "$(get_libdir "${package}")" ]]; then
+ echo -n ' nativelibpaths="'"$(get_libdir "${package}")"'"'
fi
echo '/>'
-
done
[[ "${gotSource}" = "no" ]] && echo "Package without source: ${packageName}" >&2
echo ' </library>'
-
done
echo '</eclipse-userlibraries>'
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] dev/nelchael:master commit in: scripts/
@ 2011-07-27 19:45 Krzysztof Pawlik
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Pawlik @ 2011-07-27 19:45 UTC (permalink / raw
To: gentoo-commits
commit: 968dfe849434155208c4d8a3c2f64f5fb3f1328c
Author: Krzysztof Pawlik <none <AT> none>
AuthorDate: Tue Jun 28 14:10:25 2011 +0000
Commit: Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Tue Jun 28 14:10:25 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=968dfe84
Fixes for new portage API.
---
scripts/eshowkw.py | 2 +-
scripts/sys-unneeded-distfiles.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/eshowkw.py b/scripts/eshowkw.py
index 29938c2..00f5632 100755
--- a/scripts/eshowkw.py
+++ b/scripts/eshowkw.py
@@ -171,4 +171,4 @@ for i in portage.settings['ACCEPT_KEYWORDS'].split():
if i[0] == '~':
myArch = i[1:]
-showMe(myArch, portage.portdbapi(portage.settings['PORTDIR']), pkg)
+showMe(myArch, portage.portdbapi(mysettings=portage.settings), pkg)
diff --git a/scripts/sys-unneeded-distfiles.py b/scripts/sys-unneeded-distfiles.py
index 8deb1ca..cd5ca62 100755
--- a/scripts/sys-unneeded-distfiles.py
+++ b/scripts/sys-unneeded-distfiles.py
@@ -87,7 +87,7 @@ echo(output.green('Using DB directories: '))
for i in DBPATHS:
echo(output.blue(' * ') + i)
-db = portage.portdbapi(portdir)
+db = portage.portdbapi(mysettings=portage.settings)
if not silent:
print output.green('Gathering files... '),
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] dev/nelchael:master commit in: scripts/
@ 2011-08-06 21:44 Krzysztof Pawlik
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Pawlik @ 2011-08-06 21:44 UTC (permalink / raw
To: gentoo-commits
commit: 6cc618bf769fa6682bba2db9e3622c7f85669582
Author: Krzysztof Pawlik <none <AT> none>
AuthorDate: Sat Aug 6 21:44:10 2011 +0000
Commit: Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Sat Aug 6 21:44:10 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=6cc618bf
Update for portage API.
---
scripts/sys-gentoo-weight.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/sys-gentoo-weight.py b/scripts/sys-gentoo-weight.py
index 98e023d..8824cc6 100755
--- a/scripts/sys-gentoo-weight.py
+++ b/scripts/sys-gentoo-weight.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import os, sys, output
+import os, sys, portage.output as output
spinpos = 0
spinner = "/-\\|/-\\|/-\\|/-\\|\\-/|\\-/|\\-/|\\-/|"
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] dev/nelchael:master commit in: scripts/
@ 2012-02-11 18:49 Krzysztof Pawlik
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Pawlik @ 2012-02-11 18:49 UTC (permalink / raw
To: gentoo-commits
commit: 1e16974c4a868f0871c82f7fe8b9359c13aac56e
Author: Krzysztof Pawlik <none <AT> none>
AuthorDate: Sat Feb 11 18:49:20 2012 +0000
Commit: Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 18:49:20 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=1e16974c
Remove eshowkw.py, obsoleted by eshowkw from gentoolkit.
---
scripts/eshowkw.py | 174 ----------------------------------------------------
1 files changed, 0 insertions(+), 174 deletions(-)
diff --git a/scripts/eshowkw.py b/scripts/eshowkw.py
deleted file mode 100755
index 00f5632..0000000
--- a/scripts/eshowkw.py
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import os
-
-search_path = os.getcwd()
-while search_path != '/':
- if os.path.exists(os.path.join(search_path, 'profiles/repo_name')):
- print 'Appending %s to PORTDIR_OVERLAY...' % search_path
- if 'PORTDIR_OVERLAY' not in os.environ:
- os.environ['PORTDIR_OVERLAY'] = search_path
- else:
- os.environ['PORTDIR_OVERLAY'] += ' ' + search_path
- search_path = os.path.dirname(search_path)
-
-import portage
-import portage.versions as portage_versions
-import portage.output as output
-
-def resolvePackage(db, item):
- cpvs = []
- try:
- cpvs = db.xmatch('match-all', item)
- except (Exception), e:
- print output.red('"%s" matches to more than one package:' % item)
- for x in e.args[0]:
- print ' ' + output.green('*') + ' ' + x
- sys.exit(0)
- if len(cpvs) == 0:
- print output.red('Package "%s" not found' % item)
- if item.find('/') != -1:
- item = item[item.find('/') + 1:]
- try:
- cpvs = db.xmatch('match-all', item)
- except (Exception), e:
- print 'Try:'
- for x in e.args[0]:
- print ' ' + output.green('*') + ' ' + x
- sys.exit(0)
- if len(cpvs) != 0:
- print 'Try:\n %s' % output.green('*') + ' ' + output.bold(portage_versions.pkgsplit(cpvs[0])[0])
- sys.exit(0)
- pkg = portage_versions.pkgsplit(cpvs[0])[0]
- vers = []
- for i in cpvs:
- vers.append(i[len(pkg) + 1:])
- # Sort versions:
- verRv = []
- for i in sorted(vers):
- skip = False
- for x in range(len(verRv)):
- if portage_versions.vercmp(i, verRv[x]) > 0:
- verRv.insert(x, i)
- skip = True
- break
- if not skip:
- verRv.append(i)
- vers = []
- for i in reversed(verRv):
- vers.append(i)
- return ( pkg, vers )
-
-def flagFor(arch, keywords, myArch):
- maskAll = False
- for x in keywords:
- tilde = False
- maskMe = False
- if x == '-*':
- maskAll = True
- continue
- if x[0] == '~':
- x = x[1:]
- tilde = True
- if x[0] == '-':
- x = x[1:]
- maskMe = True
- if x == arch:
- if tilde:
- if arch == myArch:
- return output.yellow('~')
- return output.darkyellow('~')
- if maskMe:
- if arch == myArch:
- return output.red('-')
- return output.darkred('-')
- if arch == myArch:
- return output.green('+')
- return output.darkgreen('+')
- if maskAll:
- if arch == myArch:
- return output.red('*')
- return output.darkred('*')
- return ' '
-
-def showMe(myArch, db, pkg):
- pkg, versions = resolvePackage(db, pkg)
- print '>>> Keywords for', pkg
- archs = []
- for i in open(portage.settings['PORTDIR'] + '/profiles/arch.list').readlines():
- if i == '':
- break
- i = i.strip()
- if i == '' or i[0] == '#':
- continue
- if not 'ESHOWKW_ALL_ARCHS' in os.environ and i.find('-') != -1:
- continue
- archs.append(i)
- longestVerLen = 0
- for i in versions:
- if len(i) > longestVerLen:
- longestVerLen = len(i)
- longestVerLen += 1
- longestSlot = 0
- for i in versions:
- slot = db.aux_get(pkg + '-' + i, [ 'SLOT' ])[0]
- if len(slot) > longestSlot:
- longestSlot = len(slot)
- lines = 0
- for i in archs:
- if len(i) > lines:
- lines = len(i)
- for i in range(lines):
- print longestVerLen * ' ' + '|',
- for x in archs:
- if x == myArch:
- if len(x) > i:
- print output.green(x[i]),
- else:
- print ' ',
- else:
- if len(x) > i:
- print x[i],
- else:
- print ' ',
- print '|',
- print
- print longestVerLen * '-' + '+-' + len(archs) * '--' + '+-' + (longestSlot + 3) * '-'
- sys.stdout.flush()
- prevSlot = None
- for x in versions:
- keywords, slot = db.aux_get(pkg + '-' + x, [ 'KEYWORDS', 'SLOT' ])
- keywords = keywords.split()
- slot = ' (' + slot + ')'
- if slot != prevSlot:
- print output.bold(x + (longestVerLen - len(x)) * ' ') + '|',
- else:
- print x + (longestVerLen - len(x)) * ' ' + '|',
- for a in archs:
- print flagFor(a, keywords, myArch),
- if slot != prevSlot:
- print '|' + output.blue(slot)
- else:
- print '|'
- #print '|' + output.darkblue(slot)
- prevSlot = slot
- sys.stdout.flush()
-
-pkg = None
-if len(sys.argv) == 1:
- if os.getcwd() != '/':
- pkg = os.path.basename(os.path.dirname(os.getcwd())) + '/' + os.path.basename(os.getcwd())
- else:
- print output.red('Can not get package name')
- sys.exit(1)
-else:
- pkg = sys.argv[1]
-
-myArch = None
-for i in portage.settings['ACCEPT_KEYWORDS'].split():
- myArch = i
- if i[0] == '~':
- myArch = i[1:]
-
-showMe(myArch, portage.portdbapi(mysettings=portage.settings), pkg)
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-11 18:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03 14:27 [gentoo-commits] dev/nelchael:master commit in: scripts/ Krzysztof Pawlik
-- strict thread matches above, loose matches on Subject: below --
2011-07-27 19:45 Krzysztof Pawlik
2011-08-06 21:44 Krzysztof Pawlik
2012-02-11 18:49 Krzysztof Pawlik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox