[Yum] [daniel@xxxxxxxxxxxxxx: Patch to add baseos and basever variables]

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

 



Folks,

Wanted to submit the following patch. 

In our work to make Yum work on Solaris to manage RPM packages we
discovered that things pretty much just worked.  Some custom stuff was
done like our python is in a different place.  

The following patch is one of the few that we have applied.  It adds a
few more variables that you can use in the yum.conf file from informaion
in os.uname.

Jack Neely

----- Forwarded message from Daniel Henninger <daniel@xxxxxxxxxxxxxx> -----

Date: Tue, 6 Jul 2004 13:11:52 -0400 (EDT)
From: Daniel Henninger <daniel@xxxxxxxxxxxxxx>
To: jjneely@xxxxxxxxxxxxxx
Subject: Patch to add baseos and basever variables

here ya go  =)

-- 
/\\\----------------------------------------------------------------------///\
\ \\\      Daniel Henninger           http://www.vorpalcloud.org/        /// 
/
 \_\\\      North Carolina State University - Systems Programmer        ///_/
    \\\                   Information Technology <IT>                  ///
     
     """--------------------------------------------------------------"""

diff -cr yum-2.0.7.orig/archwork.py yum-2.0.7/archwork.py
*** yum-2.0.7.orig/archwork.py	Fri May  7 00:58:34 2004
--- yum-2.0.7/archwork.py	Tue Jul  6 11:11:26 2004
***************
*** 36,41 ****
--- 36,49 ----
          newarch = arch
      return newarch
  
+ def getOSName():
+     osname = os.uname()[0]
+     return osname
+ 
+ def getOSVersion():
+     osver = os.uname()[2]
+     return osver
+ 
  def betterarch(arch1, arch2):
      """Take two archs, return the better of the two, returns none if both \
      of them come out to 0, returns either if they are the same archscore"""
diff -cr yum-2.0.7.orig/config.py yum-2.0.7/config.py
*** yum-2.0.7.orig/config.py	Fri May  7 00:58:34 2004
--- yum-2.0.7/config.py	Tue Jul  6 11:11:26 2004
***************
*** 80,85 ****
--- 80,87 ----
          self.yumvar = self._getEnvVar()
          self.distroverpkg = 'redhat-release'
          self.yumvar['basearch'] = archwork.getArch()
+         self.yumvar['baseos'] = archwork.getOSName()
+         self.yumvar['basever'] = archwork.getOSVersion()
          self.yumvar['arch'] = os.uname()[4]
          # this is ugly and dirty like Zebra - but I'd like for a lot of users
          # of fedora to hush about the header download until I get the
***************
*** 316,321 ****
--- 318,325 ----
          if string is None:
              return string
          basearch_reg = re.compile('\$basearch')
+         baseos_reg = re.compile('\$baseos')
+         basever_reg = re.compile('\$basever')
          arch_reg = re.compile('\$arch')
          releasever_reg = re.compile('\$releasever')
          yum0_reg = re.compile('\$YUM0')
***************
*** 330,335 ****
--- 334,341 ----
          yum9_reg = re.compile('\$YUM9')
          
          (string, count) = basearch_reg.subn(self.yumvar['basearch'], string)
+         (string, count) = baseos_reg.subn(self.yumvar['baseos'], string)
+         (string, count) = basever_reg.subn(self.yumvar['basever'], string)
          (string, count) = arch_reg.subn(self.yumvar['arch'], string)
          (string, count) = releasever_reg.subn(self.yumvar['releasever'], string)
          (string, count) = yum0_reg.subn(self.yumvar[0], string)


----- End forwarded message -----

-- 
Jack Neely <slack@xxxxxxxxxxxxxxx>
Realm Linux Administration and Development
PAMS Computer Operations at NC State University
GPG Fingerprint: 1917 5AC1 E828 9337 7AA4  EA6B 213B 765F 3B6A 5B89

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux