Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] rpm/build.sh failed due to sed usage #1509

Closed
Letty5411 opened this issue Jun 12, 2018 · 2 comments · Fixed by #1519
Closed

[bug] rpm/build.sh failed due to sed usage #1509

Letty5411 opened this issue Jun 12, 2018 · 2 comments · Fixed by #1519
Assignees
Labels
kind/bug This is bug report for project

Comments

@Letty5411
Copy link
Contributor

Ⅰ. Issue Description

build rpm failed with error message:

+ git clone -b stable-2.0 https://github.com/lxc/lxcfs.git
Cloning into 'lxcfs'...
remote: Counting objects: 1821, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 1821 (delta 11), reused 16 (delta 7), pack-reused 1796
Receiving objects: 100% (1821/1821), 760.33 KiB | 265.00 KiB/s, done.
Resolving deltas: 100% (1035/1035), done.
+ cd lxcfs
++ uniq
++ awk -F: '{print $1}'
++ grep -r liblxcfs .
+ sed -i s/liblxcfs/libpouchlxcfs/g './tests/main.sh
./tests/test_reload.sh
./lxcfs.c
./Makefile.am
./bindings.c'
sed: can't read ./tests/main.sh
./tests/test_reload.sh
./lxcfs.c
./Makefile.am
./bindings.c: No such file or directory

This should fix as following:

# git diff
diff --git a/hack/package/rpm/build.sh b/hack/package/rpm/build.sh
index 12bbf82..4fa5f3a 100755
--- a/hack/package/rpm/build.sh
+++ b/hack/package/rpm/build.sh
@@ -37,11 +37,12 @@ VENDOR='Pouch'
 # build lxcfs
 function build_lxcfs ()
 {
+       set -x
     pushd "$LXC_DIR"
     git clone -b "$LXC_BRANCH" https://github.com/lxc/lxcfs.git && cd lxcfs

     # change liblxcfs.so to libpouchlxcfs.so
-    sed -i 's/liblxcfs/libpouchlxcfs/g' "$(grep -r "liblxcfs" . |awk -F':' '{print $1}'|uniq )"
+    sed -i 's/liblxcfs/libpouchlxcfs/g' $(grep -r "liblxcfs" . |awk -F':' '{print $1}'|uniq )
     ./bootstrap.sh > /dev/null 2>&1
     ./configure > /dev/null 2>&1
     make install DESTDIR="$LXC_DIR" > /dev/null 2>&1

However this usage will trigger the shell CI failed.

Ⅱ. Describe what happened

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • pouch version (use pouch version):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@pouchrobot pouchrobot added the kind/bug This is bug report for project label Jun 12, 2018
@allencloud
Copy link
Collaborator

cc @zhuangqh
Could you help to take a look at this? Since I think it was introduced by shellcheck.

@fuweid
Copy link
Contributor

fuweid commented Jun 12, 2018

Since we use "", the sed considers ./tests/main.sh ./tests/test_reload.sh ./lxcfs.c ./Makefile.am ./bindings.c as one file. However, we can use xargs to make the command clear than before. @Letty5411 @zhuangqh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants