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
arch-historical-archive
Commits
9e55ff1f
Commit
9e55ff1f
authored
Mar 30, 2019
by
Florian Pritz
Browse files
Support passing multiple package directories via command line args
Signed-off-by:
Florian Pritz
<
bluewind@xinu.at
>
parent
cdbc1dc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
9e55ff1f
...
...
@@ -15,6 +15,10 @@ To upload *all* packages or at least a large subset, combine `find` and `paralle
find /srv/archive/packages -mindepth 2 -maxdepth 2 -type d | parallel --bar -j16 ~/upload_pkg_internetarchive.py > result.txt
Or use:
find /srv/archive/packages -mindepth 2 -maxdepth 2 -type d -exec "/home/archive/archive-uploader/upload_pkg_internetarchive.py" {} +
The script outputs to stdout any package name it couldn't completely upload.
This may be due to archive.org load issues or rate limiting. It also maintains
a database so that you can run it again against all files. Files that have
...
...
upload_pkg_internetarchive.py
View file @
9e55ff1f
...
...
@@ -90,20 +90,21 @@ class ArchiveUploader:
raise
def
main
(
self
,
pkg_dir
):
"""Upload all versions of a single package"""
pkgname
=
os
.
path
.
basename
(
pkg_dir
)
identifier
=
self
.
clean_name
(
'archlinux_pkg_'
+
pkgname
)
metadata
=
{
'collection'
:
[
'archlinuxarchive'
],
'mediatype'
:
'software'
,
'publisher'
:
'Arch Linux'
,
'creator'
:
'Arch Linux'
,
'subject'
:
[
'archlinux'
,
'archlinux package'
],
}
metadata
[
'title'
]
=
pkgname
+
" package archive from Arch Linux"
metadata
[
'subject'
].
append
(
pkgname
)
self
.
upload_pkg
(
identifier
,
pkgname
,
metadata
,
pkg_dir
)
def
main
(
self
,
pkg_dirs
):
"""Upload all versions of each package"""
for
pkg_dir
in
pkg_dirs
:
pkgname
=
os
.
path
.
basename
(
pkg_dir
)
identifier
=
self
.
clean_name
(
'archlinux_pkg_'
+
pkgname
)
metadata
=
{
'collection'
:
[
'archlinuxarchive'
],
'mediatype'
:
'software'
,
'publisher'
:
'Arch Linux'
,
'creator'
:
'Arch Linux'
,
'subject'
:
[
'archlinux'
,
'archlinux package'
],
}
metadata
[
'title'
]
=
pkgname
+
" package archive from Arch Linux"
metadata
[
'subject'
].
append
(
pkgname
)
self
.
upload_pkg
(
identifier
,
pkgname
,
metadata
,
pkg_dir
)
if
__name__
==
'__main__'
:
ArchiveUploader
().
main
(
sys
.
argv
[
1
])
ArchiveUploader
().
main
(
sys
.
argv
[
1
:
])
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