Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
repod
Commits
a83e4cc4
Commit
a83e4cc4
authored
Dec 28, 2019
by
Alad Wenter
Browse files
db-remove: add removal of symlinks / pool directory
parent
c204a5a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.rst
View file @
a83e4cc4
...
...
@@ -26,25 +26,32 @@ files in repository directories. These files contain the metadata
available in pacman(8) packages, and may be generated directly from
them::
x86_64
core
pkgbase_a.json
core-debug
extra
pkgbase_b.json
extra-debug
staging
testing
community
community-debug
community-staging
community-testing
gnome-unstable
kde-unstable
multilib
multilib-debug
multilib-staging
multilib-testing
.
└── meta
└── x86_64
├── core
│ └── pkgbase_a.json
├── core-debug
└── extra
└── pkgbase_b.json
├── extra-debug
├── staging
├── testing
├── community
├── community-debug
├── community-staging
├── community-testing
├── gnome-unstable
├── kde-unstable
├── multilib
├── multilib-debug
├── multilib-staging
└── multilib-testing
.. note::
Unlike svn, there is no distinction between repositories, in
particular between `community` and packages in other repositories
such as `extra`.
Per-architecture repo with per-package metadata file in repo directories
=========================================================================
...
...
@@ -155,19 +162,20 @@ If *package_a* in version *1:2-3* is in::
its binary package will be symlinked from the pool to the respective location::
core
os
x86_64
core.db
[..]
package_a-1:2-3-x86_64.pkg.tar.xz -> ../../../pool/package_a-1:2-3-x86_64.pkg.tar.xz
package_a-1:2-3-x86_64.pkg.tar.xz.sig -> ../../../pool/package_a-1:2-3-x86_64.pkg.tar.xz.sig
[..]
pool
[..]
package_a-1:2-3-x86_64.pkg.tar.xz
package_a-1:2-3-x86_64.pkg.tar.xz.sig
[..]
.
├── /srv/ftp/core
│ └── os
│ └── x86_64
│ ├── core.db
│ ├── [..]
│ ├── package_a-1:2-3-x86_64.pkg.tar.xz -> ../../../pool/package_a-1:2-3-x86_64.pkg.tar.xz
│ ├── package_a-1:2-3-x86_64.pkg.tar.xz.sig -> ../../../pool/package_a-1:2-3-x86_64.pkg.tar.xz.sig
│ └── [..]
└── /srv/ftp/pool
├── [..]
├── package_a-1:2-3-x86_64.pkg.tar.xz
├── package_a-1:2-3-x86_64.pkg.tar.xz.sig
└── [..]
Workflows
_________
...
...
@@ -323,9 +331,11 @@ Remove existing pkgbases.
- **DONE** Delete JSON files
- **DONE** Write out DB files
- `git commit`
- Remove old symlinks
-
**DONE**
Remove old symlinks
- Move (move existing pkgbases from e.g. testing to extra)
Move
----
Move packages from one repository (e.g. testing) to another (e.g. extra).
- **DONE** For each repo to process:
...
...
dbscripts/db-remove
View file @
a83e4cc4
...
...
@@ -12,6 +12,9 @@ from lib.dbwrite import generate_dbs
async
def
main
(
repo
,
pkgbases
)
->
int
:
metadir
=
(
Path
(
argv
[
0
]).
parent
/
"meta"
).
resolve
(
strict
=
True
)
# XXX stating and meta need not have the same parent directory (/srv, /srv/ftp)
stagingdir
=
(
Path
(
argv
[
0
]).
parent
/
"staging"
).
resolve
(
strict
=
True
)
pooldir
=
(
Path
(
argv
[
0
]).
parent
/
"pool"
).
resolve
(
strict
=
True
)
# FIXME: Put this into metadir/.git/
lockfile
=
(
metadir
/
"dbscripts.lock"
).
open
(
mode
=
"w"
)
...
...
@@ -31,16 +34,29 @@ async def main(repo, pkgbases) -> int:
return
{
p
.
stem
:
json_load
(
repodir
/
p
)
for
p
in
repodir
.
glob
(
"*.json"
)}
meta
=
{
repo
:
repo_load
(
repo
)}
removals
=
()
# remove packages from meta and corresponding json files
for
pkgbase
in
pkgbases
:
if
pkgbase
not
in
meta
[
repo
]:
raise
RuntimeError
(
f
"pkgbase '
{
pkgbase
}
' is not present in '
{
repo
}
' repo"
)
# old package files
for
package
in
meta
[
repo
][
pkgbase
][
"packages"
]:
removals
.
append
(
package
[
"filename"
])
# remove database entry
del
meta
[
repo
][
pkgbase
]
(
metadir
/
repo
/
f
"
{
pkgbase
}
.json"
).
unlink
()
# rebuild DB file using `meta` object
generate_dbs
(
meta
)
# XXX git commit
# remove old symlinks
for
p
in
removals
:
(
stagingdir
/
p
).
unlink
()
(
stagingdir
/
p
+
".sig"
).
unlink
()
(
pooldir
/
p
).
unlink
()
(
pooldir
/
p
+
".sig"
).
unlink
()
return
0
...
...
dbscripts/demo-init.sh
View file @
a83e4cc4
...
...
@@ -2,3 +2,4 @@
mkdir
-p
staging/
{
community,community-staging
}
mkdir
-p
meta
mkdir
-p
pool
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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