Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
1bdd4e1b
Kaydet (Commit)
1bdd4e1b
authored
Kas 14, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* a new fast tool to find library dependencies!
* some comments
üst
4971b3ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
7 deletions
+76
-7
pisi.e3p
pisi.e3p
+11
-3
commands.py
pisi/cli/commands.py
+5
-3
package.py
pisi/package.py
+1
-1
find-lib-deps.py
tools/find-lib-deps.py
+59
-0
No files found.
pisi.e3p
Dosyayı görüntüle @
1bdd4e1b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
<!-- Project file for project pisi -->
<!-- Saved: 2005-11-1
3, 00:06:19
-->
<!-- Saved: 2005-11-1
5, 01:32:57
-->
<!-- Copyright (C) 2005 PiSi Development Team, -->
<Project
version=
"3.8"
>
<ProgLanguage
mixed=
"0"
>
Python
</ProgLanguage>
...
...
@@ -418,6 +418,14 @@
<Dir>
pxml
</Dir>
<Name>
xmlfilepiks.py
</Name>
</Source>
<Source>
<Dir>
tools
</Dir>
<Name>
cat-source-repo.py
</Name>
</Source>
<Source>
<Dir>
tools
</Dir>
<Name>
find-lib-deps.py
</Name>
</Source>
</Sources>
<Forms>
</Forms>
...
...
@@ -459,10 +467,10 @@
<VcsOtherData>
{'standardLayout': 1}
</VcsOtherData>
</Vcs>
<FiletypeAssociations>
<FiletypeAssociation
pattern=
"*.py"
type=
"SOURCES"
/>
<FiletypeAssociation
pattern=
"*.ui.h"
type=
"FORMS"
/>
<FiletypeAssociation
pattern=
"*.ui"
type=
"FORMS"
/>
<FiletypeAssociation
pattern=
"*.idl"
type=
"INTERFACES"
/>
<FiletypeAssociation
pattern=
"*.
py"
type=
"SOURCE
S"
/>
<FiletypeAssociation
pattern=
"*.
ui"
type=
"FORM
S"
/>
<FiletypeAssociation
pattern=
"*.ptl"
type=
"SOURCES"
/>
</FiletypeAssociations>
</Project>
pisi/cli/commands.py
Dosyayı görüntüle @
1bdd4e1b
...
...
@@ -952,6 +952,8 @@ Finds the installed package which contains the specified file.
self
.
parser
.
add_option
(
"-f"
,
"--fuzzy"
,
action
=
"store_true"
,
default
=
False
,
help
=
_
(
"fuzzy search"
))
# and what does exact mean? -- exa
@staticmethod
#fuck python 2.3 compatibility I don't care about it
def
search_exact
(
path
):
files
=
[]
path
=
path
.
lstrip
(
'/'
)
#FIXME: this shouldn't be necessary :/
...
...
@@ -960,18 +962,18 @@ Finds the installed package which contains the specified file.
if
ctx
.
filesdb
.
has_file
(
path
):
files
.
append
(
ctx
.
filesdb
.
get_file
(
path
))
else
:
#FIXME: this linear search thing is not working well -- exa
files
=
ctx
.
filesdb
.
get_files
(
path
)
if
files
:
for
(
pkg_name
,
file_info
)
in
files
:
#FIXME: files of the same package can be grouped under package name
ctx
.
ui
.
info
(
_
(
'Package:
%
s has File:
%
s'
)
%
(
pkg_name
,
file_info
.
path
))
ctx
.
ui
.
info
(
_
(
"Package
%
s has file
%
s"
)
%
(
pkg_name
,
file_info
.
path
))
if
ctx
.
config
.
options
.
long
:
ctx
.
ui
.
info
(
_
(
'Type:
%
s, Hash:
%
s'
)
%
(
file_info
.
type
,
file_info
.
hash
))
else
:
ctx
.
ui
.
error
(
_
(
'Path
%
s does not belong to an installed package'
)
%
path
)
search_exact
=
staticmethod
(
search_exact
)
ctx
.
ui
.
error
(
_
(
"Path '
%
s' does not belong to an installed package"
)
%
path
)
def
run
(
self
):
...
...
pisi/package.py
Dosyayı görüntüle @
1bdd4e1b
...
...
@@ -45,7 +45,7 @@ class Package:
dest
=
ctx
.
config
.
packages_dir
()
self
.
filepath
=
join
(
dest
,
url
.
filename
())
# FIXME: exists is not enough, also sha1sum check needed
\
# FIXME: exists is not enough, also sha1sum check needed
# when implemented in pisi-index.xml
if
not
exists
(
self
.
filepath
):
fetch_url
(
url
,
dest
,
ctx
.
ui
.
Progress
)
...
...
tools/find-lib-deps.py
0 → 100755
Dosyayı görüntüle @
1bdd4e1b
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# find library dependencies of a package
# author: exa (Eray Özkural)
import
locale
import
sys
import
os
import
fnmatch
import
gettext
__trans
=
gettext
.
translation
(
'pisi'
,
fallback
=
True
)
_
=
__trans
.
ugettext
import
pisi
import
pisi.api
import
pisi.config
import
pisi.specfile
as
specfile
import
pisi.context
as
ctx
import
pisi.util
as
util
from
pisi.package
import
Package
locale
.
setlocale
(
locale
.
LC_ALL
,
''
)
options
=
pisi
.
config
.
Options
()
if
len
(
sys
.
argv
)
>
2
:
options
.
destdir
=
sys
.
argv
[
2
]
else
:
options
.
destdir
=
'/'
pisi
.
api
.
init
(
database
=
True
,
comar
=
False
,
options
=
options
)
filename
=
sys
.
argv
[
1
]
package
=
Package
(
filename
)
package
.
read
()
util
.
clean_dir
(
'/tmp/install'
)
package
.
extract_dir_flat
(
'install'
,
'/tmp/install'
)
deps
=
set
()
needed
=
set
()
for
file
in
package
.
files
.
list
:
#print file.path, file.type
if
file
.
type
==
'binary'
:
(
ret
,
lines
)
=
util
.
run_batch
(
'objdump -p
%
s'
%
util
.
join_path
(
'/tmp/install'
,
file
.
path
))
for
x
in
lines
:
if
x
.
startswith
(
' NEEDED'
):
needed
.
add
(
x
[
8
:]
.
strip
())
#print 'needed guys', needed
for
lib
in
needed
:
(
ret
,
out
)
=
util
.
run_batch
(
'locate
%
s'
%
lib
)
path
=
out
[
0
]
.
strip
()
.
lstrip
(
'/'
)
try
:
(
pkg_name
,
file_info
)
=
ctx
.
filesdb
.
get_file
(
path
)
ctx
.
ui
.
info
(
"Library dependency: '
%
s' due to library '
%
s'"
%
(
pkg_name
,
file_info
.
path
))
except
:
ctx
.
ui
.
warning
(
'Cannot find an installed package for library
%
s'
%
lib
)
pisi
.
api
.
finalize
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment