# ports problem:   ** Makefile possibly broken:



## goshanecr (Dec 27, 2009)

Several days ago i have problem with ports upgrade with portupgrade. This problems appears with mod_perl. After i uninstall it, that problems appears with lang/php5.

```
uname -a
8.0-STABLE FreeBSD 8.0-STABLE #0: Tue Dec 22 21:47:3
```

I'm try to do:

```
rm -rf /usr/ports
portsnap fetch extract
```
But this not solve my problem. 


```
portupgrade -arRn
--->  Session started at: Sun, 27 Dec 2009 18:30:03 +0500
** Port directory not found: security/Nessus             
** Makefile possibly broken: lang/php5:
        [: -le: argument expected
        php5-5.2.11_1


--->  Session ended at: Sun, 27 Dec 2009 18:30:53 +0500 (consumed 00:00:50)
/usr/local/sbin/portupgrade:1469:in `get_pkgname': Makefile broken (MakefileBrokenError)
        from /usr/local/sbin/portupgrade:623:in `main'
        from /usr/local/sbin/portupgrade:614:in `each'
        from /usr/local/sbin/portupgrade:614:in `main'
        from /usr/local/sbin/portupgrade:588:in `catch'
        from /usr/local/sbin/portupgrade:588:in `main'
        from /usr/local/lib/ruby/1.8/optparse.rb:1310:in `call'
        from /usr/local/lib/ruby/1.8/optparse.rb:1310:in `parse_in_order'
        from /usr/local/lib/ruby/1.8/optparse.rb:1306:in `catch'
        from /usr/local/lib/ruby/1.8/optparse.rb:1306:in `parse_in_order'
        from /usr/local/lib/ruby/1.8/optparse.rb:1254:in `catch'
        from /usr/local/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
        from /usr/local/lib/ruby/1.8/optparse.rb:1248:in `order!'
        from /usr/local/lib/ruby/1.8/optparse.rb:1241:in `order'
        from /usr/local/sbin/portupgrade:565:in `main'
        from /usr/local/lib/ruby/1.8/optparse.rb:791:in `initialize'
        from /usr/local/sbin/portupgrade:229:in `new'
        from /usr/local/sbin/portupgrade:229:in `main'
        from /usr/local/sbin/portupgrade:2209
```


----------



## Speedy (Dec 27, 2009)

> rm -rf /usr/ports


I'd say your Makefile is not broken.  
You removed it. Use conventional csup method to get back your ports. Why did you remove it? :q


----------



## DutchDaemon (Dec 27, 2009)

Upgrade _portupgrade_ and its dependencies separately, and before you run a portupgrade -a on everything else. Or use portmaster and never be bothered with this


----------



## goshanecr (Dec 27, 2009)

Makefile not deleted, in lang/php5 and in www/mod_perl Makefile exists. 
After 

```
rm -rf /usr/ports
```
i'm fetch it:

```
portsnap fetch extract
```
Why csup method preferred than portsnap?


----------



## DutchDaemon (Dec 27, 2009)

This is not a Makefile problem, you broke portupgrade by not upgrading it separately. Delete it and reinstall it before upgrading the rest.


----------



## goshanecr (Dec 27, 2009)

After reinstalling portupgrade by executing:

```
portupgrade -fR
```
Nothing changes.


----------



## goshanecr (Dec 27, 2009)

Sorry by executing:

```
portupgrade -fR portupgrade
```


----------



## goshanecr (Dec 27, 2009)

And also i think that there is no problem of portupgrade because if i do:

```
cd /usr/ports/lang/php5
make install clean (or make deinstall or anything else make)
```
it show me:

```
[: -le: argument expected
```
but installs after that message (or deinstall or anything else)
this errors not only with php5 port, but also not with any port. for example www/mod_perl i have that problem, with www/opera that problem not appears.


----------



## fronclynne (Dec 27, 2009)

goshanecr said:
			
		

> Sorry by executing:
> 
> ```
> portupgrade -fR portupgrade
> ```



Some version(s) of portupgrade barf on the -R flag.  The most recent ports-mgmt/portupgrade-devel (20091221_1,1) doesn't, so if possible use that one.  You can manually remove the ports it depends on and let it pull them in if you're worried that ruby &cet are out of date as well:  
	
	



```
Information for portupgrade-devel-20091221_1,1:

Depends on:
Dependency: ruby-1.8.7.160_5,1
Dependency: db41-4.1.25_4
Dependency: ruby18-bdb-0.6.5_1
```

HTH


----------



## goshanecr (Dec 27, 2009)

I'm deinstall portupgrade and install portupgrade-devel, but that's not help me.
I guess that there is not problem of portupgrade! Because if i:

```
cd /usr/ports/www/mod_perl
make install
```
 it shows me that messages

```
[: -eq: argument expected
```
Why all tells about portupgrade, that errors show also if i use make install.
I'm try 
	
	



```
rm -rf /usr/ports && portsnap fetch extract
```
 and that's also not helps. All files in /usr/ports are ok. What can be reason of that error?
Now i'm try to:

```
cvsup -g -L 2 /root/stable-supfile
cd /usr/src
rm -rf /usr/obj
make clean
make -j4 buildworld
make -j4 buildkernel KERNCONF=KERN
make installkernel KERNCONF=KERN
reboot
make installworld
```
maybe that helps me.


----------



## goshanecr (Dec 27, 2009)

It isn't help... Ufff... 
Please help me find problem...
Any needed info about my system i can get by fisrt request


----------



## DutchDaemon (Dec 28, 2009)

What's in /etc/make.conf?


----------



## goshanecr (Dec 28, 2009)

*/etc/make.conf*

```
#=================#
# OPTIMIZATIONS   #
#=================#
CPUTYPE=athlon64
CFLAGS=-O2 -pipe -msse -msse2 -mmmx -m3dnow -mtune=athlon64 -fno-strict-aliasing
COPTFLAGS=-O2 -pipe -msse -msse2 -mmmx -m3dnow -mtune=athlon64
TARGET_ARCH=i386
KERNCONF=MANUL-IT.RU
NO_INET6=true
NO_GAMES=true
NO_I4B=true

#=================#
# PORTS OPTIONS   #
#=================#
PERL_VERSION=5.10.1
NO_SUID_XSERVER=YES

#-----------MySQL---------#
WANT_MYSQL_VER=51
.if ${.CURDIR} == ${PORTSDIR}/database/mysql51-server
	WITH_CHARSET=utf8
	WITH_XCHARSET=all
	WITH_COLLATION=utf8_general_ci
	WITH_OPENSSL=yes
	WITH_FAST_MUTEXES=yes
	BUILD_OPTIMIZED=yes
.endif
.if${.CURDIR} == ${PORTSDIR}/database/mysql51-client
	WITH_CHARSET=utf8
	WITH_COLLATION=utf8_general_ci
.endif

OVERRIDE_LINUX_BASE_PORT=f10
OVERRIDE_LINUX_NONBASE_PORTS=f10
LINUX_DIST_SUFFIX=-f10
```

But for test i'm try 

```
mv /etc/make.conf /etc/make.conf.1
portupgrade -arRn
```

Problem stil exists..


----------



## crsd (Dec 28, 2009)

Do you have apache installed and which version?


----------



## goshanecr (Dec 28, 2009)

Yes, apache-1.3.41 installed. But this problem appear not after any changes in software installed from ports... it appears after regular action: 

```
portsnap fetch update
portupgrade -arRn
```


----------



## crsd (Dec 28, 2009)

I understand your problem  but only place where -eq and -le are used in /usr/ports/Mk/* is bsd.apache.mk, VERSION_CHECK!= line to be more specific. You could try try deinstalling/reinstalling apache and check if it helps.


----------



## goshanecr (Dec 28, 2009)

I reinstall (make deinstall && make install clean) apache13 and something changes. Now portupgrade -arRn not shows any errors with -eq, but it crashes with that messages:

```
[B]serv# portupgrade -arRn[/B]
--->  Session started at: Tue, 29 Dec 2009 01:34:02 +0500
--->  Skipping 'bsdpan-XML-Entities-0.0307' because it is held by user (specify -f to force)
--->  Session ended at: Tue, 29 Dec 2009 01:36:09 +0500 (consumed 00:02:06)
/usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:953:in `initialize': ArgumentError (ArgumentError)
        from /usr/local/sbin/portupgrade:998:in `new'
        from /usr/local/sbin/portupgrade:998:in `do_upgrade'
        from /usr/local/sbin/portupgrade:812:in `main'
        from /usr/local/sbin/portupgrade:808:in `each'
        from /usr/local/sbin/portupgrade:808:in `main'
        from /usr/local/lib/ruby/1.8/optparse.rb:791:in `initialize'
        from /usr/local/sbin/portupgrade:231:in `new'
        from /usr/local/sbin/portupgrade:231:in `main'
        from /usr/local/sbin/portupgrade:2213
```


----------



## crsd (Dec 28, 2009)

Try running `# pkgdb -Ff`, or, if it doesn't help, just remove /var/db/pkg/pkgdb.db, portupgrade will recreate it.


----------



## goshanecr (Dec 28, 2009)

I'm do following actions:

```
[B]pkgdb -fF
serv# rm /var/db/pkg/pkgdb.db
serv# portupgrade -arRn[/B]
--->  Session started at: Tue, 29 Dec 2009 02:47:40 +0500
[Rebuilding the pkgdb <format:bdb_btree> in /var/db/pkg ... - 955 packages found (-0 +955) 
** Port directory not found: security/Nessus
--->  Skipping 'bsdpan-XML-Entities-0.0307' because it is held by user (specify -f to force)
--->  Session ended at: Tue, 29 Dec 2009 02:52:32 +0500 (consumed 00:04:51)
/usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:953:in `initialize': ArgumentError (ArgumentError)
        from /usr/local/sbin/portupgrade:998:in `new'
        from /usr/local/sbin/portupgrade:998:in `do_upgrade'
        from /usr/local/sbin/portupgrade:812:in `main'
        from /usr/local/sbin/portupgrade:808:in `each'
        from /usr/local/sbin/portupgrade:808:in `main'
        from /usr/local/lib/ruby/1.8/optparse.rb:791:in `initialize'
        from /usr/local/sbin/portupgrade:231:in `new'
        from /usr/local/sbin/portupgrade:231:in `main'
        from /usr/local/sbin/portupgrade:2213
```


----------



## crsd (Dec 28, 2009)

Can you now install lang/php5 or www/mod_perl, at least?

I must admit that I'm not familar with portupgrade (and ruby), so I step down here.


----------



## goshanecr (Dec 28, 2009)

i'm try mod_perl, and it installs/deinstalls without problem


----------



## goshanecr (Dec 28, 2009)

lang/php5 also reinstalls without errors


----------



## goshanecr (Dec 30, 2009)

is this unrecoverable problem?


----------



## goshanecr (Dec 30, 2009)

Is i need reinstall from null my server after unknown problem with ports?


----------



## goshanecr (Dec 30, 2009)

Don't know what to do..
Install rkhunter and check system.. all ok..
Try to start

```
portupgrade -fa
```
 maybe something changes...
Happy new year friends!  See in 2010! I wish all of you happy, very good health and success in all your deals and business!!!


----------

