makesfs for AUR

Programming issues and discussion
Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

makesfs for AUR

Postby Scooby » 04 Oct 2013, 22:34

I wanted to turn AUR packages into sfs-files.
Compare makesfs for pacman and repo.

I modified three files. packer, arch2sfs and makesfs.
To avoid conflicts I renamed them packer2, arch2sfs2 and makesfs2.

AURmakeSFS.tar.gz
Archive with packer2, arch2sfs2 and makesfs2. Extract to / if you want them in /usr/bin.
(9.01 KiB) Downloaded 539 times


packer was modified to take parameter --buildonly.
With this flag set package and dependencies are built but after execution are uninstalled.

arch2sfs was only slighltly changed concerning naming of resulting sfs file.

makesfs was adjusted so output of packer2 could be used by arch2sfs2.

Limited testing only but worked for emendo and jacal

Try and tell me what you think!
.

smil99
Proficient
Posts: 73
Joined: 14 Sep 2013, 13:37

Re: makesfs for AUR

Postby smil99 » 05 Oct 2013, 04:32

Downloaded and tested it by making an sfs-file of Zekr. Everything works just fine :)
Used to go the dir2sfs route for making sfs-files of AUR packages but your method automates every step seamlessly. Thanks and cheers.

simargl
Site Admin
Posts: 466
Joined: 16 May 2013, 10:54
Contact:

Re: makesfs for AUR

Postby simargl » 05 Oct 2013, 09:08

Thanks Scooby, this is great idea, I will do some more testing and include this as standard in next version. It's good that we can use same script for AUR and official repositories when makesfs calls for packer, instead of pacman.

john3voltas
Expert
Posts: 266
Joined: 19 May 2013, 21:53

Re: makesfs for AUR

Postby john3voltas » 05 Oct 2013, 11:04

Ah!!! This is a great addition Scooby. Much easier now.
Thanks mate. I'll have to try ums (Universal Media Server) with it.
Cheers

simargl
Site Admin
Posts: 466
Joined: 16 May 2013, 10:54
Contact:

Re: makesfs for AUR

Postby simargl » 08 Oct 2013, 17:57

I made this small change,

Code: Select all

-packer -S $LIST --buildonly --noconfirm
+pacman -Sw $LIST
+if [ $? -ne 0 ]; then
+  packer -S $LIST --buildonly --noconfirm
+  [ $? -ne 0 ] && exit 1
+fi

makesfs script will first try to use pacman and will ask for confirmation before starting packages download

if package is not found in official repository, then will use packer to build and install packages, then remove that package and dependencies and finally make sfs module.

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: makesfs for AUR

Postby Scooby » 08 Oct 2013, 20:45

My iniial reaction was that packer should handle both cases.

1. A list of packages from official packagage database
2. A mixed list of AUR targets and packages from official packagage database

For example I tried to do

Code: Select all

makesfs2 a2ps aalib


and get an

Code: Select all

error: failed to commit transaction (conflicting files)
aalib: /usr/bin/aafire exists in filesystem
aalib: /usr/bin/aainfo exists in filesystem
aalib: /usr/bin/aalib-config exists in filesystem
aalib: /usr/bin/aasavefont exists in filesystem
aalib: /usr/bin/aatest exists in filesystem
aalib: /usr/include/aalib.h exists in filesystem
aalib: /usr/lib/libaa.a exists in filesystem
aalib: /usr/lib/libaa.so exists in filesystem
aalib: /usr/lib/libaa.so.1 exists in filesystem
aalib: /usr/lib/libaa.so.1.0.4 exists in filesystem
aalib: /usr/share/aclocal/aalib.m4 exists in filesystem



with makesfs(pacman -Sw) I dont get any indication that aalib is already installed

on the other hand packer2 doesnt correctly uninstall pacman dependencies if issued only official packagages
But this I would like to fix in packer2'

perhaps uninstalling with pacman -Rs in packer2 line 395

Code: Select all

if [[ $pacmanpackages ]]; then runasroot $PACMAN "${PACOPTS[@]}" -Rs  "${pacmanpackages[@]}"; fi


A quick test I made would suggest it works

Of course some error handling as you suggested before squashing is great

Sim what are your take on this, pros and cons?
.
.

simargl
Site Admin
Posts: 466
Joined: 16 May 2013, 10:54
Contact:

Re: makesfs for AUR

Postby simargl » 08 Oct 2013, 21:39

I think in makesfs we should make difference between Arch packages and AUR build scripts because:

* if package already exists in repository, there is no need to first install that package, then remove it and then make sfs module as when package is built from AUR, in that case some packages must be installed as dependencies before building.

* pacman -Sw just downloads packages without installing, and move them to /mnt/home, so doesn't use space in savefile.

* asking for confirmation is good idea, gives chance for user to change his mind if download is too large etc.

simargl
Site Admin
Posts: 466
Joined: 16 May 2013, 10:54
Contact:

Re: makesfs for AUR

Postby simargl » 11 Oct 2013, 08:55

arch2sfs, makesfs and packer improvements:
better looking colors (like makepkg output),
ask for confirmation before downloading or building,
in makesfs use packer for all packages,
do not install pacman packages if --buildonly switch is used (use pacman -Sw),
arch2sfs first argument is SFS name.

simargl
Site Admin
Posts: 466
Joined: 16 May 2013, 10:54
Contact:

Re: makesfs for AUR

Postby simargl » 25 Oct 2013, 14:30

What if in makesfs we move extracting packages and compressing to sfs module from
/mnt/home/$SFS to /tmp/$SFS like in vboxsfs script,

then making modules would work on NTFS or FAT32 partitions, but what would be size limit
for that folder, since /tmp is not in save file?

simargl
Site Admin
Posts: 466
Joined: 16 May 2013, 10:54
Contact:

Re: makesfs for AUR

Postby simargl » 25 Oct 2013, 17:35

... to answer my question from previous post :)

I have 2 GB of RAM and wanted to copy avi file of 750 MB to /tmp for a test,
but it stopped at 504 MB with message Error: No space left on device.

So available space for /tmp is one quarter size of the RAM, so I will leave
makesfs as is - convert in /mnt/home and require that to be a linux partition.


Return to “Scripting and Programming”

Who is online

Users browsing this forum: No registered users and 15 guests

cron