Closed MapleLCG closed 2 months ago
I built from released source
and I did this
make libs && make install
then
make uninstall
there is no check berfore "rm -f" command I'm saddened by the disappearance of my /usr/local/bin, but in order to prevent more people from having the same experience as me, I'll try to give the solution
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails
INSTALL_DIR={{INSTALL_DIR}}
# Function to check if file or directory exists before removing
check_and_remove() {
if [ -e "$1" ]; then
rm -f "$1"
elif [ -d "$1" ]; then
rm -rf "$1"
else
echo "Skipping deletion of non-existent path: $1"
fi
}
# Check if the installation directory exists
if [ ! -d "$INSTALL_DIR" ]; then
echo "Installation directory does not exist: $INSTALL_DIR"
exit 1
fi
# remove libs
check_and_remove "$INSTALL_DIR/lib/libCommon++.a"
check_and_remove "$INSTALL_DIR/lib/libPacket++.a"
check_and_remove "$INSTALL_DIR/lib/libPcap++.a"
# remove header files
check_and_remove "$INSTALL_DIR/include/pcapplusplus"
# Check if the examples directory exists before removing its contents
if [ -d "$INSTALL_DIR/bin/examples" ]; then
for f in "$INSTALL_DIR/bin/examples"/*; do
check_and_remove "$f"
done
else
echo "Examples directory does not exist, skipping: $INSTALL_DIR/bin/examples"
fi
# remove template makefile
check_and_remove "$INSTALL_DIR/etc/PcapPlusPlus.mk"
# remove PcapPlusPlus.pc
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-$INSTALL_DIR/lib/pkgconfig}"
check_and_remove "$PKG_CONFIG_PATH/PcapPlusPlus.pc"
Personally, I think it's enough to check if the examples folder exists, but these seemingly pointless checks make me feel more at ease hahaha
@MapleLCG v22.11 is not the newest version, did you try v23.09 to see if it works?
@MapleLCG v22.11 is not the newest version, did you try v23.09 to see if it works?
In the beginning,I used v23.09. Then I wanted to use v22.11. It’s fine when I uninstall v23.09
@MapleLCG v22.11 is not the newest version, did you try v23.09 to see if it works?
In the beginning,I used v23.09. Then I wanted to use v22.11. It’s fine when I uninstall v23.09
I'm curious why do you prefer v22.11 over v23.09? 🤔
@MapleLCG v22.11 is not the newest version, did you try v23.09 to see if it works?
In the beginning,I used v23.09. Then I wanted to use v22.11. It’s fine when I uninstall v23.09
I'm curious why do you prefer v22.11 over v23.09? 🤔
Because when I started using v23.09, although the program compiled and passed, it couldn't get my NIC when I ran it. In the process of troubleshooting the problem, out of personal habit, I downgraded pcpp, so I installed v22.11. I found out later that this is not a pcpp problem, so I'm going to uninstall v22.11 and go back to using v23.09.
I actually prefer to use the latest version, but occasionally I just try older releases for various reasons.
Because when I started using v23.09, although the program compiled and passed, it couldn't get my NIC when I ran it. In the process of troubleshooting the problem, out of personal habit, I downgraded pcpp, so I installed v22.11. I found out later that this is not a pcpp problem, so I'm going to uninstall v22.11 and go back to using v23.09.
I actually prefer to use the latest version, but occasionally I just try older releases for various reasons.
Got it. I'm not sure we want to debug and fix issues in v22.11 (we never did it before...), mostly because there is a newer version that fixes it...
Because when I started using v23.09, although the program compiled and passed, it couldn't get my NIC when I ran it. In the process of troubleshooting the problem, out of personal habit, I downgraded pcpp, so I installed v22.11. I found out later that this is not a pcpp problem, so I'm going to uninstall v22.11 and go back to using v23.09. I actually prefer to use the latest version, but occasionally I just try older releases for various reasons.
Got it. I'm not sure we want to debug and fix issues in v22.11 (we never did it before...), mostly because there is a newer version that fixes it...
I understand. But note that an identical issue was mentioned back in 2020. i haven't checked other versions and i'm not sure if the cause of his issue is the same as mine. So it's possible that versions prior to v23.09 have this problem. But if you guys don't think it needs to be fixed, please at least alert people to the problem and recommend using the latest release. Thanks for your replies.
I assume it happens in all versions prior to v22.11 because we didn't change much in the installation scripts over the years (until v23.09 where we moved to CMake).
What's weird is that I never encountered this issue myself, and never heard it from anyone else. I'd assume someone would bump into it by now 🤔
Maybe you added specific params when you installed/uninstalled PcapPlusPlus?
I assume it happens in all versions prior to v22.11 because we didn't change much in the installation scripts over the years (until v23.09 where we moved to CMake).
What's weird is that I never encountered this issue myself, and never heard it from anyone else. I'd assume someone would bump into it by now 🤔
Maybe you added specific params when you installed/uninstalled PcapPlusPlus?
I edited 2nd comment to show what i did. IDK how do you read github issue,so maybe you didnt see my change
Well it's in Ubuntu 22.04.4 LTS and
donwload source -> ./configure-linux.sh (pf_ring=no, dpdk=no) -> make libs -> make install -> make uninstall.
I did't make examples and unit-tests.
docs told me that I could just make libs
https://pcapplusplus.github.io/docs/v22.11/install/linux#build-the-code
I'll try it myself and let you know if I see this issue also
@MapleLCG this is a bug indeed, but only when you run make libs
. If you run make
it will build the examples, copy them to /usr/local/bin
, and when running make uninstall
it won't delete the entire directory content.
So the workaround is to run make
.
Unfortunately, we don't have a way to fix v22.11. My recommendation is to use the latest version which is v23.09
Bug description
I see there is a guy open a same issue in 2020,but he didnt give more information. This is what I did
and the dir structure is
uninstal.sh
Don't know much about how sh script works, but I think it's a case issue with ”examples“ dir well,in ”mk”,there is no dir named examples in source dir,there is a dir named Examples Could this be the reason?
PcapPlusPlus versions tested on
v22.11
Other PcapPlusPlus version (if applicable)
No response
Operating systems tested on
Linux
Other operation systems (if applicable)
No response
Compiler version
gcc
Packet capture backend (if applicable)
No response