rm -R

2013-03-02 Thread Jos Chrispijn

I made a folder called   -S;

how can I remove that again?

did a rm -R '-S;' but that doesn't work (...).

thanks for your advise,
Jos Chrispijn

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


RE: rm -R

2013-03-02 Thread Teske, Devin
rm -R -- -S

The -- tells it here's the end of the options, here come the 
file/directories
-- 
Devin


From: owner-freebsd-questi...@freebsd.org [owner-freebsd-questi...@freebsd.org] 
on behalf of Jos Chrispijn [ker...@webrz.net]
Sent: Saturday, March 02, 2013 7:50 AM
To: freebsd-questions@FreeBSD.org
Subject: rm -R

I made a folder called   -S;

how can I remove that again?

did a rm -R '-S;' but that doesn't work (...).

thanks for your advise,
Jos Chrispijn

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Jos Chrispijn



Ralf Mardorf:

rm -R -S\; rm -R ?S?


rm: illegal option -- S
usage: rm [-f | -i] [-dIPRrvW] file ...
   unlink file

regards,
Jos Chrispijn
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Jos Chrispijn


Teske, Devin:

rm -R -- -S

The -- tells it here's the end of the options, here come the 
file/directories

Almost :  rm -R --  -S;   did it, thanks very much!

BR,
Jos Chrispijn.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Jos Chrispijn


Teske, Devin:

rm -R -- -S

The -- tells it here's the end of the options, here come the 
file/directories


Almost:

rm -R --  -S;

did it, thanks very much for you help!

BR,
Jos Chrispijn
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread David Tilbrook
Wjy are we syill having this conversation?
The problem (and its solution) have been
raised for at least 39 years.

To specify a file, directory, device, whatever,
whose leaf name begins with a `-', name it using
a leading `./' as in:

  whatever ./-S

That will work for all programs, even those that
do not support -- to terminate flags.

Furthermore it will support glob patterns.

Now was that so difficult?

-- dt
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Julian H. Stacey
Hi,
Reference:
 From: Jos Chrispijn ker...@webrz.net 
 Date: Sat, 02 Mar 2013 18:44:22 +0100 
 Message-id:   51323a76.2040...@webrz.net 

Jos Chrispijn wrote:
 
 Teske, Devin:
  rm -R -- -S
 
  The -- tells it here's the end of the options, here come the 
  file/directories
 
 Almost:
 
 rm -R --  -S;
 
 did it, thanks very much for you help!

This also works
rmdir ./-S
( is probably the best generic naming method,  was valid decades
ago, before rm got the luxury of modern stuff eg --  would work
for other commands that might not have delimieters such as -- )
This also work but is over kill :
rmdir './-S'

Cheers,
Julian
-- 
Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com
 Reply below not above, like a play script.  Indent old text with  .
 Send plain text.  No quoted-printable, HTML, base64, multipart/alternative.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread doug



On Sat, 2 Mar 2013, David Tilbrook wrote:


Wjy are we syill having this conversation?
The problem (and its solution) have been
raised for at least 39 years.

To specify a file, directory, device, whatever,
whose leaf name begins with a `-', name it using
a leading `./' as in:

 whatever ./-S

That will work for all programs, even those that
do not support -- to terminate flags.

Furthermore it will support glob patterns.

Now was that so difficult?

-- dt


Also find dir -type [df] -name string | xargs command

find is pretty good about finding names with special characters and they get 
passed though xargs ok. This does not work with names with spaces of course. 
Also pretty easy to test at each step to make sure you are doing want you 
intend.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Joshua Isom

On 3/2/2013 2:43 PM, David Tilbrook wrote:

The problem (and its solution) have been
raised for at least 39 years.


But google and other search engines treats words([A-Za-z0-9]) starting 
with - as meaning exclude results with this, even when obvious it's 
about unix commands.  It can be rather annoying when searching for help.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Gary Kline
On Sat, Mar 02, 2013 at 07:43:50PM -0600, Joshua Isom wrote:
 On 3/2/2013 2:43 PM, David Tilbrook wrote:
 The problem (and its solution) have been
 raised for at least 39 years.
 
 But google and other search engines treats words([A-Za-z0-9])
 starting with - as meaning exclude results with this, even when
 obvious it's about unix commands.  It can be rather annoying when
 searching for help.
 ___


sorry to be so dense; can you give me a few concrete examples? ya
lost me!

tx


 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
  Twenty-six years of service to the Unix community.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Polytropon
On Sat, 2 Mar 2013 18:27:15 -0800, Gary Kline wrote:
 On Sat, Mar 02, 2013 at 07:43:50PM -0600, Joshua Isom wrote:
  On 3/2/2013 2:43 PM, David Tilbrook wrote:
  The problem (and its solution) have been
  raised for at least 39 years.
  
  But google and other search engines treats words([A-Za-z0-9])
  starting with - as meaning exclude results with this, even when
  obvious it's about unix commands.  It can be rather annoying when
  searching for help.
  ___
 
 
   sorry to be so dense; can you give me a few concrete examples? ya
   lost me!

Just as one of many examples, google for find -name (without
the quotes of course), a typical combination which the AND NEAR
search should return sufficient results for. Compare the list
of results to what you would expect.

Now, google for find -name _including_ the quotes (!)
in order to have google treat the search string literally.
The results will be different, as you would expect.

In ye olde times when search engine meant altavista.digital.com
(if I remember correctly), search strings usually needed
to include + (AND) and - (AND NOT) if you wanted to construct
a search term consisting of more than one word. With google
implying a + prefix for every search word _and_ assuming
they should be as near as possible to each other (therefor
the name AND NEAR for the kind of search) this became
obsolete. Almost, as it seems...



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Joshua Isom

On 3/2/2013 8:27 PM, Gary Kline wrote:

On Sat, Mar 02, 2013 at 07:43:50PM -0600, Joshua Isom wrote:

On 3/2/2013 2:43 PM, David Tilbrook wrote:

The problem (and its solution) have been
raised for at least 39 years.


But google and other search engines treats words([A-Za-z0-9])
starting with - as meaning exclude results with this, even when
obvious it's about unix commands.  It can be rather annoying when
searching for help.
___



sorry to be so dense; can you give me a few concrete examples? ya
lost me!

tx



Start with basics, http://www.lmgtfy.com/?q=rm+-rf now find something 
relevant even though `rm -rf` is so common under unix.  Oddly, `rm -S` 
gives the wikipedia webpage first.  It doesn't mention anything about -- 
or using ./ to delete files.  The man page lists is, so the true 
documentation is sound, but if you're looking on the internet you have 
to know how to search.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Polytropon
On Sat, 02 Mar 2013 23:45:30 +0100, Julian H. Stacey wrote:
 Hi,
 Reference:
  From:   Jos Chrispijn ker...@webrz.net 
  Date:   Sat, 02 Mar 2013 18:44:22 +0100 
  Message-id: 51323a76.2040...@webrz.net 
 
 Jos Chrispijn wrote:
  
  Teske, Devin:
   rm -R -- -S
  
   The -- tells it here's the end of the options, here come the 
   file/directories
  
  Almost:
  
  rm -R --  -S;
  
  did it, thanks very much for you help!
 
 This also works
   rmdir ./-S
 ( is probably the best generic naming method,  was valid decades
 ago, before rm got the luxury of modern stuff eg --  would work
 for other commands that might not have delimieters such as -- )
 This also work but is over kill :
   rmdir './-S'

Just note that the ; has been part of the name in question,
so the end of command sign would have to be part of the
directory name: rmdir ./-S; and rmdir './-S;' would be
the alternatives to rm -R -- -S;.

I'd be interested in what happens when you have such a
directory name and press PF8 in the Midnight Commander
in order to delete it.

Now go ahead and create a file * in / and tell a junior
sysadmin to remove it. ;-)


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -R

2013-03-02 Thread Perry Hutchison
Joshua Isom jri...@gmail.com wrote:
 But google and other search engines treats words([A-Za-z0-9])
 starting with - as meaning exclude results with this, even when
 obvious it's about unix commands.  It can be rather annoying
 when searching for help.

This comment suggests a new translation of GNU:  Google's Not Unix
(although it may well be _hosted on_ a Unix variant).

Absent some very advanced AI, nothing is obvious to a computer :)
The - character means different things in different environments.

When you know what command is needed, the manpage is usually the
best reference.  Save the search engines for when you _don't_ know
which command to use -- and even then you probably should try
man -k or apropos first.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: I performed an rm -r on /var/lib/pkg

2007-10-22 Thread James


 
 
 
 Feeding pkgdb/pkg_which a port creates a directory for that port
 in /var/db/pkg.
 
 It then returned a question mark, which kind of sucked, silence being
 golden in unix, but I had an entry for openmpi appear in /var/db/pkg
 
 Is this really just meaningless grasping at straws? It looked like this
 in conjunction with pkgdb -L would work.
 
 James


I've been running this for a while now, and it looks like it's working,
it just needs liberal doses of pkgdb -F occasionally. 

James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-19 Thread James
On Thu, 2007-10-18 at 20:11 +0100, RW wrote:

 On Thu, 18 Oct 2007 12:51:33 -0600
 James [EMAIL PROTECTED] wrote:
 
   It depends what state the ports were in at the time of the
   accident. If you haven't run a leaf-cutting program recently you
   may have old dependencies and tools that have become leaves - they
   may take years to show-up.
   
   ___
   freebsd-questions@freebsd.org mailing list
   http://lists.freebsd.org/mailman/listinfo/freebsd-questions
   To unsubscribe, send any mail to
   [EMAIL PROTECTED]
  
  
  I just discovered pkg_which.
  
  I'm thinking I can use this to solve my (still haven't worked on)
  problem. Any ideas why this might be a bad idea? I essentially feed
  it a list from /usr/ports/distfiles and move on.
 
 
 Do you have the database file? The default location is in the directory
 you deleted.

Yes. 


 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]




Feeding pkgdb/pkg_which a port creates a directory for that port
in /var/db/pkg.

It then returned a question mark, which kind of sucked, silence being
golden in unix, but I had an entry for openmpi appear in /var/db/pkg

Is this really just meaningless grasping at straws? It looked like this
in conjunction with pkgdb -L would work.

James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-18 Thread James
 It depends what state the ports were in at the time of the accident. If
 you haven't run a leaf-cutting program recently you may have old
 dependencies and tools that have become leaves - they may take years
 to show-up.
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]


I just discovered pkg_which.

I'm thinking I can use this to solve my (still haven't worked on)
problem. Any ideas why this might be a bad idea? I essentially feed it a
list from /usr/ports/distfiles and move on.

James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-18 Thread RW
On Thu, 18 Oct 2007 12:51:33 -0600
James [EMAIL PROTECTED] wrote:

  It depends what state the ports were in at the time of the
  accident. If you haven't run a leaf-cutting program recently you
  may have old dependencies and tools that have become leaves - they
  may take years to show-up.
  
  ___
  freebsd-questions@freebsd.org mailing list
  http://lists.freebsd.org/mailman/listinfo/freebsd-questions
  To unsubscribe, send any mail to
  [EMAIL PROTECTED]
 
 
 I just discovered pkg_which.
 
 I'm thinking I can use this to solve my (still haven't worked on)
 problem. Any ideas why this might be a bad idea? I essentially feed
 it a list from /usr/ports/distfiles and move on.


Do you have the database file? The default location is in the directory
you deleted.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-13 Thread Mel
On Saturday 13 October 2007 02:13:49 RW wrote:
 On Fri, 12 Oct 2007 23:13:58 +0200

 Mel [EMAIL PROTECTED] wrote:
  On Friday 12 October 2007 22:19:41 RW wrote:
   On Thu, 11 Oct 2007 14:26:19 -0600
  
   James [EMAIL PROTECTED] wrote:
Call it a moment of sheer stupidity, call it a misremembering,
call it whatever you want (and I imagine I'll hear a few
different ones), but I just did an rm -r /var/lib/pkg.
   
Before I type anything to damage things further, does anyone have
any suggestions as to how to recover from this? I have other
FreeBSD boxes available to me, none with the same pkg list,
though. I'll be reading man pkgdb in the meantime..
  
   This came up recently in another thread, and what seemed to be the
   best solution to me, was this:
  
   1. work out which leaf-ports you actually need - don't worry about
   the dependencies.
  
   2. at your leisure build new packages under a chroot environment,
   or on another machine.
  
   3. back-up /usr/local/etc (or the whole of /usr/local)
  
   4. rm -rf  /usr/local/*
  
   5. Restore  /usr/local/etc and install packages.
 
  Why would you go through 3-5 when you can just
  mv /chroot/build/directory/var/db/pkg /var/db/pkg ?

 For the reasons that that you snipped off the bottom of my post.

... avoids leaving any orphaned files,and most
   importantly makes sure that all of the installed package have an
   entry in /var/db/pkg. If you miss any of these entries, it may
   cause a lot of trouble down the line.

 /chroot/build/directory/var/db/pkg is only a rough guess as to
 what was actually installed under /usr/local/.

So don't guess if you're that paranoid. It can be much much harder to restore 
some directories under /usr/local to a working state, 
like /usr/local/pgsql, /usr/local/www and some perl ports like rrd.

Depending how long builds take, it may be faster let a script run 
over /usr/ports/*/* that runs make generate-plist for each port, appends 
grep -v '^@' ${TMPPLIST} into a file, thus building an index of every file 
that a port can install, then let a script run over /usr/local that queries 
that index for each file it encounters. Like I said, for the ultra paranoid.

 Maybe some forgotten 
 dependency doesn't get included in the new build.  A year from now you
 may find odd build problems, or new port installs may use orphaned
 files with critical vulnerabilities that portaudit can't detect.

Nope. Orphaned files create stale deps, which are easily found with pkgdb -F, 
because the dependency check checks if ${LOCALBASE}/bin/foo exists and if it 
does adds the dependency to /var/db/pkg.
Also, `make missing' for a given port easily lists all dependencies that 
aren't in $PKG_DBDIR, so if you run make missing after a new install for a 
while, you'll easily identify those.

-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-13 Thread RW
On Sat, 13 Oct 2007 17:05:10 +0200
Mel [EMAIL PROTECTED] wrote:

 On Saturday 13 October 2007 02:13:49 RW wrote:
  On Fri, 12 Oct 2007 23:13:58 +0200
 
  Mel [EMAIL PROTECTED] wrote:
   On Friday 12 October 2007 22:19:41 RW wrote:
On Thu, 11 Oct 2007 14:26:19 -0600
   
James [EMAIL PROTECTED] wrote:
 Call it a moment of sheer stupidity, call it a misremembering,
 call it whatever you want (and I imagine I'll hear a few
 different ones), but I just did an rm -r /var/lib/pkg.

 Before I type anything to damage things further, does anyone
 have any suggestions as to how to recover from this? I have
 other FreeBSD boxes available to me, none with the same pkg
 list, though. I'll be reading man pkgdb in the meantime..
   
This came up recently in another thread, and what seemed to be
the best solution to me, was this:
   
1. work out which leaf-ports you actually need - don't worry
about the dependencies.
   
2. at your leisure build new packages under a chroot
environment, or on another machine.
   
3. back-up /usr/local/etc (or the whole of /usr/local)
   
4. rm -rf  /usr/local/*
   
5. Restore  /usr/local/etc and install packages.
  
   Why would you go through 3-5 when you can just
   mv /chroot/build/directory/var/db/pkg /var/db/pkg ?
 
  For the reasons that that you snipped off the bottom of my post.
 
 ... avoids leaving any orphaned files,and most
importantly makes sure that all of the installed package have an
entry in /var/db/pkg. If you miss any of these entries, it may
cause a lot of trouble down the line.
 
  /chroot/build/directory/var/db/pkg is only a rough guess as to
  what was actually installed under /usr/local/.
 
 So don't guess if you're that paranoid.

If you haven't kept a list of origins, you may not have much choice
unless the dependencies are simple. Dealing with conflicts is
bad enough when you have a complete record of what's installed.  

 It can be much much harder to
 restore some directories under /usr/local to a working state, 
 like /usr/local/pgsql, /usr/local/www and some perl ports like rrd.

Whether that is hard to do or not depends on the individual case,
a backed-up /usr/local can easily be restored, if it doesn't work-out.
   
 Depending how long builds take, it may be faster let a script run 
 over /usr/ports/*/* that runs make generate-plist for each port,
 appends grep -v '^@' ${TMPPLIST} into a file, thus building an index
 of every file that a port can install, then let a script run
 over /usr/local that queries that index for each file it encounters.
 Like I said, for the ultra paranoid.

That assumes that everything was installed from the same ports tree,
you know which tree it was, and that every packing-list is accurate
-otherwise it may flag an essential file for deletion.

  Maybe some forgotten 
  dependency doesn't get included in the new build.  A year from now
  you may find odd build problems, or new port installs may use
  orphaned files with critical vulnerabilities that portaudit can't
  detect.
 
 Nope. Orphaned files create stale deps, which are easily found with
 pkgdb -F, because the dependency check checks if ${LOCALBASE}/bin/foo
 exists and if it does adds the dependency to /var/db/pkg.
 Also, `make missing' for a given port easily lists all dependencies
 that aren't in $PKG_DBDIR, so if you run make missing after a new
 install for a while, you'll easily identify those.

It depends what state the ports were in at the time of the accident. If
you haven't run a leaf-cutting program recently you may have old
dependencies and tools that have become leaves - they may take years
to show-up.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread Joshua Isom


On Oct 11, 2007, at 5:39 PM, James wrote:


On Thu, 2007-10-11 at 18:14 -0400, Robert Huff wrote:


James writes:


 What has happened, though, is I've never ran rm in
 /usr/ports/distfiles.  I'm going to think for a little bit about
 a script that can move through /usr/ports/distfiles and reinstall
 everything that exists there.


Having been in almost the identical situation for different
rasons, I sympathize.
Yes, this will involve a sweep through /usr/ports distfiles.
If you haven't ever deleted anything, I suggest a prelimiary manual
run deleting everything but the most recent version.  This has a
down-side, but it will prevent cluttering the rebuilt system with
unused ports.



/usr/ports/distfiles is definitely looking promising. awk is too damn
painful to work with, so I'm going to dust off my perl skills.

Hell, this could actually turn out to be fun. And if I write the script
properly, it might make a nice disaster recovery tool
for /usr/ports/ports-mgmt - it can be called
WhenYou'reAnIdiotLikeJamesWasOnFreeBSDQuestions



Well, if you figure out what ports you have installed, you can
regenerate the


pkgdb using:

make -DNO_BUILD -DNO_INSTALL generate-plist fake-pkg

for each port.
I just tested that using a temporary PKG_DBDIR. In case you wanna see 
what

happens, here's what I did:

mkdir -p /tmp/var/db/pkg
cd /usr/ports/shells/bash
env PKG_DBDIR=/tmp/var/db/pkg make -DNO_BUILD -DNO_INSTALL \
generate-plist fake-pkg




Wow, that's great! I understand that it has the caveats that you 
mentioned, but it's

*at least* a fantastic start.

James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]




If you don't run 'make clean' then you can look for the 'work' 
directory to know if you've installed it or not.  But some of the port 
tools automatically run make clean for you so they would disappear.  A 
simple 'find /usr/ports -type d -name work' would probably work well 
enough unless you wanted it all automated.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread Erik Trulsson
On Fri, Oct 12, 2007 at 10:57:59AM -0600, James wrote:
 
 This isn't quite as simple as I'd hoped it'd be to fix. Here's my
 findings thus far (I haven't started writing my script yet, but I will
 later today):
 
 1. /usr/ports/distfiles contains everything I need
 2. distfiles contains several versions of some packages, but that's
 pretty trivial to resolve.
 3. distfiles contains some packages whose source tarballs are named
 *differently* to the packages themselves, such as unrar.

A few more problems:

a) Not every port will have a corresponding tarball in /usr/ports/distfiles.
   A few ports have all the source directly in the ports tree.  This
   means that your point 1) above is not necessarily true.
b) Several ports have many tarballs in /usr/ports/distfiles
c) A few of the tarballs can be used by more than one port.



 
 It's number 3 that's getting me.  It looks like the simplest thing might
 be an if statement:
 
 if (make search name=$PACKAGE)
 score!
 else
 grep -r $PACKAGE /usr/ports
 
 But before I go that far, I wanted to see if anyone had an alternate
 idea for what might work.

-- 
Insert your favourite quote here.
Erik Trulsson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread Mel
On Friday 12 October 2007 18:57:59 James wrote:
 This isn't quite as simple as I'd hoped it'd be to fix. Here's my
 findings thus far (I haven't started writing my script yet, but I will
 later today):

 1. /usr/ports/distfiles contains everything I need
 2. distfiles contains several versions of some packages, but that's
 pretty trivial to resolve.
 3. distfiles contains some packages whose source tarballs are named
 *differently* to the packages themselves, such as unrar.

 It's number 3 that's getting me.  It looks like the simplest thing might
 be an if statement:

 if (make search name=$PACKAGE)
 score!
 else
 grep -r $PACKAGE /usr/ports

 But before I go that far, I wanted to see if anyone had an alternate
 idea for what might work.

Depends on your time and harddisk speed I suppose. You could:

for CAT in *; do
if test -d ${CAT}; then
cd ${PORTSDIR:=/usr/ports}/${CAT}
for PORT in *; do
if test -d ${PORT}; then
cd ${PORT}
make -V DISTNAME /usr/ports/distname.idx
cd ..
fi
done
fi
done

This would give you a distname index to work with. I checked INDEX-6 but don't 
see a DISTNAME listed in there. I suppose I'd make the decision myself based 
on how many I can't locate. Doing this for 10 ports I can easily guess myself 
is nice for academics, but not when you're on the clock.
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread Joshua Isom


On Oct 12, 2007, at 11:57 AM, James wrote:



This isn't quite as simple as I'd hoped it'd be to fix. Here's my
findings thus far (I haven't started writing my script yet, but I will
later today):

1. /usr/ports/distfiles contains everything I need
2. distfiles contains several versions of some packages, but that's
pretty trivial to resolve.
3. distfiles contains some packages whose source tarballs are named
*differently* to the packages themselves, such as unrar.

It's number 3 that's getting me.  It looks like the simplest thing 
might

be an if statement:

if (make search name=$PACKAGE)
score!
else
grep -r $PACKAGE /usr/ports

But before I go that far, I wanted to see if anyone had an alternate
idea for what might work.


James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]




Try something more akin to this.

find /usr/ports/devel -name distinfo -exec grep -l ddd-3.3.11.tar.gz 
'{}' \; | cut -d / -f 1-5


You'd have to change ddd-3.3.11.tar.gz(I used it because I had it), but 
you can then output a list of all the directories you need to build the 
port in.  You can then probably use xargs to automatically make that 
port.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread Mel
On Friday 12 October 2007 00:39:27 James wrote:
 On Thu, 2007-10-11 at 18:14 -0400, Robert Huff wrote:
  James writes:
