LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-02-2023, 04:00 PM   #1
reddog83
Member
 
Registered: Apr 2018
Distribution: Slackware 15.0/Current
Posts: 461

Rep: Reputation: 237Reputation: 237Reputation: 237
gen_repo_files.sh grep errors


Quote:
cat gen_repos_files44.sh | grep grep
if [ "$(echo $PKG|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).t[blxg]z[ ]{0,}$')" == "" ];
if [ "$(echo $PKG|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).t[blxg]z[ ]{0,}$')" == "" ];
cat .PACKAGES.TXT | grep -v "PACKAGE MIRROR: " >> PACKAGES.TXT
find -L . -type f -print $PRUNES | grep -v CHECKSUMS | sort | xargs md5sum $1 2>/dev/null >> .CHECKSUMS.md5
find . -type f -print $PRUNES | grep -v CHECKSUMS | sort | xargs md5sum $1 2>/dev/null >> .CHECKSUMS.md5
GPG_FPR=$($GPGBIN --with-colon --with-fingerprint --list-keys "$REPOSOWNERGPG" |grep ^fpr |head -1 |cut -d: -f10)
if ! grep -q $GPG_FPR ${REPOSROOT}/GPG-KEY ; then
if ! grep -q $GPG_FPR ${REPOSROOT}}/${SUBDIR}/GPG-KEY ; then
packages will not be signed!
Continue? [y|N] y
grep: warning: stray \ before -
grep: warning: stray \ before -
grep: warning: stray \ before -
This is what is happening with grep 3.11 on Slackware-Current and using the gen_repo_files.sh script that Eric has made available.
 
Old 07-03-2023, 01:14 AM   #2
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 594

Rep: Reputation: Disabled
Hm, it works here on -current:
Code:
$ cat gen_repos_files.sh |grep grep
  if [ "$(echo $PKG|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).t[blxg]z[ ]{0,}$')" == "" ];
  if [ "$(echo $PKG|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).t[blxg]z[ ]{0,}$')" == "" ];
    cat .PACKAGES.TXT | grep -v "PACKAGE MIRROR: " >> PACKAGES.TXT
    find -L . -type f -print $PRUNES | grep -v CHECKSUMS | sort | xargs md5sum $1 2>/dev/null >> .CHECKSUMS.md5
    find . -type f -print $PRUNES | grep -v CHECKSUMS | sort | xargs md5sum $1 2>/dev/null >> .CHECKSUMS.md5
      GPG_FPR=$($GPGBIN --with-colon --with-fingerprint --list-keys "$REPOSOWNERGPG" |grep ^fpr |head -1 |cut -d: -f10)
        if ! grep -q $GPG_FPR ${REPOSROOT}/GPG-KEY ; then
            if ! grep -q $GPG_FPR ${REPOSROOT}}/${SUBDIR}/GPG-KEY ; then
I have 'grep-3.11-x86_64-1' package installed.
Your script is called 'gen_repos_files44.sh' so I assume you've made changes? I would check those.
 
Old 07-03-2023, 04:04 AM   #3
reddog83
Member
 
Registered: Apr 2018
Distribution: Slackware 15.0/Current
Posts: 461

Original Poster
Rep: Reputation: 237Reputation: 237Reputation: 237
K i will check thank u
 
Old 07-03-2023, 09:59 AM   #4
reddog83
Member
 
Registered: Apr 2018
Distribution: Slackware 15.0/Current
Posts: 461

Original Poster
Rep: Reputation: 237Reputation: 237Reputation: 237
Which version of the script do u by chance use??
 
Old 07-03-2023, 10:19 AM   #5
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
the latest version of the script is this.

note that the message
Code:
grep: warning: stray \ before -
like it says is just a warning and it shows because the new grep warns about non-necessary escape chars.
so you can just safely ignore it.

if you just can't stand it modify the gen_repos_files.sh script like this
Code:
--- ./gen_repos_files.sh.orig   2020-12-30 13:09:39.000000000 +0100
+++ ./gen_repos_files.sh        2023-07-03 17:08:23.369179747 +0200
@@ -281,7 +281,7 @@
   PKG=$1
   PACKAGESFILE=$2
 
-  if [ "$(echo $PKG|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).t[blxg]z[ ]{0,}$')" == "" ];
+  if [ "$(echo $PKG|grep -E '(.*{1,})-(.*[\.-].*[\.-].*).t[blxg]z[ ]{0,}$')" == "" ];
   then
     return;
   fi
@@ -371,7 +371,7 @@
   PKG=$1
   MANIFESTFILE=$2
 
-  if [ "$(echo $PKG|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).t[blxg]z[ ]{0,}$')" == "" ];
+  if [ "$(echo $PKG|grep -E '(.*{1,})-(.*[\.-].*[\.-].*).t[blxg]z[ ]{0,}$')" == "" ];
   then
     return;
   fi
 
1 members found this post helpful.
Old 07-03-2023, 10:28 AM   #6
reddog83
Member
 
Registered: Apr 2018
Distribution: Slackware 15.0/Current
Posts: 461

Original Poster
Rep: Reputation: 237Reputation: 237Reputation: 237
thank you so much @ponce I will add that patch to my gen_repo_files script.

Update: it worked now I have alot of gen_repo_files scripts to update. Thank you again @ponce.

Last edited by reddog83; 07-03-2023 at 10:32 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration