Skip to contentSkip to conversation

oe-layersetup.sh: Fix printf error if repo uri has space

PATCH Applied Ankur Tyagi 2 participants 3 messages Jul 25, 2019 – Jul 30, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oe-layersetup.sh: Fix printf error if repo uri has space

If repo uri has space, then url will have '%20'
and script gives follwoing error
bash: printf: 'M': invalid format character

---
 oe-layertool-setup.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
oe-layertool-setup.sh +3 -3
index 5a0175d..d14ed4f 100755
@@ -276,12 +276,12 @@ configure_repo() {
 
     # Check if the repo with $name was already seen.  Use the , at the end
     # of the grep to avoid matching similar named repos.
-    temp=`printf "$output\n" | grep -e "^$name,"`
+    temp=`printf '%s\n' $output | grep -e "^$name,"`
 
     if [ "x$temp" != "x" ]
     then
         echo "This repository ($name) has already been configured with the following values:"
-        printf "\t$temp\n"
+        printf '\t%s\n' $temp
         echo "Skipping configuring duplicate repository"
         return 1
     fi
@@ -928,7 +928,7 @@ then
     then
         mkdir -p $dir
     fi
-    printf "$output\n" > $outputfile
+    printf '%s\n' $output > $outputfile
     echo "Output file is $outputfile"
 fi
 
Signature · 1 line
2.17.1
#1 lore raw

ping

regards
Ankur

Quoted 41 lines · Ankur Tyagi

If repo uri has space, then url will have '%20'
and script gives follwoing error
bash: printf: 'M': invalid format character

---
 oe-layertool-setup.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
oe-layertool-setup.sh +3 -4
index 5a0175d..d14ed4f 100755
@@ -276,12 +276,12 @@ configure_repo() {
 
     # Check if the repo with $name was already seen.  Use the , at the end
     # of the grep to avoid matching similar named repos.
-    temp=`printf "$output\n" | grep -e "^$name,"`
+    temp=`printf '%s\n' $output | grep -e "^$name,"`
 
     if [ "x$temp" != "x" ]
     then
         echo "This repository ($name) has already been configured with the following values:"
-        printf "\t$temp\n"
+        printf '\t%s\n' $temp
         echo "Skipping configuring duplicate repository"
         return 1
     fi
@@ -928,7 +928,7 @@ then
     then
         mkdir -p $dir
     fi
-    printf "$output\n" > $outputfile
+    printf '%s\n' $output > $outputfile
     echo "Output file is $outputfile"
 fi
 
--

2.17.1

#2 lore raw

Merged, thanks!

Quoted 51 lines · Ankur Tyagi

ping

regards
Ankur

Quoted 39 lines · Ankur Tyagi

If repo uri has space, then url will have '%20'
and script gives follwoing error
bash: printf: 'M': invalid format character

---
 oe-layertool-setup.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
oe-layertool-setup.sh +3 -4
index 5a0175d..d14ed4f 100755
@@ -276,12 +276,12 @@ configure_repo() {
 
     # Check if the repo with $name was already seen.  Use the , at the end
     # of the grep to avoid matching similar named repos.
-    temp=`printf "$output\n" | grep -e "^$name,"`
+    temp=`printf '%s\n' $output | grep -e "^$name,"`
 
     if [ "x$temp" != "x" ]
     then
         echo "This repository ($name) has already been configured with the following values:"
-        printf "\t$temp\n"
+        printf '\t%s\n' $temp
         echo "Skipping configuring duplicate repository"
         return 1
     fi
@@ -928,7 +928,7 @@ then
     then
         mkdir -p $dir
     fi
-    printf "$output\n" > $outputfile
+    printf '%s\n' $output > $outputfile
     echo "Output file is $outputfile"
 fi
 
--
Quoted 2 lines

2.17.1

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago