[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Arch Linux: run more commands as root
Holger Levsen
gitlab at salsa.debian.org
Sat Jan 12 20:38:39 GMT 2019
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
d925daa0 by Holger Levsen at 2019-01-12T20:38:31Z
reproducible Arch Linux: run more commands as root
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/reproducible_setup_archlinux_schroot.sh
Changes:
=====================================
bin/reproducible_setup_archlinux_schroot.sh
=====================================
@@ -91,7 +91,7 @@ echo "Setting up schroot $TARGET on $HOSTNAME"...
echo "============================================================================="
# configure proxy everywhere
-tee $SCHROOT_BASE/$TARGET/etc/profile.d/proxy.sh <<-__END__
+sudo tee $SCHROOT_BASE/$TARGET/etc/profile.d/proxy.sh <<-__END__
export http_proxy=$http_proxy
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
@@ -100,12 +100,11 @@ tee $SCHROOT_BASE/$TARGET/etc/profile.d/proxy.sh <<-__END__
export FTP_PROXY=$http_proxy
export no_proxy="localhost,127.0.0.1"
__END__
-chmod 755 $SCHROOT_BASE/$TARGET/etc/profile.d/proxy.sh
-sed -i "s|^#XferCommand = /usr/bin/curl |XferCommand = /usr/bin/curl --proxy $http_proxy |" "$SCHROOT_BASE/$TARGET/etc/pacman.conf"
-
+sudo chmod +x $SCHROOT_BASE/$TARGET/etc/profile.d/proxy.sh
+$ROOTCMD sed -i "s|^#XferCommand = /usr/bin/curl |XferCommand = /usr/bin/curl --proxy $http_proxy |" "$SCHROOT_BASE/$TARGET/etc/pacman.conf"
# configure root user to use this for shells and login shells…
-echo ". /etc/profile.d/proxy.sh" | tee -a $SCHROOT_BASE/$TARGET/root/.bashrc
+echo ". /etc/profile.d/proxy.sh" | sudo tee -a $SCHROOT_BASE/$TARGET/root/.bashrc
# configure pacman
$ROOTCMD bash -l -c 'pacman-key --init'
@@ -113,11 +112,11 @@ $ROOTCMD bash -l -c 'pacman-key --populate archlinux'
# use a specific mirror
echo "Server = $ARCHLINUX_MIRROR/\$repo/os/\$arch" | tee -a $SCHROOT_BASE/$TARGET/etc/pacman.d/mirrorlist
# enable multilib (by uncommenting the first two lines starting with the [multilib] section header)
-sed -i '/\[multilib\]/,+1{s/^#//}' $SCHROOT_BASE/$TARGET/etc/pacman.conf
+$ROOTCMD sed -i '/\[multilib\]/,+1{s/^#//}' $SCHROOT_BASE/$TARGET/etc/pacman.conf
if [ "$HOSTNAME" = "profitbricks-build4-amd64" ] ; then
# disable signature verification so packages won't fail to install when setting the time to +$x years
- sed -i -E 's/^#?SigLevel\s*=.*/SigLevel = Never/g' "$SCHROOT_BASE/$TARGET/etc/pacman.conf"
- sed -i "/^XferCommand = /{s|/usr/bin/curl |/usr/bin/curl --insecure |}" "$SCHROOT_BASE/$TARGET/etc/pacman.conf"
+ $ROOTCMD sed -i -E 's/^#?SigLevel\s*=.*/SigLevel = Never/g' "$SCHROOT_BASE/$TARGET/etc/pacman.conf"
+ $ROOTCMD sed -i "/^XferCommand = /{s|/usr/bin/curl |/usr/bin/curl --insecure |}" "$SCHROOT_BASE/$TARGET/etc/pacman.conf"
fi
echo "============================================================================="
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/d925daa0c0ea3652720a5554790bc820ddbe3812
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/d925daa0c0ea3652720a5554790bc820ddbe3812
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20190112/4e30b0b5/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list