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

[PATCH] Choose logos package



This is a patch that enables choosing a specific -logos package rather then having dependency resolving pull in a package, and using it to build the installer images which usually show whatever logos used, everywhere.

Due to (recent) changes in the master branch, I have not yet been able to test this specific changeset but it's derived from what I did against the Fedora 9 branch to make rebranding work. I hope it shows the point of what I'm trying to do and I'll rebase the patch later if necessary. Consider this not yet ready for checkin if you will ;-)

The package sack for an initialized yum object is mostly populated with more then one -logos package. Which of these packages is going to satisfy the "system-logos" dependency is (at this moment at least) at best an educated guess (Provides:, Obsoletes:, Conflicts: and/or a significant NEVRA bump don't seem to help).

The patch let's one specify a specific -logos package using --logopkg to the buildinstall script, which then excludes a certain set of other, known -logos packages by means of adding a list to the "exclude=" parameter in the $yumconf used, and let's $LOGOPKG be used whereever possible.

This relates to bugz 457378 and 457379 (although the former had been fixed already), which were created when trying to have foobarbaz-logos be the -logos package for the brand FooBarBaz Fedora derivative.

I think the alternative route is to do fu to the virtual requires/provides mechanism that we have now with "system-logos", and I'm not sure how we could make the one intended (right) package go in that way.

Hope this helps,

Kind regards,

Jeroen van Meeuwen
-kanarip
diff --git a/scripts/buildinstall b/scripts/buildinstall
index 97eaf61..66262b5 100755
--- a/scripts/buildinstall
+++ b/scripts/buildinstall
@@ -71,6 +71,10 @@ while [ $# -gt 0 ]; do
 	    MIRRORLIST="$MIRRORLIST $2"
 	    shift; shift
 	    ;;
+	--logopkg)
+	    LOGOPKG="$2"
+	    shift; shift
+	    ;;
 
 	*)
         if [ -z "$REPO" ]; then
@@ -103,6 +107,19 @@ if [ -z "$BUGURL" ]; then
     BUGURL="your distribution provided bug reporting tool."
 fi
 
+if [ -z "$LOGOPKG" ]; then
+    # No logos package specified
+    LOGOPKG="fedora-logos"
+else
+    # Now that there is a logos package, prevent excluding the wrong package
+    EXCLUDEPKGS=""
+    for lpkg in fedora-logos redhat-logos generic-logos; do
+        if [ "$lpkg" != "$LOGOPKG ]; then
+            EXCLUDEPKGS="$EXCLUDEPKGS $lpkg"
+        fi
+    done
+fi
+
 if [[ "$REPO" =~ ^/ ]]; then
     [ -n "$OUTPUT" ] || OUTPUT=$REPO
     REPO="file://$REPO"
@@ -129,6 +146,7 @@ gpgcheck=0
 plugins=0
 reposdir=
 tsflags=nodocs
+exclude=$EXCLUDEPKG
 
 [anacondarepo]
 name=anaconda repo
@@ -197,14 +215,14 @@ BUILDINSTALL=$BUILDINSTDIR/buildinstall
 if [ -n "$UPDATES" ]; then UPDATES="--updates $UPDATES"; fi
 
 echo "Building images..."
-$UPD_INSTROOT $DEBUGSTR $NOGRSTR --arch $BUILDARCH $UPDATES --imgdir $TREEDIR/install $yumconf
+$UPD_INSTROOT $DEBUGSTR $NOGRSTR --arch $BUILDARCH $UPDATES --imgdir $TREEDIR/install --logopkg $LOGOPKG $yumconf
 
 echo "Writing .treeinfo file..."
 $MK_TREEINFO --family="$PRODUCTSTR" ${VARIANT:+--variant="$VARIANT"} --version=$VERSION --arch=$BUILDARCH --outfile=$OUTPUT/.treeinfo
 
 # FIXME: need to update mk-images to take the yumconf
 echo "Making images..."
-$MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BUILDARCH --product "$PRODUCTSTR" --version $VERSION --bugurl "$BUGURL" --output $OUTPUT $yumconf
+$MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BUILDARCH --product "$PRODUCTSTR" --version $VERSION --bugurl "$BUGURL" --output $OUTPUT --logopkg $LOGOPKG $yumconf
 
 echo "Writing .discinfo file"
 $MK_STAMP --releasestr="$RELEASESTR" --arch=$BUILDARCH --discNum="ALL"  --outfile=$OUTPUT/.discinfo
diff --git a/scripts/mk-images b/scripts/mk-images
index 60e48e6..bee329f 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -89,6 +89,10 @@ while [ $# -gt 0 ]; do
 	    echo "*** DeprecationWarning: please use --imgdir instead of --stg2dir." >&2
 	    shift; shift
 	    ;;
+	--logopkg)
+	    LOGOPKG="$2"
+	    shift; shift;
+            ;;
 
 	*)
 	    yumconf=$1
@@ -99,6 +103,10 @@ done
 
 if [ -z "$TOPDESTPATH" -o -z "$IMGPATH" -o -z "$PRODUCT" -o -z "$VERSION" ]; then usage; fi
 
+if [ -z "$LOGOPKG" ]; then
+    LOGOPKG="fedora-logos"
+fi
+
 TOPDIR=$(echo $0 | sed "s,/[^/]*$,,")
 if [ $TOPDIR = $0 ]; then
     $TOPDIR="."
diff --git a/scripts/mk-images.efi b/scripts/mk-images.efi
index 23038eb..6539ff9 100755
--- a/scripts/mk-images.efi
+++ b/scripts/mk-images.efi
@@ -154,7 +154,7 @@ prepareEfiTree() {
     mv $MBD_BOOTTREE_TMP/EFI/boot/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.efi
     mv $MBD_BOOTTREE_TMP/EFI/boot/grub.conf $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.conf
 
-    artpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" --whatprovides system-logos | grep -v generic-logos | head -1)
+    artpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" $LOGOPKG | head -1 2>/dev/null)
 
     if [ -z "$artpkg" ]; then
        argpkg="generic-logos"
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index b98fc21..2aa90ad 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -60,6 +60,10 @@ while [ $# -gt 0 ]; do
 	    echo "*** DeprecationWarning: please use --imgdir instead of --stg2dir." >&2
 	    shift; shift
 	    ;;
+	--logopkg)
+	    LOGOPKG="$2"
+	    shift; shift
+	    ;;
 
 	*)
 	    yumconf=$1
@@ -89,6 +93,10 @@ if [ ! -f $yumconf ]; then
     exit 1
 fi
 
+if [ -z "$LOGOPKG" ]; then
+    LOGOPKG="system-logos"
+fi
+
 . $(dirname $0)/buildinstall.functions
 
 expandPackageSet() {
@@ -210,7 +218,7 @@ fi
 PACKAGES="$PACKAGES acl anaconda anaconda-help anaconda-images atk attr bash
 	    bitmap-fonts-cjk cairo cjkunifonts-ukai comps-extras
 	    convertdb1 coreutils cpio dbus dbus-python dejavu-fonts
-	    dmapi dmraid e2fsprogs echo-icon-theme expat system-logos
+	    dmapi dmraid e2fsprogs echo-icon-theme expat $LOGOPKG
 	    firstboot fontconfig fonts-arabic fonts-bengali fonts-chinese
 	    fonts-gujarati fonts-hindi fonts-indic fonts-ISO8859-2
 	    fonts-ISO8859-9 fonts-kannada fonts-korean fonts-malayalam

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