What has happened, though, is I've never ran rm in
/usr/ports/distfiles.  I'm going to think for a little bit about
a script that can move through /usr/ports/distfiles and reinstall
everything that exists there.
 
  Having been in almost the identical situation for different
  rasons, I sympathize.
  Yes, this will involve a sweep through /usr/ports distfiles.
  If you haven't ever deleted anything, I suggest a prelimiary manual
  run deleting everything but the most recent version.  This has a
  down-side, but it will prevent cluttering the rebuilt system with
  unused ports.

 /usr/ports/distfiles is definitely looking promising. awk is too damn
 painful to work with, so I'm going to dust off my perl skills.

 Hell, this could actually turn out to be fun. And if I write the script
 properly, it might make a nice disaster recovery tool
 for /usr/ports/ports-mgmt - it can be called
 WhenYou'reAnIdiotLikeJamesWasOnFreeBSDQuestions



 Well, if you figure out what ports you have installed, you can
 regenerate the

  pkgdb using:
 
  make -DNO_BUILD -DNO_INSTALL generate-plist fake-pkg
 
  for each port.
  I just tested that using a temporary PKG_DBDIR. In case you wanna see
  what happens, here's what I did:
 
  mkdir -p /tmp/var/db/pkg
  cd /usr/ports/shells/bash
  env PKG_DBDIR=/tmp/var/db/pkg make -DNO_BUILD -DNO_INSTALL \
  generate-plist fake-pkg

 Wow, that's great! I understand that it has the caveats that you mentioned,
 but it's *at least* a fantastic start.

OK, found the culprit after some digging. Quite enlightening. The pkg_create 
command gets fed the output of make actual-depends-list, which generates a 
package dependency list based on what's really installed, by looking 
into /var/db/pkg. Of course this doesn't work for you.

The solution lies in PKG_ARGS. I created a Makefile.local in x11/kdebase3 (cuz 
I was there), with the following one-liner:
PKG_ARGS=   -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p 
${PREFIX} -P `cd ${.CURDIR}  ${MAKE} package-depends | ${GREP} -v -E 
${PKG_IGNORE_DEPENDS} | ${SORT} -u -t : -k 2` ${EXTRA_PKG_ARGS} 
$${_LATE_PKG_ARGS}

This is a copy of PKG_ARGS as defined in /usr/ports/Mk/bsd.port.mk with the 
difference that it uses package-depends rather then actual-package-depends to 
generate the dependency list.

I'm 90% sure this ignores any WITH_ knobs/options you've set to generate the 
dependency list, so you'll have to fix any stale dependencies with pkgdb -F 
or similar tools later.

Adding the above line to /etc/make.conf should work for you - make sure it's 
one line or escape properly ;)

-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread James

This isn't quite as simple as I'd hoped it'd be to fix. Here's my
findings thus far (I haven't started writing my script yet, but I will
later today):

1. /usr/ports/distfiles contains everything I need
2. distfiles contains several versions of some packages, but that's
pretty trivial to resolve.
3. distfiles contains some packages whose source tarballs are named
*differently* to the packages themselves, such as unrar.

It's number 3 that's getting me.  It looks like the simplest thing might
be an if statement:

if (make search name=$PACKAGE)
score!
else
grep -r $PACKAGE /usr/ports

But before I go that far, I wanted to see if anyone had an alternate
idea for what might work.


James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread RW
On Thu, 11 Oct 2007 14:26:19 -0600
James [EMAIL PROTECTED] wrote:

 Call it a moment of sheer stupidity, call it a misremembering, call it
 whatever you want (and I imagine I'll hear a few different ones), but
 I just did an rm -r /var/lib/pkg.
 
 Before I type anything to damage things further, does anyone have any
 suggestions as to how to recover from this? I have other FreeBSD boxes
 available to me, none with the same pkg list, though. I'll be reading
 man pkgdb in the meantime..


This came up recently in another thread, and what seemed to be the best
solution to me, was this:

1. work out which leaf-ports you actually need - don't worry about the
dependencies.

2. at your leisure build new packages under a chroot environment, or on
another machine.

3. back-up /usr/local/etc (or the whole of /usr/local)

4. rm -rf  /usr/local/*

5. Restore  /usr/local/etc and install packages.

(If you have xorg installed, and it's not up-to-date, you may need to
consider /usr/X11R6 too)


This seems to be a good solution, it avoids more than a few minutes
disruption, avoids leaving any orphaned files,and most importantly
makes sure that all of the installed package have an entry
in /var/db/pkg. If you miss any of these entries, it may cause a lot of
trouble down the line.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread Mel
On Friday 12 October 2007 22:19:41 RW wrote:
 On Thu, 11 Oct 2007 14:26:19 -0600

 James [EMAIL PROTECTED] wrote:
  Call it a moment of sheer stupidity, call it a misremembering, call it
  whatever you want (and I imagine I'll hear a few different ones), but
  I just did an rm -r /var/lib/pkg.
 
  Before I type anything to damage things further, does anyone have any
  suggestions as to how to recover from this? I have other FreeBSD boxes
  available to me, none with the same pkg list, though. I'll be reading
  man pkgdb in the meantime..

 This came up recently in another thread, and what seemed to be the best
 solution to me, was this:

 1. work out which leaf-ports you actually need - don't worry about the
 dependencies.

 2. at your leisure build new packages under a chroot environment, or on
 another machine.

 3. back-up /usr/local/etc (or the whole of /usr/local)

 4. rm -rf  /usr/local/*

 5. Restore  /usr/local/etc and install packages.

Why would you go through 3-5 when you can just 
mv /chroot/build/directory/var/db/pkg /var/db/pkg ?

-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-12 Thread RW
On Fri, 12 Oct 2007 23:13:58 +0200
Mel [EMAIL PROTECTED] wrote:

 On Friday 12 October 2007 22:19:41 RW wrote:
  On Thu, 11 Oct 2007 14:26:19 -0600
 
  James [EMAIL PROTECTED] wrote:
   Call it a moment of sheer stupidity, call it a misremembering,
   call it whatever you want (and I imagine I'll hear a few
   different ones), but I just did an rm -r /var/lib/pkg.
  
   Before I type anything to damage things further, does anyone have
   any suggestions as to how to recover from this? I have other
   FreeBSD boxes available to me, none with the same pkg list,
   though. I'll be reading man pkgdb in the meantime..
 
  This came up recently in another thread, and what seemed to be the
  best solution to me, was this:
 
  1. work out which leaf-ports you actually need - don't worry about
  the dependencies.
 
  2. at your leisure build new packages under a chroot environment,
  or on another machine.
 
  3. back-up /usr/local/etc (or the whole of /usr/local)
 
  4. rm -rf  /usr/local/*
 
  5. Restore  /usr/local/etc and install packages.
 
 Why would you go through 3-5 when you can just 
 mv /chroot/build/directory/var/db/pkg /var/db/pkg ?

For the reasons that that you snipped off the bottom of my post.

   ... avoids leaving any orphaned files,and most
  importantly makes sure that all of the installed package have an
  entry in /var/db/pkg. If you miss any of these entries, it may
  cause a lot of trouble down the line.

/chroot/build/directory/var/db/pkg is only a rough guess as to
what was actually installed under /usr/local/.  Maybe some forgotten
dependency doesn't get included in the new build.  A year from now you
may find odd build problems, or new port installs may use orphaned
files with critical vulnerabilities that portaudit can't detect. 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


I performed an rm -r on /var/lib/pkg

2007-10-11 Thread James
Call it a moment of sheer stupidity, call it a misremembering, call it
whatever you want (and I imagine I'll hear a few different ones), but I
just did an rm -r /var/lib/pkg.

Before I type anything to damage things further, does anyone have any
suggestions as to how to recover from this? I have other FreeBSD boxes
available to me, none with the same pkg list, though. I'll be reading
man pkgdb in the meantime..

James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread Kevin Kinsey

James wrote:

Call it a moment of sheer stupidity, call it a misremembering, call it
whatever you want (and I imagine I'll hear a few different ones), but I
just did an rm -r /var/lib/pkg.

Before I type anything to damage things further, does anyone have any
suggestions as to how to recover from this? I have other FreeBSD boxes
available to me, none with the same pkg list, though. I'll be reading
man pkgdb in the meantime..



I'm guessing you might be Real Tired(tm).  Do you mean
/var/db/pkg?

$ ll /var/lib/pkg
ls: /var/lib/pkg: No such file or directory

Kevin Kinsey
--
The proof of the pudding is in the eating.
-- Miguel de Cervantes
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread James
On Thu, 2007-10-11 at 15:53 -0500, Kevin Kinsey wrote:

 James wrote:
  Call it a moment of sheer stupidity, call it a misremembering, call it
  whatever you want (and I imagine I'll hear a few different ones), but I
  just did an rm -r /var/lib/pkg.
  
  Before I type anything to damage things further, does anyone have any
  suggestions as to how to recover from this? I have other FreeBSD boxes
  available to me, none with the same pkg list, though. I'll be reading
  man pkgdb in the meantime..
 
 
 I'm guessing you might be Real Tired(tm).  Do you mean
 /var/db/pkg?
 
 $ ll /var/lib/pkg
 ls: /var/lib/pkg: No such file or directory
 
 Kevin Kinsey



Yes, you're right. On all counts, I'm afraid. 

But, yes, ultimately. And the more I'm reading man pages, the more I'm
thinking that the only solution here will be to reinstall everything. I
was wondering if portmaster or something similar might be able to solve
this, but it looks like /var/db/pkg is what *everything* refers to.

I'm feeling like the least competent user in the world right now. Though
it *does* teach me a valuable lesson about backing up.

James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread Erik Trulsson
On Thu, Oct 11, 2007 at 03:07:37PM -0600, James wrote:
 On Thu, 2007-10-11 at 15:53 -0500, Kevin Kinsey wrote:
 
  James wrote:
   Call it a moment of sheer stupidity, call it a misremembering, call it
   whatever you want (and I imagine I'll hear a few different ones), but I
   just did an rm -r /var/lib/pkg.
   
   Before I type anything to damage things further, does anyone have any
   suggestions as to how to recover from this? I have other FreeBSD boxes
   available to me, none with the same pkg list, though. I'll be reading
   man pkgdb in the meantime..
  
  
  I'm guessing you might be Real Tired(tm).  Do you mean
  /var/db/pkg?
  
  $ ll /var/lib/pkg
  ls: /var/lib/pkg: No such file or directory
  
  Kevin Kinsey
 
 
 
 Yes, you're right. On all counts, I'm afraid. 
 
 But, yes, ultimately. And the more I'm reading man pages, the more I'm
 thinking that the only solution here will be to reinstall everything. I
 was wondering if portmaster or something similar might be able to solve
 this, but it looks like /var/db/pkg is what *everything* refers to.

Yes, /var/db/pkg/ is where all the information about installed
ports/packages is stored.
To recreate that information you will have to reinstall everything.


 
 I'm feeling like the least competent user in the world right now. Though
 it *does* teach me a valuable lesson about backing up.

Backups are good, yes.  Regular, up-to-date, backups are even better.



-- 
Insert your favourite quote here.
Erik Trulsson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread Kevin Kinsey

James wrote:

Yes, you're right. On all counts, I'm afraid.

But, yes, ultimately. And the more I'm reading man pages, the more I'm 
thinking that the only solution here will be to reinstall everything. I 
was wondering if portmaster or something similar might be able to solve 
this, but it looks like /var/db/pkg is what *everything* refers to.


I'm feeling like the least competent user in the world right now. Though 
it *does* teach me a valuable lesson about backing up.


Well, first off, be glad you weren't in / with your rm. :-)

I'll go out on a limb (IANAE), and suggest to you that /var/db/pkg
is very important when installing, removing, and upgrading ports (or
3rd party software), but it's not critical to the moment by moment
operating of such ports.

So, it's quite possible that everything can wait until you get
some sleep.

However, you are probably right about reinstall everything being
the course of action to take.  Another possibility:  get another box,
install everything on that, and copy /var/db/pkg over.

You will probably face some issues with consistency in the package
database as a result.  This will cause a few problems when you get
ready to update in the future; however, you can't really get stuck
too badly as a deinstall/reinstall will usually fix such things.

... then, of course, you have the possibility that a dependency
will not work with the new program.  This sort of thing bites in
any number of ways, especially after a reboot.

I'd probably try to wait for a period of relatively low demand
on the box, then do the reinstalling.  And get some sleep first ;-)

But, as I said, IANAE.

Kevin Kinsey
--
One way to make your old car run better is to look up the price of a
new model.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread James
On Thu, 2007-10-11 at 23:13 +0200, Erik Trulsson wrote:

 On Thu, Oct 11, 2007 at 03:07:37PM -0600, James wrote:
  On Thu, 2007-10-11 at 15:53 -0500, Kevin Kinsey wrote:
  
   James wrote:
Call it a moment of sheer stupidity, call it a misremembering, call it
whatever you want (and I imagine I'll hear a few different ones), but I
just did an rm -r /var/lib/pkg.

Before I type anything to damage things further, does anyone have any
suggestions as to how to recover from this? I have other FreeBSD boxes
available to me, none with the same pkg list, though. I'll be reading
man pkgdb in the meantime..
   
   
   I'm guessing you might be Real Tired(tm).  Do you mean
   /var/db/pkg?
   
   $ ll /var/lib/pkg
   ls: /var/lib/pkg: No such file or directory
   
   Kevin Kinsey
  
  
  
  Yes, you're right. On all counts, I'm afraid. 
  
  But, yes, ultimately. And the more I'm reading man pages, the more I'm
  thinking that the only solution here will be to reinstall everything. I
  was wondering if portmaster or something similar might be able to solve
  this, but it looks like /var/db/pkg is what *everything* refers to.
 
 Yes, /var/db/pkg/ is where all the information about installed
 ports/packages is stored.
 To recreate that information you will have to reinstall everything.
 
 
  
  I'm feeling like the least competent user in the world right now. Though
  it *does* teach me a valuable lesson about backing up.
 
 Backups are good, yes.  Regular, up-to-date, backups are even better.
 
 
 


Alas, though, regular, up-to-date backups ain't happened here.

What has happened, though, is I've never ran rm in /usr/ports/distfiles.
I'm going to think for a little bit about a script that can move
through /usr/ports/distfiles and reinstall everything that exists there.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread Robert Huff

James writes:

  What has happened, though, is I've never ran rm in
  /usr/ports/distfiles.  I'm going to think for a little bit about
  a script that can move through /usr/ports/distfiles and reinstall
  everything that exists there.

Having been in almost the identical situation for different
rasons, I sympathize.
Yes, this will involve a sweep through /usr/ports distfiles.
If you haven't ever deleted anything, I suggest a prelimiary manual
run deleting everything but the most recent version.  This has a
down-side, but it will prevent cluttering the rebuilt system with
unused ports.
The other thing you want do is start with something /big/ -
OpenOffice, FireFox, GIMP, Java, Apache.  While rebuilding it will
take time (possibly days) it will automatically suck in the
dependencies.
Send the output of the rebuild to a file; have a cron job
e-mail you the last 50 lines every hour.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread Mel
On Thursday 11 October 2007 23:29:05 James wrote:

 What has happened, though, is I've never ran rm in /usr/ports/distfiles.
 I'm going to think for a little bit about a script that can move
 through /usr/ports/distfiles and reinstall everything that exists there.

Well, if you figure out what ports you have installed, you can regenerate the 
pkgdb using:

make -DNO_BUILD -DNO_INSTALL generate-plist fake-pkg

for each port.
I just tested that using a temporary PKG_DBDIR. In case you wanna see what 
happens, here's what I did:

mkdir -p /tmp/var/db/pkg
cd /usr/ports/shells/bash
env PKG_DBDIR=/tmp/var/db/pkg make -DNO_BUILD -DNO_INSTALL \
generate-plist fake-pkg

# ls /tmp/var/db/pkg/bash-3.2.25/
+COMMENT+DEINSTALL  +INSTALL
+CONTENTS   +DESC   +MTREE_DIRS

It's missing +REQUIRED_BY and @pkgdep lines in +CONTENTS, but haven't been 
able to figure out yet why that is.
I hope this gets you a bit closer.
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I performed an rm -r on /var/lib/pkg

2007-10-11 Thread James
On Thu, 2007-10-11 at 18:14 -0400, Robert Huff wrote:

 James writes:
 
   What has happened, though, is I've never ran rm in
   /usr/ports/distfiles.  I'm going to think for a little bit about
   a script that can move through /usr/ports/distfiles and reinstall
   everything that exists there.
 
   Having been in almost the identical situation for different
 rasons, I sympathize.
   Yes, this will involve a sweep through /usr/ports distfiles.
 If you haven't ever deleted anything, I suggest a prelimiary manual
 run deleting everything but the most recent version.  This has a
 down-side, but it will prevent cluttering the rebuilt system with
 unused ports.


/usr/ports/distfiles is definitely looking promising. awk is too damn
painful to work with, so I'm going to dust off my perl skills.

Hell, this could actually turn out to be fun. And if I write the script
properly, it might make a nice disaster recovery tool
for /usr/ports/ports-mgmt - it can be called
WhenYou'reAnIdiotLikeJamesWasOnFreeBSDQuestions



Well, if you figure out what ports you have installed, you can
regenerate the 

 pkgdb using:
 
 make -DNO_BUILD -DNO_INSTALL generate-plist fake-pkg
 
 for each port.
 I just tested that using a temporary PKG_DBDIR. In case you wanna see what 
 happens, here's what I did:
 
 mkdir -p /tmp/var/db/pkg
 cd /usr/ports/shells/bash
 env PKG_DBDIR=/tmp/var/db/pkg make -DNO_BUILD -DNO_INSTALL \
   generate-plist fake-pkg
 
 

Wow, that's great! I understand that it has the caveats that you mentioned, but 
it's
*at least* a fantastic start. 

James
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: urgent: I just rm-r a directory

2006-08-07 Thread Ian Lord

Thanks to all how had replyed to me :)

I'm from a dos/windows world so I was hoping for an undelete 
utility On fat partitions data is not deleted, it's just flag as 
deleted,  so I though it was the same for freebsd.


Seems like I'll have to call the company that store our tapes offsite 
to recover :)


Thanks to all

At 20:34 2006-08-06, jan gestre wrote:

On 8/7/06, Ian Lord [EMAIL PROTECTED] wrote:


I did a rm-r by mistake on a directory... any way to recover ?

Help please :(

_


if you don't have back ups of the directory concerned, i'm sorry to inform
you that you won't be able to recover it. a word of advise, at least make
the rm with -i switch to make it interactive, that way it will ask you first
before deleting, good thing though it's not your / you deleted :D
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: urgent: I just rm-r a directory

2006-08-07 Thread Vesselin Peev

Hello,

Note that the files contents itself are still on the disk if they haven't 
been overwritten by later disk operations. If you do not have a backup and 
you know what you are looking for, you can use commands such as grep or 
strings over the disk partition. You can find explanatory pages on the 
Internet about that, such as 
http://bluesmoon.blogspot.com/2004/08/undelete-in-freebsd.html.
(And if you don't want to take any chances, there are companies specialising 
in data recovery.)


Regards,
Vesselin.


From: Ian Lord [EMAIL PROTECTED]
To: freebsd-questions@freebsd.org
Subject: Re: urgent: I just rm-r a directory
Date: Mon, 07 Aug 2006 08:44:48 -0400

Thanks to all how had replyed to me :)

I'm from a dos/windows world so I was hoping for an undelete utility On 
fat partitions data is not deleted, it's just flag as deleted,  so I though 
it was the same for freebsd.


Seems like I'll have to call the company that store our tapes offsite to 
recover :)


Thanks to all

At 20:34 2006-08-06, jan gestre wrote:

On 8/7/06, Ian Lord [EMAIL PROTECTED] wrote:


I did a rm-r by mistake on a directory... any way to recover ?

Help please :(

_


if you don't have back ups of the directory concerned, i'm sorry to inform
you that you won't be able to recover it. a word of advise, at least make
the rm with -i switch to make it interactive, that way it will ask you 
first

before deleting, good thing though it's not your / you deleted :D
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


urgent: I just rm-r a directory

2006-08-06 Thread Ian Lord

I did a rm-r by mistake on a directory... any way to recover ?

Help please :(

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: urgent: I just rm-r a directory

2006-08-06 Thread Nicolas Blais
On Sunday 06 August 2006 18:02, Ian Lord wrote:
 I did a rm-r by mistake on a directory... any way to recover ?

 Help please :(

Restore from your backups :)

Seriously, if you don't have backups, your chances of recovery are near 0.

Nicolas.

-- 
FreeBSD 7.0-CURRENT #11: Sun Jul 30 12:12:59 EDT 2006 
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/CLK01A 
PGP? : http://www.clkroot.net/security/nb_root.asc


pgpUukV8HK4Ix.pgp
Description: PGP signature


Re: urgent: I just rm-r a directory

2006-08-06 Thread Bill Moran
Ian Lord [EMAIL PROTECTED] wrote:

 I did a rm-r by mistake on a directory... any way to recover ?

As has already been said, it's extremely difficult to recover an
rmed directory.

If you don't have backups, and the data is _very_ importation, immediately
shut down the OS and turn off the system to avoid overwriting anything.
It's possible that there's still enough data on the disk to reconstruct
everything, but any time you write to the disk you could be destroying
it.

From there, the road to recovery is difficult and/or expensive.  There
are folks out there with the knowledge to recover a deleted directory,
and there are some HOWTOs floating around the 'net, but it's an involved
and time-consuming process.

-- 
Bill Moran

Democracy is two wolves and a lamb voting on what to have
for lunch. Liberty is a well-armed lamb contesting the vote.

Benjamin Franklin

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: urgent: I just rm-r a directory

2006-08-06 Thread jan gestre

On 8/7/06, Ian Lord [EMAIL PROTECTED] wrote:


I did a rm-r by mistake on a directory... any way to recover ?

Help please :(

_


if you don't have back ups of the directory concerned, i'm sorry to inform
you that you won't be able to recover it. a word of advise, at least make
the rm with -i switch to make it interactive, that way it will ask you first
before deleting, good thing though it's not your / you deleted :D
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


rm -r on large dir causing spontaneous reboot w/ 5.1-REL

2003-12-20 Thread Jason Leonard
Greetings,

I have a Dell PowerEdge 2650 with one 2.8G Xeon CPU and 2G RAM running 
5.1-RELEASE.  This machine is a dedicated NFS server.  Everything on the 
system is default: no custom kernel, no custom filesystem options, no 
tweaking.

Earlier today I ran rm -R on a directory containing millions of files 
in its various subdirectories.  Within a minute or so the machine hung, 
NFS stopped working, and I had a posse of angry computational linguists 
knocking on my door.  I ^Ced to no avail.  So I tried opening another ssh 
session--no luck.  I pinged.  I nmapped.  Nothing.  I jumped up and ran 
to the server room.  By the time I got there it was back up (whew!) but 
it had rebooted itself in the process (d'oh!).

The directory, or most of it, was still there.

I tried not to think too much about it.  I went to the annual holiday 
party.  I had a few adult beverages.  I woke up a little while ago with a 
mysterious and slightly painful bump on my forehead and something 
scribbled on my dining room table with a green Sharpie*.  It seemed as 
good a time as any to try deleting that directory again.

So I did.  With identical results.  The machine hung for a few minutes 
and then spontenously rebooted.

The total size of the directory is ~100G.  It lives on a 1T UFS2+S 
partition of a 7x200G hardware RAID 5 array, which itself lives in a 
16x200G ATA-to-SCSI cabinet.  The directory contains millions of tiny 
files collected by a website harvesting project.

Any thoughts as to why this might be happening?


:Fuzz

--
Jason M. LeonardLinguistic Data Consortium
Systems Administrator   University of Pennsylvania
[EMAIL PROTECTED]   215.573.3959 vx   .2175 fx

*In all fairness to myself, the surface of my dining room table does 
resemble markerboard.  And Sharpies do resemble dry erase markers.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]