OS/2 tricks: Coexist with rpm/yum

One of the shortages of OS/2 is lack of an unified installer. IBM provided some installers such as Feature Installer. But they were not used widely. Instead of them, some users created their own installer. Among them, WarpIn is most popular. However, WarpIn has a dependency problem.  If a program depends on some DLLs, it should be installed before. If installing a program regardless of those dependencies, then the program cannot be executed. The other problem is that some programs and libraries are distributed in zip. By the way, WarpIn does not recognize them as dependencies. As well as, WarpIn packages are not distributed in an unified repository. So to find dependent packages, it is required to search internets. Fortunately, hobbes acts as a main repository for WarpIn as well as other programs and libs.

To overcome these cons of WarpIn, some people tried to port rpm/yum system. And rpm/yum packages are now hosting on netlabs. If you use rpm/yum, then you can solve these problems easily. Because rpm/yum packages are on netlabs, and installing can be done by simple yum commands. You don't have to wander internets to get dependencies any more.

Unfortunately, however, rpm/yum packages also have problems. They sometimes conflict with other pre-existed programs and libraries. The main cause of these problems, is DLL mismatch. They have same names but different versions, exported symbols, calling conventions, naming conventions and so on. But this is not a problem of rpm/yum, but of OS/2 itself. So called DLL hells.

Nevertheless, more and more programs and libraries are distributed with rpm/yum including killer apps such as FireFox and OpenOffice. Although some people are trying to redistribute rpm/yum as WarpIn and rpm/yum people also provide zips, rpm/yum system is more and more important on OS/2.

Then how can rpm/yum coexist with the others ? The simplest way is to use rpm/yum packages only. If you cannot do this, consider this way.

First of all, see the requirements of rpm/yum. rpm/yum requires UNIXROOT(x:), and standard FHS such as /usr, /bin and /etc. That is, rpm/yum packages should be installed on root. So if you already those systems on a drive, rpm/yum should be installed on the other drives to coexist. Otherwise, the above DLL hells welcome you. :) If you don't have additional drives, use TVFS or NetDrive to redirect a directory to a drive. Then create some scripts to set up environments for rpm/yum. By this, rpm/yum coexist with the pre-existed environments.

Here is a script to setup environments for rpm/yum, rpmrun.cmd.

// ----- 2014/09/24
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@echo off
setlocal
set UNIXROOT=x:
set PREFIX=%UNIXROOT%\usr
set PATH=%PREFIX%\sbin;%PREFIX%\bin;%PATH%
set OLDB=%BEGINLIBPATH%
set BEGINLIBPATH=%PREFIX%\lib;%BEGINLIBPATH%
set PREFIX=
set LIBPATHSTRICT=T
set PYTHONHOME=
set PYTHONPATH=
%1 %2 %3 %4 %5 %6 %7 %8 %9
set BEGINLIBPATH=%OLDB%
endlocal


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@echo off
setlocal
set UNIXROOT=x:
set PREFIX=%UNIXROOT%\usr
set PATH=%PREFIX%\sbin;%PREFIX%\bin;%PATH%
set OLDB=%BEGINLIBPATH%
set BEGINLIBPATH=%PREFIX%\lib;%BEGINLIBPATH%
set PREFIX=
set OLDL=%LIBPATHSTRICT%
set LIBPATHSTRICT=T
set PYTHONHOME=
set PYTHONPATH=
%1 %2 %3 %4 %5 %6 %7 %8 %9
set LIBPATHSTRICT=%OLDL%
set BEGINLIBPATH=%OLDB%
endlocal

-----

At line 3, set UNIXROOT to the drive where you want to install rpm/yum packages. If you want to use rpm/yum programs, then run those programs with rpmrun.cmd.

  • rpmrun rpm/yum_program

Of course, rpmrun.cmd should be on a directory in PATH to run it anywhere.

For convenience, create rpm.cmd and yum.cmd.

1
2
3
4
@echo off
rem rpm.cmd

call rpmrun.cmd rpm.exe %1 %2 %3 %4 %5 %6 %7 %8 %9


1
2
3
4
@echo off
rem yum.cmd

call rpmrun.cmd yum.exe %1 %2 %3 %4 %5 %6 %7 %8 %9


If you want to run a shell itself under a rpm/yum environment, create rpmenv.cmd.

1
2
3
4
@echo off
rem rpmenv.cmd

call rpmrun.cmd %COMSPEC%


You can come back to an original shell by entering [exit] on command line.

With these scripts, you can use rpm/yum packages as well as pre-existed programs peacefully. If you need to modify some environments, then it's enough to modify rpmrun.cmd only.

댓글

이 블로그의 인기 게시물

토렌트: < 왕좌의 게임 > 시즌 1 ~ 시즌 8 완결편 마그넷

토렌트: NGC < 코스모스 > 우리말 더빙 전편(1편~13편) 마그넷

토렌트: < 스타워즈 > Ep.1 ~ Ep.6 마그넷