Skip to content

Instantly share code, notes, and snippets.

@CzBiX
Last active June 6, 2021 07:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CzBiX/e64256b23687bb13da02 to your computer and use it in GitHub Desktop.
Save CzBiX/e64256b23687bb13da02 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Author: CzBiX
# URL: https://gist.github.com/CzBiX/e64256b23687bb13da02
# Support only Ubuntu 16.04
DEST_PACKAGE="libglib2.0-0"
DEST_VERSION="2.48.1-1~ubuntu16.04.1"
DEST_FILE="/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.1"
PATCH_DATA="f626c: eb"
SUCCESS_MSG="Please quit nautilus with 'nautilus -q' to make sure patch worked."
function failed {
echo >&2 $1;
exit 1;
}
[ $(arch) == 'x86_64' ] || failed "only support x86_64."
type xxd >/dev/null 2>&1 || failed "xxd not found, please install vim."
[ $(apt-cache policy $DEST_PACKAGE | grep Installed | cut -d ' ' -f 4) == $DEST_VERSION ] || failed "$DEST_PACKAGE version not match with '$DEST_VERSION'."
echo $PATCH_DATA | sudo xxd -r - $DEST_FILE || failed "patch failed."
echo $SUCCESS_MSG
@CzBiX
Copy link
Author

CzBiX commented Nov 11, 2016

@Sadi58 Sorry, but the steps are hard to teach if you are not developer.
@AntoniosHadji compile source without debian/patches/0001-Fix-trashing-on-overlayfs.patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment