LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 05-13-2020, 08:57 AM   #16
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322

Now my new sdcard arrived today, so I set about upgrading. I have your awk programs, versions 1,2,3,&4.
This one (version 2)
Code:
#!/usr/bin/awk -f
/^(usr\/)?lib\//{
  print >FILENAME"-compat32"
  next
}
{
  print >FILENAME".nolibs"
}
This is version 2. It takes my test package, and splits it correctly, package.libs & package.nolibs. versions 3, & 4 exit silently with no error :-o.

Now I copied over an arm package directory to test. I didn't fancy large numbers of single 'mv' & 'rm' commands. I wanted wildcards. I couldn't work out how to get something like 'glibc-2.30_multilib-x86_64-1alien.nolibs' back to 'glibc-2.30_multilib-x86_64-1alien' when you're doing it one wildcard-laden instruction. I couldn't invoke your script with a wildcard. The following produced errors

../multilib2 * (from the packages directory), or
print >../packages/FILENAME".nolibs" which puked on the 1st dot before packages. Ideally, it would overwrite the packages, but I wasn't going to chance that initially. Now I could wrap it in a script, but then the three line bash alternative challenges it.

In addition, I don't want 'upgradepkg' to run it's eye over my compat32 packages, in case it's wildcards are a little too wild, if you follow my drift,
 
Old 05-13-2020, 09:10 AM   #17
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
../multilib2 * (from the packages directory), or
print >../packages/FILENAME".nolibs" which puked on the 1st dot before packages.
TBH, I don't understand how are you trying to invoke it. Maybe I wasn't clear here. The #2 was supposed to work with packages in the same directory as the script itself.

However, the version 3 from #10 as well as version 4 from #12 are supposed to be run on all the packages in /var/lib/pkgtools/packages/ as was shown in #10.

You make a directory, cd into it, run the script via xargs exactly as shown in #10 and it populates that directory with hundreds (or thousands) of *.libs and *.nolibs generated from /var/lib/pkgtools/packages/*

Last edited by shruggy; 05-13-2020 at 09:36 AM.
 
Old 05-13-2020, 10:41 AM   #18
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
OK. My bad … I'll go back & set up a mass test.
 
Old 05-13-2020, 01:50 PM   #19
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
On post #10 multilib3 nearly works as required, but I tweaked it slightly.
Code:
#!/usr/bin/awk -f
FNR==1{
  pkg=FILENAME
  sub(/.*\//, "", pkg)
  libs   = pkg "-compat32"
  nolibs = pkg ""
}
/^(usr\/)?lib\//{
  print >libs
  next
}
{
  print >nolibs
}
I was testing this in a homedir. I couldn't have the awk script near packages or it came to itself and puked. So in a noremal setting, it should be in /var/lib/pkgtools. Then I made a packages/packages directory, changed into it, and ran
Code:
ls -w 1 /full/path/name/packages/* | xargs awk  -f ../../multilib3
and in that directory came my library lists (as package-compat32 files) and an unchanged package name stripped of the libraries. That's ok, because I can use 'cp -f * ../' to overwrite the originals. Then when they are upgraded, the libraries will be in separate -compat32 packages which I can hide during the moving & upgrade, and return later. Just a tad Machiavellian, but probably safest in the long run. I'vd done enough falling on my sword to last me some time.
 
Old 05-24-2020, 02:07 PM   #20
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Curious glitch in this, as it turns out.

I tested this in /root/packages, tweaking the script slightly. I had /root/packages, & /root/packages/Compat32, with the script in /root/ So I would changeto the ~/packages/Compat32 directory, and run
Code:
ls -w 1 ../* |xargs awk -f ../../multilib3
This left libs packages named as -compat32, & nolibs packages named as the originals in /root/packages/Compat32. So I copied the nolibs to the Arm /var/log/packages, hiding the libs in packages/Compat32/, converted my 32bit install to multilib by adding a 64bit system. Then I added the Compat32 back but that effort went down in flames.

So, I started again with 32bit, got wifi up, X working, etc. XFCE sucks bad, btw. I found I couldn't convert /var/log packages any way. /var/lib/pkgtools/packages = /var/log/packages, and any command with '../' seemed to puke. I couldn't get multilib3 to run. But I converted them in /root.

I'm going to convert again, but more slowly, next week sometime. To get wifi working on the RazPi, I updated the kernel & dropped in the Raspbian firmware. I have wifi running, and I now have to spend some time farting about with firmware trying to break it and rebooting, because they're light on ideas.
 
  


Reply

Tags
awk



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] mk-slack64-multilib : A tool to create slackware64+multilib tree/iso phenixia2003 Slackware 5 12-28-2012 05:42 AM
Scripting/programming challenge Mac/PC/Linux Interoperability Ragephene Programming 11 07-29-2011 10:42 AM
upgrading slackware64 13.1 multilib to slackware64 -current multilib Cultist Slackware 4 03-12-2011 09:04 AM
[SOLVED] Broffice not compile on Slack64(multilib or no multilib);SlackBuild afreitascs Slackware 4 06-14-2010 07:16 AM
Scripting Challenge - HELP!!!! lapthorn Linux - General 2 05-20-2004 05:34 AM

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

All times are GMT -5. The time now is 08:20 PM.

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