Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
devtools
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archlinux
devtools
Commits
97a2d241
Commit
97a2d241
authored
12 years ago
by
Pierre Schmitz
Browse files
Options
Downloads
Patches
Plain Diff
mkarchroot: Fix creation of btrfs snapshot and remove force option
parent
eebfd9a3
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
bash_completion.in
+1
-1
1 addition, 1 deletion
bash_completion.in
mkarchroot.in
+7
-13
7 additions, 13 deletions
mkarchroot.in
zsh_completion.in
+0
-1
0 additions, 1 deletion
zsh_completion.in
with
8 additions
and
15 deletions
bash_completion.in
+
1
−
1
View file @
97a2d241
...
...
@@ -53,7 +53,7 @@ _mkarchroot() {
case $cur in
-*)
COMPREPLY=( $( compgen -W '-C -M -c
-f
-h -n -r -u' -- "$cur" ) )
COMPREPLY=( $( compgen -W '-C -M -c -h -n -r -u' -- "$cur" ) )
;;
*)
_filedir
...
...
This diff is collapsed.
Click to expand it.
mkarchroot.in
+
7
−
13
View file @
97a2d241
...
...
@@ -12,7 +12,6 @@ m4_include(lib/common.sh)
CHROOT_VERSION
=
'v3'
FORCE
=
'n'
RUN
=
''
NOCOPY
=
'n'
...
...
@@ -26,7 +25,6 @@ usage() {
echo
' options:'
echo
' -r <app> Run "app" within the context of the chroot'
echo
' -u Update the chroot via pacman'
echo
' -f Force overwrite of files in the working-dir'
echo
' -C <file> Location of a pacman config file'
echo
' -M <file> Location of a makepkg config file'
echo
' -n Do not copy config files into the chroot'
...
...
@@ -39,7 +37,6 @@ while getopts 'r:ufnhC:M:c:' arg; do
case
"
${
arg
}
"
in
r
)
RUN
=
"
$OPTARG
"
;;
u
)
RUN
=
'pacman -Syu --noconfirm'
;;
f
)
FORCE
=
'y'
;;
C
)
pac_conf
=
"
$OPTARG
"
;;
M
)
makepkg_conf
=
"
$OPTARG
"
;;
n
)
NOCOPY
=
'y'
;;
...
...
@@ -152,18 +149,18 @@ if [[ -n $RUN ]]; then
# }}}
else
# {{{ build chroot
if
[[
-e
$working_dir
&&
$FORCE
=
'n'
]]
;
then
die
"Working directory '
${
working_dir
}
' already exists
- try using -f
"
if
[[
-e
$working_dir
]]
;
then
die
"Working directory '
${
working_dir
}
' already exists"
fi
if
[[
!
-d
"
${
working_dir
}
"
]]
;
then
mkdir
-p
"
${
working_dir
}
"
fi
mkdir
-p
"
${
working_dir
}
"
if
[[
"
$(
stat
-f
-c
%T
"
${
working_dir
}
"
)
"
==
btrfs
]]
;
then
if
{
type
-P
btrfs
&&
btrfs subvolume create
"
${
working_dir
}
"
;
}
&>/dev/null
;
then
chmod
0755
"
${
working_dir
}
"
rmdir
"
${
working_dir
}
"
if
!
btrfs subvolume create
"
${
working_dir
}
"
;
then
die
"Couldn't create subvolume for '
${
working_dir
}
'"
fi
chmod
0755
"
${
working_dir
}
"
fi
chroot_lock
...
...
@@ -173,9 +170,6 @@ else
pacargs+
=(
"--config=
${
pac_conf
}
"
)
fi
if
[[
$FORCE
=
'y'
]]
;
then
pacargs+
=(
"--force"
)
fi
if
!
pacstrap
-GMcd
"
${
working_dir
}
"
"
${
pacargs
[@]
}
"
"
$@
"
;
then
die
'Failed to install all packages'
fi
...
...
This diff is collapsed.
Click to expand it.
zsh_completion.in
+
0
−
1
View file @
97a2d241
...
...
@@ -42,7 +42,6 @@ _makechrootpkg_args=(
_mkarchroot_args
=(
'-r[Run a program within the context of the chroot]:app'
'-u[Update the chroot via pacman]'
'-f[Force overwrite of files in the working-dir]'
'-C[Location of a pacman config file]:pacman_config:_files'
'-M[Location of a makepkg config file]:makepkg_config:_files'
'-n[Do not copy config files into the chroot]'
...
...
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