Skip to content

Commit

Permalink
Merge pull request #1097 from yast/backport_sp6
Browse files Browse the repository at this point in the history
Backport sp6
  • Loading branch information
jreidinger authored Sep 14, 2023
2 parents 8af4d14 + 5992623 commit 7b057a9
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 17 deletions.
34 changes: 26 additions & 8 deletions bin/yupdate
Original file line number Diff line number Diff line change
Expand Up @@ -584,14 +584,20 @@ module YUpdate
# the inst-sys contains the /.packages.initrd file with a list of packages
return if File.exist?("/.packages.initrd")

# live medium uses overlay FS for the root
return if `mount`.match?(/^\w+ on \/ type overlay/)
mount_out = `mount`
# live medium uses overlay FS or device mapper for the root
if mount_out.match?(/^\w+ on \/ type overlay/) ||
mount_out.match?(/^\/dev\/mapper\/live-rw on \/ /)

return
end

return if in_container?

# exit immediately if running in an installed system
warn "ERROR: This script can only work in the installation system (inst-sys), " \
"live medium or in a container!"
warn "If you are sure it is OK to use the script add the --force option."
exit 1
end

Expand Down Expand Up @@ -620,16 +626,23 @@ module YUpdate
# parse the command line options
class Options
def self.parse(argv)
force = argv.include?("--force")
if force
argv.delete("--force")
# pass the force option to the executed scripts
ENV["YUPDATE_FORCE"] = "1"
end

command = argv.shift

case command
when "version"
VersionCommand.new
when "overlay"
System.check!
System.check! unless force
OverlayCommand.new(argv)
when "patch"
System.check!
System.check! unless force
PatchCommand.new(argv)
when "servers"
ServersCommand.new(argv)
Expand Down Expand Up @@ -704,7 +717,9 @@ module YUpdate
# add the default "yast" GitHub organization if missing
repo = "yast/#{repo}" unless repo.include?("/")
downloader = GithubDownloader.new(repo, branch)
install_tar(downloader)
# the GitHub tarballs have all content in a "<repo>-<branch>" subdirectory
dir = repo.split("/", 2).last + "-" + branch
install_tar(downloader, dir)
end

def install_from_tar(url)
Expand Down Expand Up @@ -753,12 +768,15 @@ module YUpdate
raise "Script #{File.basename(script)} failed" unless system(script)
end

def install_tar(downloader)
# extract the tarball into a temporary directory and install it
# @param downloader the downloader to use
# @param subdir subdirectory in the source tarball
def install_tar(downloader, subdir = "")
Dir.mktmpdir do |download_dir|
downloader.extract_to(download_dir)
run_pre_script(download_dir)
run_pre_script(File.join(download_dir, subdir))
install_sources(download_dir)
run_post_script(download_dir)
run_post_script(File.join(download_dir, subdir))
end
end

Expand Down
45 changes: 40 additions & 5 deletions package/yast2-installation.changes
Original file line number Diff line number Diff line change
@@ -1,21 +1,56 @@
-------------------------------------------------------------------
Fri Sep 01 19:57:03 UTC 2023 - Josef Reidinger <jreidinger@suse.com>
Tue Aug 15 08:42:50 UTC 2023 - Stefan Hundhammer <shundhammer@suse.com>

