From 213848e1c896fa13bd45900f49948d10a053de48 Mon Sep 17 00:00:00 2001 From: Matt Bacchi Date: Thu, 20 Dec 2018 15:14:49 -0700 Subject: [PATCH] Alternative patches for PR 1078 These build, install and operate as expected for issues --- ...rome-installer-linux-debian-build.sh.patch | 32 ++++++++++++++++--- ...rome-installer-linux-debian-postinst.patch | 9 +++++- .../chrome-installer-linux-rpm-build.sh.patch | 14 ++++++-- ...aller-linux-rpm-chrome.spec.template.patch | 20 ++++++++++++ 4 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 patches/chrome-installer-linux-rpm-chrome.spec.template.patch diff --git a/patches/chrome-installer-linux-debian-build.sh.patch b/patches/chrome-installer-linux-debian-build.sh.patch index dbdeccd90dd8..54dd4a396dfe 100644 --- a/patches/chrome-installer-linux-debian-build.sh.patch +++ b/patches/chrome-installer-linux-debian-build.sh.patch @@ -1,5 +1,5 @@ diff --git a/chrome/installer/linux/debian/build.sh b/chrome/installer/linux/debian/build.sh -index 306b59c138b7cb5df21ad6e9d502bb7a46a104c6..f66764e6637e5fdc882ebf4046a702f12d713354 100755 +index 306b59c138b7cb5df21ad6e9d502bb7a46a104c6..12d08fa837788bf9ed392cdd622ffc1b96a1aab9 100755 --- a/chrome/installer/linux/debian/build.sh +++ b/chrome/installer/linux/debian/build.sh @@ -21,7 +21,7 @@ gen_changelog() { @@ -20,7 +20,15 @@ index 306b59c138b7cb5df21ad6e9d502bb7a46a104c6..f66764e6637e5fdc882ebf4046a702f1 -O > "${STAGEDIR}/DEBIAN/control" rm -f "${DEB_CONTROL}" } -@@ -49,7 +49,7 @@ stage_install_debian() { +@@ -39,7 +39,6 @@ gen_control() { + prep_staging_debian() { + prep_staging_common + install -m 755 -d "${STAGEDIR}/DEBIAN" \ +- "${STAGEDIR}/etc/cron.daily" \ + "${STAGEDIR}/usr/share/menu" \ + "${STAGEDIR}/usr/share/doc/${USR_BIN_SYMLINK_NAME}" + } +@@ -49,7 +48,7 @@ stage_install_debian() { # Always use a different name for /usr/bin symlink depending on channel. # First, to avoid file collisions. Second, to make it possible to # use update-alternatives for /usr/bin/google-chrome. @@ -29,7 +37,21 @@ index 306b59c138b7cb5df21ad6e9d502bb7a46a104c6..f66764e6637e5fdc882ebf4046a702f1 local PACKAGE_ORIG="${PACKAGE}" if [ "$CHANNEL" != "stable" ]; then -@@ -92,7 +92,7 @@ verify_package() { +@@ -66,13 +65,6 @@ stage_install_debian() { + SHLIB_PERMS=644 + stage_install_common + log_cmd echo "Staging Debian install files in '${STAGEDIR}'..." +- install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/cron" +- process_template "${BUILDDIR}/installer/common/repo.cron" \ +- "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" +- chmod 755 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" +- pushd "${STAGEDIR}/etc/cron.daily/" > /dev/null +- ln -snf "${INSTALLDIR}/cron/${PACKAGE}" "${PACKAGE}" +- popd > /dev/null + process_template "${BUILDDIR}/installer/debian/debian.menu" \ + "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" + chmod 644 "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" +@@ -92,7 +84,7 @@ verify_package() { local EXPECTED_DEPENDS="${TMPFILEDIR}/expected_deb_depends" local ACTUAL_DEPENDS="${TMPFILEDIR}/actual_deb_depends" echo ${DEPENDS} | sed 's/, /\n/g' | LANG=C sort > "${EXPECTED_DEPENDS}" @@ -38,7 +60,7 @@ index 306b59c138b7cb5df21ad6e9d502bb7a46a104c6..f66764e6637e5fdc882ebf4046a702f1 grep '^ Depends: ' | sed 's/^ Depends: //' | sed 's/, /\n/g' | \ LANG=C sort > "${ACTUAL_DEPENDS}" BAD_DIFF=0 -@@ -156,9 +156,13 @@ verify_channel() { +@@ -156,9 +148,13 @@ verify_channel() { RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Stable%20updates" ;; unstable|dev|alpha ) @@ -53,7 +75,7 @@ index 306b59c138b7cb5df21ad6e9d502bb7a46a104c6..f66764e6637e5fdc882ebf4046a702f1 testing|beta ) CHANNEL=beta RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Beta%20updates" -@@ -259,6 +263,17 @@ fi +@@ -259,6 +255,17 @@ fi eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \ "${BUILDDIR}/installer/theme/BRANDING") diff --git a/patches/chrome-installer-linux-debian-postinst.patch b/patches/chrome-installer-linux-debian-postinst.patch index 883d664bda3c..93b6e8919d78 100644 --- a/patches/chrome-installer-linux-debian-postinst.patch +++ b/patches/chrome-installer-linux-debian-postinst.patch @@ -1,5 +1,5 @@ diff --git a/chrome/installer/linux/debian/postinst b/chrome/installer/linux/debian/postinst -index b284f042a0bdcc9964037ad636bd5e5fa49e7daa..8707a5b62c30508645dcea129d39597c2deef57c 100755 +index b284f042a0bdcc9964037ad636bd5e5fa49e7daa..9a87014286de83928ab60139e671f8f02b244207 100755 --- a/chrome/installer/linux/debian/postinst +++ b/chrome/installer/linux/debian/postinst @@ -49,8 +49,11 @@ update-alternatives --install /usr/bin/x-www-browser x-www-browser \ @@ -16,3 +16,10 @@ index b284f042a0bdcc9964037ad636bd5e5fa49e7daa..8707a5b62c30508645dcea129d39597c @@include@@../common/apt.include +@@ -63,6 +66,3 @@ if [ ! -e "$DEFAULTS_FILE" ]; then + echo 'repo_add_once="true"' > "$DEFAULTS_FILE" + echo 'repo_reenable_on_distupgrade="true"' >> "$DEFAULTS_FILE" + fi +- +-# Run the cron job immediately to perform repository configuration. +-nohup sh /etc/cron.daily/@@PACKAGE@@ > /dev/null 2>&1 & diff --git a/patches/chrome-installer-linux-rpm-build.sh.patch b/patches/chrome-installer-linux-rpm-build.sh.patch index 0ed44a13848a..163d51d1faba 100644 --- a/patches/chrome-installer-linux-rpm-build.sh.patch +++ b/patches/chrome-installer-linux-rpm-build.sh.patch @@ -1,5 +1,5 @@ diff --git a/chrome/installer/linux/rpm/build.sh b/chrome/installer/linux/rpm/build.sh -index 0bcd8689d45850ad539f99423fa211785db4f343..9a2d8eeb97e096db8b80aac7e26006888200e9f8 100755 +index 0bcd8689d45850ad539f99423fa211785db4f343..36e080915c22436da9f3ed8137cc6ac8338b5166 100755 --- a/chrome/installer/linux/rpm/build.sh +++ b/chrome/installer/linux/rpm/build.sh @@ -15,8 +15,9 @@ gen_spec() { @@ -13,7 +13,15 @@ index 0bcd8689d45850ad539f99423fa211785db4f343..9a2d8eeb97e096db8b80aac7e2600688 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" local PACKAGE="${PACKAGE}-${CHANNEL}" local MENUNAME="${MENUNAME} (${CHANNEL})" -@@ -108,7 +109,10 @@ do_package() { +@@ -52,6 +53,7 @@ stage_install_rpm() { + process_template "${BUILDDIR}/installer/common/rpmrepo.cron" \ + "${STAGEDIR}/etc/cron.daily/${PACKAGE}" + chmod 755 "${STAGEDIR}/etc/cron.daily/${PACKAGE}" ++ rm -rf "${STAGEDIR}/etc/cron.daily" + } + + verify_package() { +@@ -108,7 +110,10 @@ do_package() { --define "${COMPRESSION_OPT}" \ --define "__os_install_post %{nil}" \ "${SPEC}" @@ -25,7 +33,7 @@ index 0bcd8689d45850ad539f99423fa211785db4f343..9a2d8eeb97e096db8b80aac7e2600688 mv "$RPMBUILD_DIR/RPMS/$ARCHITECTURE/${PKGNAME}.${ARCHITECTURE}.rpm" \ "${OUTPUTDIR}" # Make sure the package is world-readable, otherwise it causes problems when -@@ -145,7 +149,10 @@ verify_channel() { +@@ -145,7 +150,10 @@ verify_channel() { CHANNEL=stable ;; unstable|dev|alpha ) diff --git a/patches/chrome-installer-linux-rpm-chrome.spec.template.patch b/patches/chrome-installer-linux-rpm-chrome.spec.template.patch new file mode 100644 index 000000000000..f70b07769c48 --- /dev/null +++ b/patches/chrome-installer-linux-rpm-chrome.spec.template.patch @@ -0,0 +1,20 @@ +diff --git a/chrome/installer/linux/rpm/chrome.spec.template b/chrome/installer/linux/rpm/chrome.spec.template +index 55a35677b9c46a2038cea9ac8dedf40d31a679f4..6fc903660c1eb0dbd7fca31ff1a680181d351f3b 100644 +--- a/chrome/installer/linux/rpm/chrome.spec.template ++++ b/chrome/installer/linux/rpm/chrome.spec.template +@@ -85,7 +85,6 @@ rm -rf "$RPM_BUILD_ROOT" + + # Be explicit about the files we scatter throughout the system we don't + # accidentally "own" stuff that's not ours (crbug.com/123990). +-/etc/cron.daily/@@PACKAGE@@ + %ghost %attr(755,root,root) /usr/bin/@@PACKAGE_ORIG@@ + /usr/bin/@@USR_BIN_SYMLINK_NAME@@ + /usr/share/appdata/@@PACKAGE@@.appdata.xml +@@ -158,7 +157,6 @@ fi + # not always running, which kind of defeats the purpose of having 'at' as a + # required LSB command. + service atd start +-echo "sh /etc/cron.daily/@@PACKAGE@@" | at now + 2 minute > /dev/null 2>&1 + + CHANNEL=@@CHANNEL@@ + case $CHANNEL in