linux:using_diff_and_patch

文書の過去の版を表示しています。


diff と patch の使い方...🤔

$ diff -u0 --label build.sh --label build.sh --color=auto build.sh.org build.sh

--- build.sh
+++ build.sh
@@ -1 +1 @@
-#!/bin/sh
+#!/bin/sh -x
@@ -161,2 +161,2 @@
-        yum update -y
-        yum install -y epel-release 
+        sudo yum update -y
+        
@@ -164 +164,3 @@
-        if echo $output | grep " 7."; then
+        if echo $output | grep "Fedora"; then
+            OSTYPE=FEDORA
+        elif echo $output | grep " 7."; then
@@ -171,0 +174,4 @@
+        if [ ! "${OSTYPE}" = "FEDORA" ] ; then
+            sudo yum install -y epel-release
+        fi
+        
@@ -187,3 +193,3 @@
-        elif [ "${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then
-            dnf -y groupinstall "Development Tools"
-
+        #elif [ "${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then
+        elif [ "${OSTYPE}" = "FEDORA" ] || ["${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then
+            sudo dnf -y groupinstall "Development Tools"
@@ -195 +201 @@
-        yum -y install git cmake
+        sudo yum -y install git cmake
@@ -198 +204 @@
-        yum -y install libtool autoconf autoheader automake wget go clang patch expat-devel
+        sudo yum -y install libtool autoconf automake wget golang clang patch expat-devel
@@ -506 +512,2 @@
-    git clone https://github.com/litespeedtech/third-party.git
+    git clone --depth 1 https://github.com/litespeedtech/third-party.git
+    patch -p0 < third-party-scripts.patch

GNU diff utilities - News: diffutils-3.4 released [stable] [Savannah]

NEWS

* Noteworthy changes in release 3.4 (2016-08-08) [stable]

** New features

   diff accepts two new options --color and --palette to generate
   and configure colored output.  --color takes an optional argument
   specifying when to colorize a line: --color=always, --color=auto,
   --color=never.  --palette is used to configure which colors are used.
ニュース👀

* リリース 3.4 (2016-08-08) [安定版] の注目すべき変更点

** 新機能😻

   diff は、2 つの新しいオプション --color と --palette を受け入れて、色付きの出力を
   生成および構成します😃 --color は、線をいつ色付けするかを指定するオプションの引数を
   取ります: --color=always、--color=auto、--color=never🤤 --palette を使用して、使用
   する色を構成します🤔
  • linux/using_diff_and_patch.1664566836.txt.gz
  • 最終更新: 2022/10/01 04:40
  • by ともやん