Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Akabei frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chakra
Akabei
Akabei frontend
Commits
42ffd483
Commit
42ffd483
authored
Feb 16, 2016
by
Lisa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use os.path.join in akabei-db-import instead of a custom function.
parent
0933e9c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
scripts/akabei-db-import/akabei-db-import.py
scripts/akabei-db-import/akabei-db-import.py
+6
-12
No files found.
scripts/akabei-db-import/akabei-db-import.py
View file @
42ffd483
...
...
@@ -50,12 +50,6 @@ def getDatabasePath(pf):
conf
.
close
()
return
""
def
concatenatePaths
(
path1
,
path2
):
if
(
path1
[
-
1
]
!=
'/'
):
path1
+=
"/"
path1
+=
path2
return
path1
# Each local package is represented in pacman as a directory in the form name-version
# in this path. This directory contains: desc, files (always), install (not always).
def
parseLocalDatabase
(
path
):
...
...
@@ -74,16 +68,16 @@ def parseLocalDatabase(path):
showProgress
(
progress
)
for
pkgDir
in
os
.
listdir
(
path
):
pkgPath
=
concatenatePaths
(
path
,
pkgDir
)
pkgPath
=
os
.
path
.
join
(
path
,
pkgDir
)
if
os
.
path
.
isdir
(
pkgPath
):
for
pkgFile
in
os
.
listdir
(
pkgPath
):
if
pkgFile
==
"desc"
:
desc
=
concatenatePaths
(
pkgPath
,
pkgFile
)
desc
=
os
.
path
.
join
(
pkgPath
,
pkgFile
)
elif
pkgFile
==
"install"
:
install
=
concatenatePaths
(
pkgPath
,
pkgFile
)
install
=
os
.
path
.
join
(
pkgPath
,
pkgFile
)
elif
pkgFile
==
"files"
:
files
=
concatenatePaths
(
pkgPath
,
pkgFile
)
files
=
os
.
path
.
join
(
pkgPath
,
pkgFile
)
progress
+=
step
# update progress
...
...
@@ -158,7 +152,7 @@ if __name__ == "__main__":
if
len
(
dbpath
)
==
0
:
dbpath
=
"/var/lib/pacman"
# if not explicitly set there, then go back to the default value
localPath
=
concatenatePaths
(
dbpath
,
"local"
)
localPath
=
os
.
path
.
join
(
dbpath
,
"local"
)
# Get local packages from pacman, then write them into the akabei database in the right format
...
...
@@ -169,4 +163,4 @@ if __name__ == "__main__":
dbwriter
=
AkabeiDbWriter
(
outputFile
,
schemeFile
)
dbwriter
.
addPackages
(
localPackages
)
print
"[**] Database converted successfully. Now enjoy akabei!"
\ No newline at end of file
print
"[**] Database converted successfully. Now enjoy akabei!"
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