Re: Using Perl in %post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry,

Wrong list :)

On 7/1/07, Aaron Lippold <lippold@xxxxxxxxx> wrote:
Hello,

I am building a kickstart that is fairly simple but has many
repetitive actions based on a large set of files.

I have the file sets listed in a simple text file and wrote a perl
script to simple open the file, read the line, parse the filename and
output the needed command with the right chunks of the full filename
in the right places.

I did it in perl and not bash because I am not sure how to do it well
in bash or sh etc.

I would like to just run this script and or fuction right in mz .spec
file. I cannot seem to find any data on if I can do this. Or can
someone show me a quick bash code snip for doing something like :

MYFILE
 CODE/SET1/File.txt
 ...

install()
 open file MYFILE
 while (file)
 # a = CODE, b = SET1, c = File d = txt
   (a,b,c,d) = parse(line)
   instcmd -n ="b" -f = "c.d"
 end while

# in the postun section
cleandb()
 open file MYFILE
 while(file)
   (a,b,c,d) = parse(line)
   rmcmd -n = c
 end while

This way I could just define the right fileset for each subpackage and
I won't have to maintain a list of 100 or more identical opperations,
just dump an ls into a file for setx-file-list.txt when I need to
rebuild the rpms for an updated set of file.

Thanks for any help, thoughts and education.

Aaron



[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux