Kaydet (Commit) 969f4032 authored tarafından Ingo Schmidt's avatar Ingo Schmidt

native324 #i113835# preparing rpm installation on debian systems

üst a7aba8a1
...@@ -75,6 +75,8 @@ public class InstallData ...@@ -75,6 +75,8 @@ public class InstallData
static private boolean databaseQueried = false; static private boolean databaseQueried = false;
static private boolean useRtl = false; static private boolean useRtl = false;
static private boolean installedProductMinorSet = false; static private boolean installedProductMinorSet = false;
static private boolean isDebianSystem = false;
static private boolean debianInvestigated = false;
static private String installType; /* custom or typical installation */ static private String installType; /* custom or typical installation */
static private String osType; /* Linux, SunOS, ... */ static private String osType; /* Linux, SunOS, ... */
static private String installDir = null; static private String installDir = null;
...@@ -649,6 +651,22 @@ public class InstallData ...@@ -649,6 +651,22 @@ public class InstallData
installedProductMinorSet = value; installedProductMinorSet = value;
} }
public boolean debianInvestigated() {
return debianInvestigated;
}
public void setDebianInvestigated(boolean value) {
debianInvestigated = value;
}
public boolean isDebianSystem() {
return isDebianSystem;
}
public void setIsDebianSystem(boolean value) {
isDebianSystem = value;
}
public boolean databaseQueried() { public boolean databaseQueried() {
return databaseQueried; return databaseQueried;
} }
......
...@@ -381,6 +381,27 @@ import java.util.Vector;public class LinuxHelper { ...@@ -381,6 +381,27 @@ import java.util.Vector;public class LinuxHelper {
return databasePath; return databasePath;
} }
public void investigateDebian(InstallData data) {
// String rpmQuery = "rpm --help;
String[] rpmQueryArray = new String[2];
rpmQueryArray[0] = "rpm";
rpmQueryArray[1] = "--help";
Vector returnVector = new Vector();
Vector returnErrorVector = new Vector();
int returnValue = ExecuteProcess.executeProcessReturnVector(rpmQueryArray, returnVector, returnErrorVector);
// Checking if the return vector contains the string "force-debian"
for (int i = 0; i < returnVector.size(); i++) {
String line = (String) returnVector.get(i);
if ( line.indexOf("force-debian") > -1 ) {
data.setIsDebianSystem(true);
}
}
}
public void getLinuxFileInfo(PackageDescription packageData) { public void getLinuxFileInfo(PackageDescription packageData) {
// analyzing a string like "openoffice-core01-2.0.3-159" as "name-version-release" // analyzing a string like "openoffice-core01-2.0.3-159" as "name-version-release"
InstallData data = InstallData.getInstance(); InstallData data = InstallData.getInstance();
......
...@@ -121,6 +121,14 @@ then ...@@ -121,6 +121,14 @@ then
exit 2 exit 2
fi fi
# #163256# check if we are on a debian system...
if rpm --help | grep debian >/dev/null;
then
DEBIAN_FLAGS="--force-debian --nodeps"
else
DEBIAN_FLAGS=
fi
# #
# Determine whether this should be an update or a fresh install # Determine whether this should be an update or a fresh install
# #
...@@ -227,7 +235,7 @@ FAKEDBRPM=/tmp/fake-db-1.0-$$.noarch.rpm ...@@ -227,7 +235,7 @@ FAKEDBRPM=/tmp/fake-db-1.0-$$.noarch.rpm
linenum=??? linenum=???
tail -n +$linenum $0 > $FAKEDBRPM tail -n +$linenum $0 > $FAKEDBRPM
rpm --upgrade --ignoresize --dbpath $RPM_DB_PATH $FAKEDBRPM rpm ${DEBIAN_FLAGS} --upgrade --ignoresize --dbpath $RPM_DB_PATH $FAKEDBRPM
rm -f $FAKEDBRPM rm -f $FAKEDBRPM
...@@ -253,7 +261,7 @@ echo "Installing the RPMs" ...@@ -253,7 +261,7 @@ echo "Installing the RPMs"
ABSROOT=`cd ${INSTALLDIR}; pwd` ABSROOT=`cd ${INSTALLDIR}; pwd`
RELOCATIONS=`rpm -qp --qf "--relocate %{PREFIXES}=${ABSROOT}%{PREFIXES} \n" $RPMLIST | sort -u | tr -d "\012"` RELOCATIONS=`rpm -qp --qf "--relocate %{PREFIXES}=${ABSROOT}%{PREFIXES} \n" $RPMLIST | sort -u | tr -d "\012"`
UserInstallation=\$BRAND_BASE_DIR/../UserInstallation rpm $RPMCMD --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST UserInstallation=\$BRAND_BASE_DIR/../UserInstallation rpm ${DEBIAN_FLAGS} $RPMCMD --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST
# #
# Create a link into the users home directory # Create a link into the users home directory
...@@ -268,11 +276,11 @@ if [ "$UPDATE" = "yes" -a ! -f $INSTALLDIR/program/bootstraprc ] ...@@ -268,11 +276,11 @@ if [ "$UPDATE" = "yes" -a ! -f $INSTALLDIR/program/bootstraprc ]
then then
echo echo
echo "Update failed due to a bug in RPM, uninstalling .." echo "Update failed due to a bug in RPM, uninstalling .."
rpm --erase -v --nodeps --dbpath $RPM_DB_PATH `rpm --query --queryformat "%{NAME} " --package $RPMLIST --dbpath $RPM_DB_PATH` rpm ${DEBIAN_FLAGS} --erase -v --nodeps --dbpath $RPM_DB_PATH `rpm --query --queryformat "%{NAME} " --package $RPMLIST --dbpath $RPM_DB_PATH`
echo echo
echo "Now re-installing new packages .." echo "Now re-installing new packages .."
echo echo
rpm --install --nodeps --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST rpm ${DEBIAN_FLAGS} --install --nodeps --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST
echo echo
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment