From: Richard B. <al...@fr...> - 2002-07-24 12:26:40
|
Op woensdag 24 juli 2002 13:08, schreef Ralf Corsepius: > 2. Anyway, when using apt4rpm with an unmodified apt, apt-get finds > sparc-rtems-binutils-collection.src.rpm inside of the srclist, instead > of the desired *.nosrc.rpm (NOTE src.rpm <-> nosrc.rpm). > > The cause for this seems to be a bug in aptate: > > Aptate tries to destinguish between src.rpm and *.rpm by querying the > %{SOURCERPM} tag. For those packages returning "(none)", it assumes them > to be src.rpms and uses "${NAME}-{VERSION}-${ARCH}.src.rpm" instead of > the package's actual name. > > This works for actual src.rpms, but doesn't for nosrc.rpms. > nosrc.rpms also return (none) for %{SOURCERPM} but the synthetical > package name composed by aptate ($NAME-$VERSION-$ARCH.src.rpm) is wrong > then. > > => Overall, this results into "apt-get source" failing. > > As the patch below fixes this issue for me, I'd like to propose the > patch in the attachment below. - echo -n "src \"$FILENAME\" " - rpm -qp --queryformat "\"%{NAME}-%{VERSION}-%{RELEASE}.src.rpm\"" $FILENAME 2> /dev/null + echo -n "src \"$FILENAME\" \""`basename $FILENAME`"\"" 2> /dev/null This won't work for packages that are being called test.srpm for example. The if leg that processes %{SOURCERPM} should be extended. It could e.g investigate if the filename contains "nosrc". If so the package will be marked as being a binary package, otherwise it will fall back to the current treatment... If I'm not mistaken it could be something like this: --- aptate.in Wed Jul 17 09:40:54 2002 +++ /usr/tmp/aptate.in Wed Jul 24 14:22:34 2002 @@ -378,8 +378,16 @@ function make_links() RPMTYPE=$(rpm -qp --queryformat "%{SOURCERPM}" $FILENAME 2> /dev/null) if [ $? -eq 0 ]; then ( if [ "$RPMTYPE" = "(none)" ]; then - echo -n "src \"$FILENAME\" " - rpm -qp --queryformat "\"%{NAME}-%{VERSION}-%{RELEASE}.src.rpm\"" $FILENAME 2> /dev/null + case $(basename $FILENAME) in + *nosrc*) + echo -n "bin \"$FILENAME\" " + echo \""`basename $FILENAME`"\"" + ;; + *) + echo -n "src \"$FILENAME\" " + rpm -qp --queryformat "\"%{NAME}-%{VERSION}-%{RELEASE}.src.rpm\"" $FILENAME 2> /dev/null + ;; + esac else echo -n "bin \"$FILENAME\" " rpm -qp --queryformat "\"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\"" $FILENAME 2> /dev/null If this could work, than I would prefer to move the case to the outer loop and the if to be inside the case. -- Richard |