Skip to content

Commit

Permalink
test build with auto removal of failed packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelospro committed Sep 5, 2023
1 parent d3f8d4c commit ff96d1d
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 31 deletions.
14 changes: 7 additions & 7 deletions dot_config/hypr/devices.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# remember about the space after the end of the device’s name (before the {)!
# remember about the space after the end of the device’s name (before the '{')!

# Enabled
# ENABLED
# laptop touchpads
device:syna7db5:00-06cb:cd41-touchpad {
natural_scroll=true
Expand All @@ -17,33 +17,33 @@ device:synaptics-tm2964-001 {
}

device:asuf1204:00-2808:0104-touchpad {
natural_scroll=false
natural_scroll=true
disable_while_typing=true
tap-to-click=true
sensitivity=0.2
}

# external mouse
# external mouses
device:usb-optical-mouse {
sensitivity=1
natural_scroll=false
}

# laptop keyboard
# laptop keyboards
device:at-translated-set-2-keyboard {
kb_layout=us,gr
kb_variant=qwerty
kb_options=grp:alt_shift_toggle,caps:escape
}

# external keyboard
# external keyboards
device:compx-2.4g-receiver {
kb_layout=us,gr
kb_variant=qwerty
kb_options=grp:alt_shift_toggle,caps:escape
}

# Disabled
# DISABLED
device:sleep-button {
enabled=0
}
Expand Down
10 changes: 2 additions & 8 deletions dot_config/hypr/env.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
# env = __GLX_VENDOR_LIBRARY_NAME,nvidia
# env = WLR_NO_HARDWARE_CURSORS,1

{{- if eq .chezmoi.hostname "ELARCH-F15" }}
# Force integrated gpu
# env = WLR_DRM_DEVICES,/dev/dri/card1
{{- end }}

# mainly for vms without gpu
env = WLR_RENDERER_ALLOW_SOFTWARE,1

# Log WLR errors and logs to the hyprland log. Recommended(but it litters the logs)
Expand All @@ -22,6 +18,7 @@ env = WLR_DRM_NO_MODIFIERS,1

# Tell XWayland to use a cursor theme
env = XCURSOR_THEME,Bibata-Modern-Amber
env = XCURSOR_SIZE,24

env = GTK_THEME,Dracula

Expand All @@ -30,9 +27,6 @@ env = MOZ_USE_XINPUT2,1
env = MOZ_ENABLE_WAYLAND,1
env = SDL_VIDEODRIVER,wayland

# Set a cursor size
env = XCURSOR_SIZE,24

env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
Expand Down
2 changes: 0 additions & 2 deletions dot_config/hypr/startup.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2

# Theming
exec-once = hyprctl setcursor Bibata-Modern-Amber 24
exec-once = /usr/bin/gnome-keyring-daemon --start --components=secrets &
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
Expand All @@ -25,7 +24,6 @@ exec-once=swaybg -o \* -i $HOME/Pictures/backgrounds/background.png -m fill
exec-once=swaync # or dunst notification daemon
exec-once=wl-paste --watch cliphist store

exec-once=$HOME/.config/hypr/scripts/default/launch_portals
exec-once=swayidle

# Applets / OSD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ script:
# Remove calamares and installer and helpers
- "-rm ${ROOT}/var/log/Calamares*"
- "-rm /usr/local/bin/installer"
- "-rm /usr/bin/local/fix-hosts"
- "-rm /usr/bin/local/fix-hosts" # for some reason /etc/hosts is broken and /etc/hostname not changed to the defined hostname...
# Re-Apply dotfiles to new user
- command: "sudo -u ${USER} chezmoi init --apply Evangelospro -R --exclude externals,encrypted"
- command: "sudo -u ${USER} cp /home/${USER}/.config/hypr/monitors_extend.conf /home/${USER}/.config/hypr/monitors.conf"
Expand Down
44 changes: 31 additions & 13 deletions iso/aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ iso_name="archiso"
iso_dir="$base_dir/$iso_name"
repo_dir="$iso_dir/custom_repos/$repo_name"
makepkg_flags="-s --skipchecksums --skippgpcheck --skipinteg --noconfirm"
failed_packages=("")

build() {
CLONE_URL=$1
PKG_PATH=$2
# clone each package without history to save space and time
git clone --depth 1 $CLONE_URL $PKG_PATH
git clone --depth 1 $CLONE_URL $PKG_PATH
# get the result of the above command if it failed with (fatal: destination path '...' already exists and is not an empty directory.)
if [ $? -ne 0 ]; then
echo "Package $PKG_PATH already exists, updating"
Expand All @@ -29,6 +30,13 @@ build() {
echo "Building $PKG_PATH as there is an update"
(cd $PKG_PATH && makepkg $makepkg_flags && repo-add "$repo_dir/$repo_name.db.tar.gz" *.pkg.tar)
sudo mv $PKG_PATH/*.pkg.tar $repo_dir
# check if the package was built successfully
if [ $? -ne 0 ]; then
echo "Package $PKG_PATH failed to build removing from packages.x86_64"
failed_packages+=("$PKG_PATH")
else
echo "Package $PKG_PATH built successfully"
fi
if [ "$conserve_space" == "conserve_space" ]; then
sudo rm -rf $PKG_PATH
fi
Expand All @@ -37,6 +45,13 @@ build() {
echo "Building $PKG_PATH as it is a new package"
(cd $PKG_PATH && makepkg $makepkg_flags && repo-add "$repo_dir/$repo_name.db.tar.gz" *.pkg.tar)
sudo mv $PKG_PATH/*.pkg.tar $repo_dir
# check if the package was built successfully
if [ $? -ne 0 ]; then
echo "Package $PKG_PATH failed to build removing from packages.x86_64"
failed_packages+=("$PKG_PATH")
else
echo "Package $PKG_PATH built successfully"
fi
if [ "$conserve_space" == "conserve_space" ]; then
sudo rm -rf $PKG_PATH
fi
Expand All @@ -52,42 +67,45 @@ if [ "$1" == "enable" ]; then

echo "Enabling local $repo_name repo"
# if repo is not defined in pacman.conf then add it
`if ! grep -q "$repo_name" "$iso_dir/pacman.conf"; then
echo -ne "\n\n[$repo_name]\n" >> "$iso_dir/pacman.conf"
echo -ne "SigLevel = Optional TrustAll\n" >> "$iso_dir/pacman.conf"
echo -ne "Server = file://"$iso_dir"/custom_repos/$repo_name\n" >> "$iso_dir/pacman.conf"
fi`
$(if ! grep -q "$repo_name" "$iso_dir/pacman.conf"; then
echo -ne "\n\n[$repo_name]\n" >>"$iso_dir/pacman.conf"
echo -ne "SigLevel = Optional TrustAll\n" >>"$iso_dir/pacman.conf"
echo -ne "Server = file://"$iso_dir"/custom_repos/$repo_name\n" >>"$iso_dir/pacman.conf"
fi)

while read repo; do
if [ "$repo" == "" ]; then
continue
fi
tokens=( $repo )
tokens=($repo)
CLONE_URL=""
PKG_PATH="packages"
if [ ${tokens[0]} == "#" ]; then
# echo "skipping commented $repo"
continue
elif [ ${tokens[0]} == "aur" ]; then
elif [ ${tokens[0]} == "aur" ]; then
PACKAGE_NAME=${tokens[1]}
echo "Cloning $PACKAGE_NAME"
CLONE_URL="$AUR_URL${tokens[1]}.git"
PKG_PATH="$PKG_PATH/${tokens[1]}"
elif [ ${tokens[0]} == "url" ]; then
elif [ ${tokens[0]} == "url" ]; then
CLONE_URL="${tokens[1]}"
PKG_PATH="$PKG_PATH/$(basename ${tokens[1]})"
else
# echo "unhandled url type"
continue
fi
build $CLONE_URL $PKG_PATH
done < "$iso_dir/all_packages.x86_64"
done <"$iso_dir/all_packages.x86_64"

cd $base_dir
# cp $repo_dir/* "$iso_dir/$repo_name"

# Remove the aur prefix and copy to packages.x86_64
cat "$iso_dir/all_packages.x86_64" | sed 's/aur //g' > "$iso_dir/packages.x86_64"
echo "Failed packages: ${failed_packages[@]}"
echo "Removing failed packages from packages.x86_64"

# Remove the aur prefix and copy to packages.x86_64 excluding failed packages
cat "$iso_dir/all_packages.x86_64" | sed '/^aur/d' | grep -v -F -f <(printf '%s\n' "${failed_packages[@]}") >"$iso_dir/packages.x86_64"
echo "AUR packages downloaded and built"
else
echo "Disabling local $repo_name repo"
Expand All @@ -96,5 +114,5 @@ else
sed -i "/\[$repo_name\]/,/Server = file:\/\/$iso_name\/custom_repos\/$repo_name/d" "$iso_dir/pacman.conf"
fi
# Remove any aur packages from packages.x86_64 by removing any line that starts with aur
cat "$iso_dir/all_packages.x86_64" | sed '/^aur/d' > "$iso_dir/packages.x86_64"
cat "$iso_dir/all_packages.x86_64" | sed '/^aur/d' >"$iso_dir/packages.x86_64"
fi

0 comments on commit ff96d1d

Please sign in to comment.