- Branch package for SP6 (bsc#1208913)
- Require awk for use in startup scripts (bsc#1214277)
- 4.6.7

-------------------------------------------------------------------
Fri Aug 4 07:09:13 UTC 2023 - Michal Filka <[email protected]>

- bsc#1213959
- Change status label properly when toggling status in the
"Previousy used repositories" dialog.
- 4.6.6

-------------------------------------------------------------------
Tue Jul 11 07:20:29 UTC 2023 - Ladislav Slezák <[email protected]>

- Fixed yupdate script to properly run pre/post scripts
when patching from GitHub (bsc#1213197)
- 4.6.5

-------------------------------------------------------------------
Thu Jun 15 15:01:13 UTC 2023 - Stefan Hundhammer <[email protected]>

- Don't always enable sshd and open the ssh port (bsc#1211764)
- 4.5.17
- 4.6.4

-------------------------------------------------------------------
Thu May 11 16:44:38 UTC 2023 - Stefan Hundhammer <[email protected]>

- Use a larger font for xterm during installation via X resources
(bsc#1211267)
Details: https://github.com/yast/yast-installation/pull/1085
4.6.3

-------------------------------------------------------------------
Mon Apr 3 12:04:23 UTC 2023 - Ladislav Slezák <[email protected]>

- yupdate - improved Live ISO detection, added "--force" option
(related to bsc#1206927)
- 4.6.2

-------------------------------------------------------------------
Mon Mar 13 08:35:59 UTC 2023 - Ladislav Slezák <[email protected]>
Mon Mar 13 08:49:20 UTC 2023 - Ladislav Slezák <[email protected]>

- Removed unnecessary executable flag from file security_proposal.rb
(bsc#1209094)
- 4.5.16
- 4.6.1

-------------------------------------------------------------------
Fri Mar 03 14:44:07 UTC 2023 - Ladislav Slezák <[email protected]>

- Bump version to 4.6.0 (bsc#1208913)

-------------------------------------------------------------------
Wed Jan 25 19:56:12 UTC 2023 - Knut Anderssen <[email protected]>
Expand Down
4 changes: 3 additions & 1 deletion package/yast2-installation.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-installation
Version: 4.6.0
Version: 4.6.7
Release: 0
Summary: YaST2 - Installation Parts
License: GPL-2.0-only
Expand Down Expand Up @@ -58,6 +58,8 @@ Requires: coreutils
Requires: gzip
# use in startup scripts
Requires: initviocons
# bsc#1214277; require awk, not gawk, to allow for lighterweight alternatives like busybox
Requires: awk
# Needed call /sbin/ip in vnc.sh/network.sh
Requires: iproute2
# for the first/second stage of installation
Expand Down
4 changes: 2 additions & 2 deletions src/lib/installation/clients/inst_upgrade_urls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ def repo_action(status)
when :removed
# TRANSLATORS: The action to perform with a repository
_("Remove")
when :disable
when :disabled
# TRANSLATORS: The action to perform with a repository
_("Disable")
when :enable
when :enabled
# TRANSLATORS: The action to perform with a repository
_("Enable")
else
Expand Down
66 changes: 65 additions & 1 deletion startup/YaST2.call
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,66 @@ function set_qt_scale_factor () {
}


function calculate_xterm_font_size() {
#------------------------------------------------------
# Calculate an appropriate font size for xterm based on the DPI
# ($1) and set XTERM_FONT_SIZE accordingly.
# ---

if [ -n "$XTERM_FONT_SIZE" ]; then
# Enable overriding the xterm font size from the command line or
# from an installation ISO boot parameter:
#
# Either boot the installation ISO with something like
#
# XTERM_FONT_SIZE=21
#
# (which will end up in the environment)
# or start this script in DPI debugging mode with
#
# FAKE_MON_WIDTH_MM=200 XTERM_FONT_SIZE=21 ./YaST2.call
log "\tUsing XTERM_FONT_SIZE from environment: ${XTERM_FONT_SIZE}"
return
fi

local DPI=${1:-96}

if [ ${DPI:-0} -le 96 ]; then
XTERM_FONT_SIZE=10
elif [ $DPI -le 192 ]; then
XTERM_FONT_SIZE=12
else
XTERM_FONT_SIZE=14
fi

export XTERM_FONT_SIZE
log "\tXTERM_FONT_SIZE: $XTERM_FONT_SIZE for $DPI dpi"
}


function add_x11_resources() {
#------------------------------------------------------
# Add some X resources for xterm to /root/.Xdefaults
#
# Notice that this file is only used if nothing has been
# loaded into the X server with 'xrdb' yet.
# ---

local RESOURCE_FILE=/root/.Xdefaults
XTERM_FONT_SIZE=${XTERM_FONT_SIZE:-12}
log "\tAdding X resources for xterm to $RESOURCE_FILE"

cat >>$RESOURCE_FILE <<EOF
! Fonts for xterm during a YaST Qt UI installation
! (You can start an xterm with Ctrl-Shift-Alt X)
XTerm*faceName: DejaVu Sans Mono
XTerm*faceSize: $XTERM_FONT_SIZE
EOF
}


function prepare_for_x11 () {
#------------------------------------------------------
# prepare X11 installation
Expand All @@ -201,6 +261,8 @@ function prepare_for_x11 () {
local DPI=`calculate_x11_dpi`
# set_xft_dpi $DPI
set_qt_scale_factor $DPI
calculate_xterm_font_size $DPI
add_x11_resources
fi
fi

Expand Down Expand Up @@ -618,7 +680,9 @@ if [ -n "$FAKE_MON_WIDTH_MM" ]; then
DPI=`calculate_x11_dpi`
echo "DPI: $DPI"
set_qt_scale_factor $DPI
env | grep "^QT_SCALE"
calculate_xterm_font_size $DPI
env | grep -E "^(QT_SCALE|XTERM)"
# add_x11_resources
echo "Done."
exit 1
fi
Expand Down

0 comments on commit 7b057a9

Please sign in to comment.