14.0RC2 vs. 13.37: strange Bash script failure
Hi,
I'm using a "master" build script to build my extra packages, so once Slackware is installed, I can pretty much launch the script, and it will fetch stuff and build it in the right order. Here's what the script looks like: Code:
#!/bin/sh 1) it reads the names of packages to build in an external 'packages' file, which is basically a list, one package per line, with a few comments. 2) It checks if the package has already been built before AND if it's installed. 3) If not, it builds the package, puts it into the OUTPUT directory and installs it. Now strangely enough, the script works perfectly with 13.37 (as it has always worked with previous versions of Slackware since around 10.2). But under 14.0RC2, it fails. I get a "binary operator expected" message at the if... then statements that do the testing if the package is installed and present in the OUTPUT directory. What happens is if a package is installed AND it's in the OUTPUT directory, the script fails and builds it anyway, instead of skipping to the next package that's not yet built/installed. Any idea what's wrong here? |
OK, I guess I got the culprit. I took a peek in /var/log/packages, and it seems like 'upgradepkg' has got a new behaviour. When I use it with --reinstall --install-new on an already installed package, I get a second entry in /var/log/packages, the second one having a timestamp added to the tag.
Considering that, it's normal my test fails, since if [ -r FILE ] expects a single file as an argument and fails when there are more than one. Phew. |
Why would you ever use --reinstall and --install-new together? I think they are supposed to be mutually exclusive. I mean, just look at what the options are called. If it is new, it isn't a reinstall and if it is a reinstall it isn't new.
|
Just take out --reinstall. The packages that are already installed with the same version number will be skipped by upgradepkg anyway and new packages will be installed.
|
Quote:
I guess your issue is elsewhere since nothing (except pkgtool's version number) has been changed in upgradepkg since 13.37 : Code:
$ diff -Nausr 13.37/ 14.0/ After looking at upgradepkg's code, the "TIMESTAMP" are used to mark packages to remove (starting at line #286) : Code:
# Showtime. Let's do the upgrade. First, we will rename all the Code:
for rempkg in *-$TIMESTAMP ; do -- SeB |
All times are GMT -5. The time now is 12:33 PM. |