Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aur-parallel-upgrade
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
aur-parallel-upgrade
Commits
2571b48d
There was an error fetching the commit references. Please try again later.
Commit
2571b48d
authored
4 years ago
by
Bensong Liu
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix
parent
26dda297
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+24
-1
24 additions, 1 deletion
README.md
aur-parallel-upgrade.sh
+42
-3
42 additions, 3 deletions
aur-parallel-upgrade.sh
config.sh
+3
-0
3 additions, 0 deletions
config.sh
with
69 additions
and
4 deletions
README.md
+
24
−
1
View file @
2571b48d
TODO: filter not done
# Upgrade your AUR packages in parallel
Building is slow, downloading is also slow. Why not build everything in parallel to overlap CPU-heavy tasks, Network-heavy tasks, and IO-heavy tasks?
## Configure
Modify config.sh, and set
`aurpar_config_threads`
,
`aurpar_config_aur_manager`
and
`aurpar_aur_user`
.
You may have a look at other options below, but I don't think you're interested in them.
## Usage
```
bash
sudo
./aur-parallel-upgrade.sh
```
## FAQ
-
Multiple tasks printing texts at the same time and my terminal messed up!
If you want to avoid the cross-talking, please remove
`--line-buffer`
from
`aur-parallel-upgrade.sh`
.
This diff is collapsed.
Click to expand it.
aur-parallel-upgrade.sh
+
42
−
3
View file @
2571b48d
...
@@ -25,8 +25,12 @@ source "$my_path/config.sh"
...
@@ -25,8 +25,12 @@ source "$my_path/config.sh"
function
_aurpar_do_install
()
{
function
_aurpar_do_install
()
{
# do_install $package_name
# do_install $package_name
# NO input, outputs to stderr.
# NO input, outputs to stderr.
echo
"AURPAR> Issue new job:
$1
"
1>&2
sudo
-u
"
$aurpar_aur_user
"
yaourt
-S
--noconfirm
"
$1
"
1>&2
sudo
-u
"
$aurpar_aur_user
"
yaourt
-S
--noconfirm
"
$1
"
1>&2
return
$?
ret
=
$?
echo
"AURPAR> Job exited:
$1
, status=
$ret
"
1>&2
return
$ret
}
}
function
get_package_list
()
{
function
get_package_list
()
{
...
@@ -44,17 +48,52 @@ function get_package_list () {
...
@@ -44,17 +48,52 @@ function get_package_list () {
fi
fi
}
}
function
get_package_list_with_filter
()
{
# NO input, NO arg. Result outputs to stdout, seprated by '\n'
list
=
`
get_package_list
`
||
return
$?
while
read
-r
blacklist
;
do
list
=
`
echo
"
$list
"
|
grep
-vE
"^(aur/)?
$blacklist
$"
`
done
<<<
"
$aurpar_config_package_blacklist
"
echo
$list
return
$?
}
pkgs
=
`
get_package_list
`
||
{
echo
"Failed to get package list. Exiting..."
1>&2
;
exit
$?
;
}
pkgs
=
`
get_package_list
`
||
{
echo
"Failed to get package list. Exiting..."
1>&2
;
exit
$?
;
}
echo
"============ Packages to UPGRADE: "
echo
"============ Packages to UPGRADE: "
echo
"
$pkgs
"
echo
"
$pkgs
"
pkgs
=
`
get_package_list_with_filter
`
||
{
echo
"Failed to get package list. Exiting..."
1>&2
;
exit
$?
;
}
echo
"============ Jobs to issue: "
echo
"
$pkgs
"
read
-p
"Start the upgrade? [y/N] "
-n
1
-r
[[
$REPLY
=
~ ^[Yy]
$
]]
||
{
echo
"User give up the upgrade. "
1>&2
;
exit
0
;
}
export
-f
_aurpar_do_install
export
-f
_aurpar_do_install
export
aurpar_aur_user
export
aurpar_aur_user
echo
"
$pkgs
"
|
SHELL
=
$(
type
-p
bash
)
PATH
=
"
$my_path
:
$PATH
"
parallel
--max-procs
"
$aurpar_config_threads
"
_aurpar_do_install
'{}'
||
echo
"Done. But some package failed to upgrade. "
1>&2
echo
"
$pkgs
"
|
SHELL
=
$(
type
-p
bash
)
PATH
=
"
$my_path
:
$PATH
"
parallel
--line-buffer
--max-procs
"
$aurpar_config_threads
"
_aurpar_do_install
'{}'
||
echo
"Done. But some package failed to upgrade. "
1>&2
exit
0
exit
0
############ notes
############ notes
############################
# list packages:
# list packages:
echo
n | yaourt
-Su
--aur
2>/dev/null |
sed
's/\r/\n/g'
|
grep
'^aur/'
echo
n | yaourt
-Su
--aur
2>/dev/null |
sed
's/\r/\n/g'
|
grep
'^aur/'
pakku
-Syup
|
grep
aur.archlinux.org |
sed
's/^.*aur.archlinux.org.//g'
|
sed
's/.git$//g'
pakku
-Syup
|
grep
aur.archlinux.org |
sed
's/^.*aur.archlinux.org.//g'
|
sed
's/.git$//g'
# old code
+function get_tasks_list_impl
()
{
+
if
[[
"
$aurpar_config_aur_manager
"
=
"yaourt"
]]
;
then
+
echo
n | yaourt
-Su
--aur
2>/dev/null |
sed
's/\r/\n/g'
|
grep
'^aur/'
+
elif
[[
"
$aurpar_config_aur_manager
"
=
"pakku"
]]
;
then
+ pakku
-Syup
|
grep
aur.archlinux.org |
sed
's/^.*aur.archlinux.org.//g'
|
sed
's/.git$//g'
+
else
+
echo
"Unsupported AUR helper:
$aurpar_config_aur_manager
. Don't know how to retrive package list. exiting..."
+
exit
2
+
fi
+
}
+function get_tasks_list
()
{
+
}
This diff is collapsed.
Click to expand it.
config.sh
+
3
−
0
View file @
2571b48d
...
@@ -54,5 +54,8 @@ aurpar_config_package_blacklist=(
...
@@ -54,5 +54,8 @@ aurpar_config_package_blacklist=(
# wps-office
# wps-office
wps-office-mime
wps-office-mime
# frpc
frps
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment